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

Unified Diff: ash/common/wm_shell.cc

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/common/wm_shell.h ('k') | ash/mus/bridge/wm_shell_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index a29a9954f862b6477ab219a52e41697383ebebaf..ff23fb22180d11e66848a40277edb767f96be958 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -31,6 +31,7 @@
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/common/wm/mru_window_tracker.h"
#include "ash/common/wm/overview/window_selector_controller.h"
+#include "ash/common/wm/root_window_finder.h"
#include "ash/common/wm/system_modal_container_layout_manager.h"
#include "ash/common/wm/window_cycle_controller.h"
#include "ash/common/wm_root_window_controller.h"
@@ -102,6 +103,19 @@ void WmShell::Shutdown() {
views::FocusManagerFactory::Install(nullptr);
}
+void WmShell::ShowContextMenu(const gfx::Point& location_in_screen,
+ ui::MenuSourceType source_type) {
+ // Bail if there is no active user session or if the screen is locked.
+ if (GetSessionStateDelegate()->NumberOfLoggedInUsers() < 1 ||
+ GetSessionStateDelegate()->IsScreenLocked()) {
+ return;
+ }
+
+ WmWindow* root = wm::GetRootWindowAt(location_in_screen);
+ root->GetRootWindowController()->ShowContextMenu(location_in_screen,
+ source_type);
+}
+
void WmShell::CreateShelfDelegate() {
// May be called multiple times as shelves are created and destroyed.
if (shelf_delegate_)
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/mus/bridge/wm_shell_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698