 Chromium Code Reviews
 Chromium Code Reviews Issue 2506263002:
  exo: Implement support for zcr_keyboard_configuration_v1 protocol.  (Closed)
    
  
    Issue 2506263002:
  exo: Implement support for zcr_keyboard_configuration_v1 protocol.  (Closed) 
  | Index: components/exo/keyboard.h | 
| diff --git a/components/exo/keyboard.h b/components/exo/keyboard.h | 
| index 9a20afd771daa51e6bd5182a027e1463578a4c2f..e0342af076f67f78bedb44ed2668b3aa42b78857 100644 | 
| --- a/components/exo/keyboard.h | 
| +++ b/components/exo/keyboard.h | 
| @@ -10,7 +10,6 @@ | 
| #include "base/macros.h" | 
| #include "components/exo/surface_observer.h" | 
| #include "components/exo/wm_helper.h" | 
| -#include "ui/aura/client/focus_change_observer.h" | 
| #include "ui/events/event_handler.h" | 
| namespace ui { | 
| @@ -20,17 +19,24 @@ class KeyEvent; | 
| namespace exo { | 
| class KeyboardDelegate; | 
| +class KeyboardDeviceConfigurationDelegate; | 
| class Surface; | 
| // This class implements a client keyboard that represents one or more keyboard | 
| // devices. | 
| class Keyboard : public ui::EventHandler, | 
| public WMHelper::FocusObserver, | 
| + public WMHelper::InputDeviceEventObserver, | 
| + public WMHelper::MaximizeModeObserver, | 
| public SurfaceObserver { | 
| public: | 
| explicit Keyboard(KeyboardDelegate* delegate); | 
| + | 
| 
reveman
2016/12/09 16:15:02
nit: no need for this blankline. ctor/dtor can be
 
yhanada
2016/12/10 00:09:11
Done.
 | 
| ~Keyboard() override; | 
| + void SetDeviceConfigurationDelegate( | 
| + KeyboardDeviceConfigurationDelegate* delegate); | 
| + | 
| // Overridden from ui::EventHandler: | 
| void OnKeyEvent(ui::KeyEvent* event) override; | 
| @@ -41,13 +47,25 @@ class Keyboard : public ui::EventHandler, | 
| // Overridden from SurfaceObserver: | 
| void OnSurfaceDestroying(Surface* surface) override; | 
| + // Overridden from ui::InputDeviceEventObserver: | 
| + void OnKeyboardDeviceConfigurationChanged() override; | 
| + | 
| + // Overridden from WMHelper::MaximizeModeObserver: | 
| + void OnMaximizeModeStarted() override; | 
| + void OnMaximizeModeEnded() override; | 
| + | 
| private: | 
| // Returns the effective focus for |window|. | 
| Surface* GetEffectiveFocus(aura::Window* window) const; | 
| - // The delegate instance that all events are dispatched to. | 
| + // The delegate instance that all events except for events about device | 
| + // configuration are dispatched to. | 
| KeyboardDelegate* const delegate_; | 
| + // The delegate instance that events about device configuration are dispatched | 
| + // to. | 
| + KeyboardDeviceConfigurationDelegate* device_configuration_delegate_ = nullptr; | 
| + | 
| // The current focus surface for the keyboard. | 
| Surface* focus_ = nullptr; |