accelerator_keys_mojom_traits.h 747 B

1234567891011121314151617181920212223
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_PUBLIC_MOJOM_ACCELERATOR_KEYS_MOJOM_TRAITS_H_
  5. #define ASH_PUBLIC_MOJOM_ACCELERATOR_KEYS_MOJOM_TRAITS_H_
  6. #include "ash/public/mojom/accelerator_keys.mojom.h"
  7. #include "mojo/public/cpp/bindings/enum_traits.h"
  8. #include "ui/events/keycodes/keyboard_codes_posix.h"
  9. namespace mojo {
  10. template <>
  11. struct EnumTraits<ash::mojom::VKey, ::ui::KeyboardCode> {
  12. static ash::mojom::VKey ToMojom(::ui::KeyboardCode);
  13. static bool FromMojom(::ash::mojom::VKey input, ::ui::KeyboardCode* out);
  14. };
  15. } // namespace mojo
  16. #endif // ASH_PUBLIC_MOJOM_ACCELERATOR_KEYS_MOJOM_TRAITS_H_