| OLD | NEW | 
| (Empty) |  | 
 |   1 // Copyright 2017 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  | 
 |   5 #ifndef COMPONENTS_KEYBOARD_LOCK_KEY_HOOK_ACTIVATOR_H_ | 
 |   6 #define COMPONENTS_KEYBOARD_LOCK_KEY_HOOK_ACTIVATOR_H_ | 
 |   7  | 
 |   8 #include <vector> | 
 |   9  | 
 |  10 #include "base/callback.h" | 
 |  11 #include "components/keyboard_lock/key_hook.h" | 
 |  12 #include "ui/events/keycodes/keyboard_codes.h" | 
 |  13  | 
 |  14 namespace keyboard_lock { | 
 |  15  | 
 |  16 // An interface to store all registered key codes and register or unregister | 
 |  17 // them with one Activate() or Deactivate() function call. | 
 |  18 // The implementation needs to guarantee the thread-safety of Activate() and | 
 |  19 // Deactivate() functions, which may be executed in both UI thread and | 
 |  20 // network thread. | 
 |  21 class KeyHookActivator : public KeyHook { | 
 |  22  public: | 
 |  23   KeyHookActivator() = default; | 
 |  24   ~KeyHookActivator() override = default; | 
 |  25  | 
 |  26   // Meaning of |on_result| is same as the one in KeyHook::RegisterKey(). | 
 |  27  | 
 |  28   // Enables all registered key codes. | 
 |  29   virtual void Activate(base::Callback<void(bool)> on_result) = 0; | 
 |  30  | 
 |  31   // Disables all registered key codes. | 
 |  32   virtual void Deactivate(base::Callback<void(bool)> on_result) = 0; | 
 |  33 }; | 
 |  34  | 
 |  35 }  // namespace keyboard_lock | 
 |  36  | 
 |  37 #endif  // COMPONENTS_KEYBOARD_LOCK_KEY_HOOK_ACTIVATOR_H_ | 
| OLD | NEW |