login_accelerators.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright 2020 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_CPP_LOGIN_ACCELERATORS_H_
  5. #define ASH_PUBLIC_CPP_LOGIN_ACCELERATORS_H_
  6. #include <stddef.h>
  7. #include <string>
  8. #include "ash/public/cpp/ash_public_export.h"
  9. #include "ui/events/event_constants.h"
  10. #include "ui/events/keycodes/keyboard_codes.h"
  11. namespace ash {
  12. // Accelerator actions specific for out-of-box flow, login and lock screens.
  13. // Flags that define in which contexts accelerator should be enabled.
  14. enum LoginActionScope {
  15. // Available during out-of-box flow.
  16. kScopeOobe = 1 << 0,
  17. // Available on the login screen.
  18. kScopeLogin = 1 << 1,
  19. // Available on the lock screen.
  20. kScopeLock = 1 << 2,
  21. };
  22. enum LoginAcceleratorAction {
  23. kToggleSystemInfo,
  24. kShowFeedback,
  25. kShowResetScreen,
  26. kAppLaunchBailout,
  27. kAppLaunchNetworkConfig,
  28. kCancelScreenAction,
  29. kStartEnrollment,
  30. kStartKioskEnrollment,
  31. kEnableConsumerKiosk,
  32. kEnableDebugging,
  33. kEditDeviceRequisition,
  34. kDeviceRequisitionRemora,
  35. kStartDemoMode,
  36. kLaunchDiagnostics,
  37. };
  38. struct LoginAcceleratorData {
  39. LoginAcceleratorAction action;
  40. ui::KeyboardCode keycode;
  41. // Combination of ui::EventFlags.
  42. int modifiers;
  43. // Defines if accelerator will be registered in AcceleratorController (|true|)
  44. // or only for login/lock dialog view (|false|).
  45. bool global;
  46. // Combination of LoginActionScope flags.
  47. int scope;
  48. };
  49. // Accelerators handled by OOBE / Login components.
  50. ASH_PUBLIC_EXPORT extern const LoginAcceleratorData kLoginAcceleratorData[];
  51. ASH_PUBLIC_EXPORT extern const size_t kLoginAcceleratorDataLength;
  52. } // namespace ash
  53. #endif // ASH_PUBLIC_CPP_LOGIN_ACCELERATORS_H_