Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: ash/root_window_controller.h

Issue 2336883002: mash: Port context menu code to WmShell and WmRootWindowController. (Closed)
Patch Set: Fix error. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_ROOT_WINDOW_CONTROLLER_H_ 5 #ifndef ASH_ROOT_WINDOW_CONTROLLER_H_
6 #define ASH_ROOT_WINDOW_CONTROLLER_H_ 6 #define ASH_ROOT_WINDOW_CONTROLLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/common/shelf/shelf_types.h" 12 #include "ash/common/shelf/shelf_types.h"
13 #include "ash/common/shell_observer.h" 13 #include "ash/common/shell_observer.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "ui/aura/window.h" 15 #include "ui/aura/window.h"
16 #include "ui/aura/window_tree_host.h" 16 #include "ui/aura/window_tree_host.h"
17 #include "ui/base/ui_base_types.h"
18 17
19 class SkBitmap; 18 class SkBitmap;
20 19
21 namespace aura { 20 namespace aura {
22 class EventFilter; 21 class EventFilter;
23 class Window; 22 class Window;
24 } 23 }
25 24
26 namespace gfx { 25 namespace gfx {
27 class Point; 26 class Point;
28 } 27 }
29 28
30 namespace keyboard { 29 namespace keyboard {
31 class KeyboardController; 30 class KeyboardController;
32 } 31 }
33 32
34 namespace ui { 33 namespace ui {
35 class EventHandler; 34 class EventHandler;
36 class MenuModel;
37 } 35 }
38 36
39 namespace views { 37 namespace views {
40 class MenuModelAdapter;
41 class MenuRunner;
42 class Widget; 38 class Widget;
43 } 39 }
44 40
45 namespace wm { 41 namespace wm {
46 class InputMethodEventFilter; 42 class InputMethodEventFilter;
47 class RootWindowEventFilter; 43 class RootWindowEventFilter;
48 class ScopedCaptureClient; 44 class ScopedCaptureClient;
49 } 45 }
50 46
51 namespace ash { 47 namespace ash {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 ShelfLayoutManager* GetShelfLayoutManager(); 131 ShelfLayoutManager* GetShelfLayoutManager();
136 132
137 // May return null, for example for a secondary monitor at the login screen. 133 // May return null, for example for a secondary monitor at the login screen.
138 StatusAreaWidget* GetStatusAreaWidget(); 134 StatusAreaWidget* GetStatusAreaWidget();
139 135
140 // Returns the system tray on this root window. Note that 136 // Returns the system tray on this root window. Note that
141 // calling this on the root window that doesn't have a shelf will 137 // calling this on the root window that doesn't have a shelf will
142 // lead to a crash. 138 // lead to a crash.
143 SystemTray* GetSystemTray(); 139 SystemTray* GetSystemTray();
144 140
145 // Shows context menu at the |location_in_screen|. This uses
146 // |ShellDelegate::CreateContextMenu| to define the content of the menu.
147 void ShowContextMenu(const gfx::Point& location_in_screen,
148 ui::MenuSourceType source_type);
149
150 // True if the window can receive events on this root window. 141 // True if the window can receive events on this root window.
151 bool CanWindowReceiveEvents(aura::Window* window); 142 bool CanWindowReceiveEvents(aura::Window* window);
152 143
153 aura::Window* GetContainer(int container_id); 144 aura::Window* GetContainer(int container_id);
154 const aura::Window* GetContainer(int container_id) const; 145 const aura::Window* GetContainer(int container_id) const;
155 146
156 // Show shelf view if it was created hidden (before session has started). 147 // Show shelf view if it was created hidden (before session has started).
157 // TODO(jamescook): Eliminate this and handle show via Shelf. 148 // TODO(jamescook): Eliminate this and handle show via Shelf.
158 void ShowShelf(); 149 void ShowShelf();
159 150
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // Initializes |system_wallpaper_| and possibly also |boot_splash_screen_|. 215 // Initializes |system_wallpaper_| and possibly also |boot_splash_screen_|.
225 // |is_first_run_after_boot| determines the wallpaper's initial color. 216 // |is_first_run_after_boot| determines the wallpaper's initial color.
226 void CreateSystemWallpaper(bool is_first_run_after_boot); 217 void CreateSystemWallpaper(bool is_first_run_after_boot);
227 218
228 // Enables projection touch HUD. 219 // Enables projection touch HUD.
229 void EnableTouchHudProjection(); 220 void EnableTouchHudProjection();
230 221
231 // Disables projection touch HUD. 222 // Disables projection touch HUD.
232 void DisableTouchHudProjection(); 223 void DisableTouchHudProjection();
233 224
234 // Callback for MenuModelAdapter.
235 void OnMenuClosed();
236
237 // Overridden from ShellObserver. 225 // Overridden from ShellObserver.
238 void OnLoginStateChanged(LoginStatus status) override; 226 void OnLoginStateChanged(LoginStatus status) override;
239 void OnTouchHudProjectionToggled(bool enabled) override; 227 void OnTouchHudProjectionToggled(bool enabled) override;
240 228
241 std::unique_ptr<AshWindowTreeHost> ash_host_; 229 std::unique_ptr<AshWindowTreeHost> ash_host_;
242 230
243 // Owned by the root window. 231 // Owned by the root window.
244 WmRootWindowControllerAura* wm_root_window_controller_ = nullptr; 232 WmRootWindowControllerAura* wm_root_window_controller_ = nullptr;
245 233
246 std::unique_ptr<StackingController> stacking_controller_; 234 std::unique_ptr<StackingController> stacking_controller_;
(...skipping 30 matching lines...) Expand all
277 // Heads-up displays for touch events. These HUDs are not owned by the root 265 // Heads-up displays for touch events. These HUDs are not owned by the root
278 // window controller and manage their own lifetimes. 266 // window controller and manage their own lifetimes.
279 TouchHudDebug* touch_hud_debug_; 267 TouchHudDebug* touch_hud_debug_;
280 TouchHudProjection* touch_hud_projection_; 268 TouchHudProjection* touch_hud_projection_;
281 269
282 // Handles double clicks on the panel window header. 270 // Handles double clicks on the panel window header.
283 std::unique_ptr<ui::EventHandler> panel_container_handler_; 271 std::unique_ptr<ui::EventHandler> panel_container_handler_;
284 272
285 std::unique_ptr<::wm::ScopedCaptureClient> capture_client_; 273 std::unique_ptr<::wm::ScopedCaptureClient> capture_client_;
286 274
287 // Manages the context menu.
288 std::unique_ptr<ui::MenuModel> menu_model_;
289 std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_;
290 std::unique_ptr<views::MenuRunner> menu_runner_;
291
292 DISALLOW_COPY_AND_ASSIGN(RootWindowController); 275 DISALLOW_COPY_AND_ASSIGN(RootWindowController);
293 }; 276 };
294 277
295 // On classic ash, returns the RootWindowController for the given |root_window|. 278 // On classic ash, returns the RootWindowController for the given |root_window|.
296 // On mus ash, returns the RootWindowController for the primary display. 279 // On mus ash, returns the RootWindowController for the primary display.
297 // See RootWindowController class comment above. 280 // See RootWindowController class comment above.
298 ASH_EXPORT RootWindowController* GetRootWindowController( 281 ASH_EXPORT RootWindowController* GetRootWindowController(
299 const aura::Window* root_window); 282 const aura::Window* root_window);
300 283
301 } // namespace ash 284 } // namespace ash
302 285
303 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ 286 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698