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

Unified Diff: ash/common/wm_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/aura/wm_shell_aura.cc ('k') | ash/common/wm_root_window_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_root_window_controller.h
diff --git a/ash/common/wm_root_window_controller.h b/ash/common/wm_root_window_controller.h
index 43b2d6e6a81db74f7d7bf4b72df718c09653a1b9..5a9615a671ff830128cbf6003f98c51e8bbc1048 100644
--- a/ash/common/wm_root_window_controller.h
+++ b/ash/common/wm_root_window_controller.h
@@ -8,12 +8,22 @@
#include "ash/ash_export.h"
#include "ash/common/wm/workspace/workspace_types.h"
#include "base/macros.h"
+#include "ui/base/ui_base_types.h"
#include "ui/views/widget/widget.h"
namespace gfx {
class Point;
}
+namespace ui {
+class MenuModel;
+}
+
+namespace views {
+class MenuModelAdapter;
+class MenuRunner;
+}
+
namespace ash {
class AlwaysOnTopController;
@@ -99,6 +109,10 @@ class ASH_EXPORT WmRootWindowController {
// coordinates. This may return a point outside the root window's bounds.
virtual gfx::Point GetLastMouseLocationInRoot() = 0;
+ // Shows a context menu at the |location_in_screen|.
+ void ShowContextMenu(const gfx::Point& location_in_screen,
+ ui::MenuSourceType source_type);
+
// Called when the wallpaper animation has started or finished.
// TODO: port remaining classic ash wallpaper functionality here.
virtual void OnInitialWallpaperAnimationStarted();
@@ -114,6 +128,9 @@ class ASH_EXPORT WmRootWindowController {
void DeleteWorkspaceController();
private:
+ // Callback for MenuModelAdapter.
+ void OnMenuClosed();
+
WmWindow* root_;
wm::RootWindowLayoutManager* root_window_layout_manager_;
@@ -123,6 +140,11 @@ class ASH_EXPORT WmRootWindowController {
animating_wallpaper_widget_controller_;
std::unique_ptr<WorkspaceController> workspace_controller_;
+ // Manages the context menu.
+ std::unique_ptr<ui::MenuModel> menu_model_;
+ std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_;
+ std::unique_ptr<views::MenuRunner> menu_runner_;
+
DISALLOW_COPY_AND_ASSIGN(WmRootWindowController);
};
« no previous file with comments | « ash/aura/wm_shell_aura.cc ('k') | ash/common/wm_root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698