| 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 ASH_AURA_WM_ROOT_CONTROLLER_AURA_H_ | 5 #ifndef ASH_AURA_WM_ROOT_CONTROLLER_AURA_H_ |
| 6 #define ASH_AURA_WM_ROOT_CONTROLLER_AURA_H_ | 6 #define ASH_AURA_WM_ROOT_CONTROLLER_AURA_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/shell_observer.h" | 9 #include "ash/common/shell_observer.h" |
| 10 #include "ash/common/wm_root_window_controller.h" | 10 #include "ash/common/wm_root_window_controller.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/observer_list.h" | |
| 13 #include "ui/display/display_observer.h" | 12 #include "ui/display/display_observer.h" |
| 14 | 13 |
| 15 namespace aura { | 14 namespace aura { |
| 16 class Window; | 15 class Window; |
| 17 } | 16 } |
| 18 | 17 |
| 19 namespace ash { | 18 namespace ash { |
| 20 | 19 |
| 21 class RootWindowController; | 20 class RootWindowController; |
| 22 | 21 |
| 23 class ASH_EXPORT WmRootWindowControllerAura : public WmRootWindowController, | 22 class ASH_EXPORT WmRootWindowControllerAura : public WmRootWindowController, |
| 24 public ShellObserver, | 23 public ShellObserver, |
| 25 public display::DisplayObserver { | 24 public display::DisplayObserver { |
| 26 public: | 25 public: |
| 27 explicit WmRootWindowControllerAura( | 26 explicit WmRootWindowControllerAura( |
| 28 RootWindowController* root_window_controller); | 27 RootWindowController* root_window_controller); |
| 29 ~WmRootWindowControllerAura() override; | 28 ~WmRootWindowControllerAura() override; |
| 30 | 29 |
| 31 static WmRootWindowControllerAura* Get(aura::Window* window) { | 30 static WmRootWindowControllerAura* Get(aura::Window* window) { |
| 32 return const_cast<WmRootWindowControllerAura*>( | 31 return const_cast<WmRootWindowControllerAura*>( |
| 33 Get(const_cast<const aura::Window*>(window))); | 32 Get(const_cast<const aura::Window*>(window))); |
| 34 } | 33 } |
| 35 static const WmRootWindowControllerAura* Get(const aura::Window* window); | 34 static const WmRootWindowControllerAura* Get(const aura::Window* window); |
| 36 | 35 |
| 37 // WmRootWindowController: | 36 // WmRootWindowController: |
| 38 bool HasShelf() override; | 37 bool HasShelf() override; |
| 39 WmShell* GetShell() override; | 38 WmShell* GetShell() override; |
| 40 wm::WorkspaceWindowState GetWorkspaceWindowState() override; | |
| 41 void SetMaximizeBackdropDelegate( | |
| 42 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate) | |
| 43 override; | |
| 44 AlwaysOnTopController* GetAlwaysOnTopController() override; | 39 AlwaysOnTopController* GetAlwaysOnTopController() override; |
| 45 WmShelf* GetShelf() override; | 40 WmShelf* GetShelf() override; |
| 46 WmWindow* GetWindow() override; | 41 WmWindow* GetWindow() override; |
| 47 void ConfigureWidgetInitParamsForContainer( | 42 void ConfigureWidgetInitParamsForContainer( |
| 48 views::Widget* widget, | 43 views::Widget* widget, |
| 49 int shell_container_id, | 44 int shell_container_id, |
| 50 views::Widget::InitParams* init_params) override; | 45 views::Widget::InitParams* init_params) override; |
| 51 WmWindow* FindEventTarget(const gfx::Point& location_in_screen) override; | 46 WmWindow* FindEventTarget(const gfx::Point& location_in_screen) override; |
| 52 gfx::Point GetLastMouseLocationInRoot() override; | 47 gfx::Point GetLastMouseLocationInRoot() override; |
| 53 void AddObserver(WmRootWindowControllerObserver* observer) override; | |
| 54 void RemoveObserver(WmRootWindowControllerObserver* observer) override; | |
| 55 | 48 |
| 56 // ShellObserver: | 49 // ShellObserver: |
| 57 void OnShelfAlignmentChanged(WmWindow* root_window) override; | 50 void OnShelfAlignmentChanged(WmWindow* root_window) override; |
| 58 | 51 |
| 59 // DisplayObserver: | 52 // DisplayObserver: |
| 60 void OnDisplayAdded(const display::Display& display) override; | 53 void OnDisplayAdded(const display::Display& display) override; |
| 61 void OnDisplayRemoved(const display::Display& display) override; | 54 void OnDisplayRemoved(const display::Display& display) override; |
| 62 void OnDisplayMetricsChanged(const display::Display& display, | 55 void OnDisplayMetricsChanged(const display::Display& display, |
| 63 uint32_t metrics) override; | 56 uint32_t metrics) override; |
| 64 | 57 |
| 65 private: | 58 private: |
| 59 friend class RootWindowController; |
| 60 |
| 66 RootWindowController* root_window_controller_; | 61 RootWindowController* root_window_controller_; |
| 67 base::ObserverList<WmRootWindowControllerObserver> observers_; | |
| 68 | 62 |
| 69 DISALLOW_COPY_AND_ASSIGN(WmRootWindowControllerAura); | 63 DISALLOW_COPY_AND_ASSIGN(WmRootWindowControllerAura); |
| 70 }; | 64 }; |
| 71 | 65 |
| 72 } // namespace ash | 66 } // namespace ash |
| 73 | 67 |
| 74 #endif // ASH_AURA_WM_ROOT_CONTROLLER_AURA_H_ | 68 #endif // ASH_AURA_WM_ROOT_CONTROLLER_AURA_H_ |
| OLD | NEW |