| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_EXO_WM_HELPER_MUS_H_ | 5 #ifndef COMPONENTS_EXO_WM_HELPER_MUS_H_ |
| 6 #define COMPONENTS_EXO_WM_HELPER_MUS_H_ | 6 #define COMPONENTS_EXO_WM_HELPER_MUS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/exo/wm_helper.h" | 9 #include "components/exo/wm_helper.h" |
| 10 #include "services/ui/public/cpp/window_tree_client_observer.h" | 10 #include "services/ui/public/cpp/window_tree_client_observer.h" |
| 11 #include "ui/aura/client/focus_change_observer.h" | 11 #include "ui/aura/client/focus_change_observer.h" |
| 12 #include "ui/aura/env_observer.h" |
| 13 #include "ui/events/event_handler.h" |
| 12 | 14 |
| 13 namespace exo { | 15 namespace exo { |
| 14 | 16 |
| 15 // A helper class for accessing WindowManager related features. | 17 // A helper class for accessing WindowManager related features. |
| 16 class WMHelperMus : public WMHelper, | 18 class WMHelperMus : public WMHelper, |
| 19 public aura::EnvObserver, |
| 20 public ui::EventHandler, |
| 17 public ui::WindowTreeClientObserver, | 21 public ui::WindowTreeClientObserver, |
| 18 public aura::client::FocusChangeObserver { | 22 public aura::client::FocusChangeObserver { |
| 19 public: | 23 public: |
| 20 WMHelperMus(); | 24 WMHelperMus(); |
| 21 ~WMHelperMus() override; | 25 ~WMHelperMus() override; |
| 22 | 26 |
| 23 // Overriden from WMHelper: | 27 // Overriden from WMHelper: |
| 24 const ash::DisplayInfo GetDisplayInfo(int64_t display_id) const override; | 28 const ash::DisplayInfo GetDisplayInfo(int64_t display_id) const override; |
| 25 aura::Window* GetContainer(int container_id) override; | 29 aura::Window* GetContainer(int container_id) override; |
| 26 aura::Window* GetActiveWindow() const override; | 30 aura::Window* GetActiveWindow() const override; |
| 27 aura::Window* GetFocusedWindow() const override; | 31 aura::Window* GetFocusedWindow() const override; |
| 28 ui::CursorSetType GetCursorSet() const override; | 32 ui::CursorSetType GetCursorSet() const override; |
| 29 void AddPreTargetHandler(ui::EventHandler* handler) override; | 33 void AddPreTargetHandler(ui::EventHandler* handler) override; |
| 30 void PrependPreTargetHandler(ui::EventHandler* handler) override; | 34 void PrependPreTargetHandler(ui::EventHandler* handler) override; |
| 31 void RemovePreTargetHandler(ui::EventHandler* handler) override; | 35 void RemovePreTargetHandler(ui::EventHandler* handler) override; |
| 32 void AddPostTargetHandler(ui::EventHandler* handler) override; | 36 void AddPostTargetHandler(ui::EventHandler* handler) override; |
| 33 void RemovePostTargetHandler(ui::EventHandler* handler) override; | 37 void RemovePostTargetHandler(ui::EventHandler* handler) override; |
| 34 bool IsMaximizeModeWindowManagerEnabled() const override; | 38 bool IsMaximizeModeWindowManagerEnabled() const override; |
| 35 | 39 |
| 40 // Overriden from aura::EnvObserver: |
| 41 void OnWindowInitialized(aura::Window* window) override {} |
| 42 void OnHostInitialized(aura::WindowTreeHost* host) override; |
| 43 |
| 36 // Overriden from ui::WindowTreeClientObserver: | 44 // Overriden from ui::WindowTreeClientObserver: |
| 37 void OnWindowTreeFocusChanged(ui::Window* gained_focus, | 45 void OnWindowTreeFocusChanged(ui::Window* gained_focus, |
| 38 ui::Window* lost_focus) override; | 46 ui::Window* lost_focus) override; |
| 39 | 47 |
| 40 // Overriden from ui::client::FocusChangeObserver: | 48 // Overriden from ui::client::FocusChangeObserver: |
| 41 void OnWindowFocused(aura::Window* gained_focus, | 49 void OnWindowFocused(aura::Window* gained_focus, |
| 42 aura::Window* lost_focus) override; | 50 aura::Window* lost_focus) override; |
| 43 | 51 |
| 44 private: | 52 private: |
| 53 class EventForwarder; |
| 54 |
| 55 ui::EventHandlerList pre_target_list_; |
| 56 ui::EventHandlerList post_target_list_; |
| 57 |
| 58 std::unique_ptr<EventForwarder> pre_target_event_forwarder_; |
| 59 std::unique_ptr<EventForwarder> post_target_event_forwarder_; |
| 60 |
| 45 aura::Window* active_window_; | 61 aura::Window* active_window_; |
| 46 aura::Window* focused_window_; | 62 aura::Window* focused_window_; |
| 47 | 63 |
| 48 DISALLOW_COPY_AND_ASSIGN(WMHelperMus); | 64 DISALLOW_COPY_AND_ASSIGN(WMHelperMus); |
| 49 }; | 65 }; |
| 50 | 66 |
| 51 } // namespace exo | 67 } // namespace exo |
| 52 | 68 |
| 53 #endif // COMPONENTS_EXO_WM_HELPER_H_ | 69 #endif // COMPONENTS_EXO_WM_HELPER_H_ |
| OLD | NEW |