| 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_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ | 5 #ifndef ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ |
| 6 #define ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ | 6 #define ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/wm/workspace/workspace_types.h" | 9 #include "ash/common/wm/workspace/workspace_types.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "ui/base/ui_base_types.h" |
| 11 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 class Point; | 15 class Point; |
| 15 } | 16 } |
| 16 | 17 |
| 18 namespace ui { |
| 19 class MenuModel; |
| 20 } |
| 21 |
| 22 namespace views { |
| 23 class MenuModelAdapter; |
| 24 class MenuRunner; |
| 25 } |
| 26 |
| 17 namespace ash { | 27 namespace ash { |
| 18 | 28 |
| 19 class AlwaysOnTopController; | 29 class AlwaysOnTopController; |
| 20 class AnimatingWallpaperWidgetController; | 30 class AnimatingWallpaperWidgetController; |
| 21 class SystemModalContainerLayoutManager; | 31 class SystemModalContainerLayoutManager; |
| 22 class WallpaperWidgetController; | 32 class WallpaperWidgetController; |
| 23 class WmShelf; | 33 class WmShelf; |
| 24 class WmShell; | 34 class WmShell; |
| 25 class WmWindow; | 35 class WmWindow; |
| 26 class WorkspaceController; | 36 class WorkspaceController; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // (in screen coordinates). | 102 // (in screen coordinates). |
| 93 // | 103 // |
| 94 // NOTE: the returned window may not contain the location as resize handles | 104 // NOTE: the returned window may not contain the location as resize handles |
| 95 // may extend outside the bounds of the window. | 105 // may extend outside the bounds of the window. |
| 96 virtual WmWindow* FindEventTarget(const gfx::Point& location_in_screen) = 0; | 106 virtual WmWindow* FindEventTarget(const gfx::Point& location_in_screen) = 0; |
| 97 | 107 |
| 98 // Gets the last location seen in a mouse event in this root window's | 108 // Gets the last location seen in a mouse event in this root window's |
| 99 // coordinates. This may return a point outside the root window's bounds. | 109 // coordinates. This may return a point outside the root window's bounds. |
| 100 virtual gfx::Point GetLastMouseLocationInRoot() = 0; | 110 virtual gfx::Point GetLastMouseLocationInRoot() = 0; |
| 101 | 111 |
| 112 // Shows a context menu at the |location_in_screen|. |
| 113 void ShowContextMenu(const gfx::Point& location_in_screen, |
| 114 ui::MenuSourceType source_type); |
| 115 |
| 102 // Called when the wallpaper animation has started or finished. | 116 // Called when the wallpaper animation has started or finished. |
| 103 // TODO: port remaining classic ash wallpaper functionality here. | 117 // TODO: port remaining classic ash wallpaper functionality here. |
| 104 virtual void OnInitialWallpaperAnimationStarted(); | 118 virtual void OnInitialWallpaperAnimationStarted(); |
| 105 virtual void OnWallpaperAnimationFinished(views::Widget* widget); | 119 virtual void OnWallpaperAnimationFinished(views::Widget* widget); |
| 106 | 120 |
| 107 protected: | 121 protected: |
| 108 // Creates the containers (WmWindows) used by the shell. | 122 // Creates the containers (WmWindows) used by the shell. |
| 109 void CreateContainers(); | 123 void CreateContainers(); |
| 110 | 124 |
| 111 // Creates the LayoutManagers for the windows created by CreateContainers(). | 125 // Creates the LayoutManagers for the windows created by CreateContainers(). |
| 112 void CreateLayoutManagers(); | 126 void CreateLayoutManagers(); |
| 113 | 127 |
| 114 void DeleteWorkspaceController(); | 128 void DeleteWorkspaceController(); |
| 115 | 129 |
| 116 private: | 130 private: |
| 131 // Callback for MenuModelAdapter. |
| 132 void OnMenuClosed(); |
| 133 |
| 117 WmWindow* root_; | 134 WmWindow* root_; |
| 118 | 135 |
| 119 wm::RootWindowLayoutManager* root_window_layout_manager_; | 136 wm::RootWindowLayoutManager* root_window_layout_manager_; |
| 120 | 137 |
| 121 std::unique_ptr<WallpaperWidgetController> wallpaper_widget_controller_; | 138 std::unique_ptr<WallpaperWidgetController> wallpaper_widget_controller_; |
| 122 std::unique_ptr<AnimatingWallpaperWidgetController> | 139 std::unique_ptr<AnimatingWallpaperWidgetController> |
| 123 animating_wallpaper_widget_controller_; | 140 animating_wallpaper_widget_controller_; |
| 124 std::unique_ptr<WorkspaceController> workspace_controller_; | 141 std::unique_ptr<WorkspaceController> workspace_controller_; |
| 125 | 142 |
| 143 // Manages the context menu. |
| 144 std::unique_ptr<ui::MenuModel> menu_model_; |
| 145 std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_; |
| 146 std::unique_ptr<views::MenuRunner> menu_runner_; |
| 147 |
| 126 DISALLOW_COPY_AND_ASSIGN(WmRootWindowController); | 148 DISALLOW_COPY_AND_ASSIGN(WmRootWindowController); |
| 127 }; | 149 }; |
| 128 | 150 |
| 129 } // namespace ash | 151 } // namespace ash |
| 130 | 152 |
| 131 #endif // ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ | 153 #endif // ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_ |
| OLD | NEW |