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

Unified Diff: ash/root_window_controller.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/root_window_controller.h ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index ecd47cd8c15a0b1b50237b48d12916b79248d3b7..7ce3e690ff890da3a18454e2509be028691662a4 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -69,13 +69,10 @@
#include "ui/aura/window_observer.h"
#include "ui/aura/window_tracker.h"
#include "ui/base/hit_test.h"
-#include "ui/base/models/menu_model.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_util.h"
-#include "ui/views/controls/menu/menu_model_adapter.h"
-#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/view_model.h"
#include "ui/views/view_model_utils.h"
#include "ui/wm/core/capture_controller.h"
@@ -579,34 +576,6 @@ SystemTray* RootWindowController::GetSystemTray() {
return wm_shelf_aura_->shelf_widget()->status_area_widget()->system_tray();
}
-void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen,
- ui::MenuSourceType source_type) {
- ShellDelegate* delegate = WmShell::Get()->delegate();
- DCHECK(delegate);
- menu_model_.reset(delegate->CreateContextMenu(wm_shelf_aura_.get(), nullptr));
- if (!menu_model_)
- return;
-
- menu_model_adapter_.reset(new views::MenuModelAdapter(
- menu_model_.get(),
- base::Bind(&RootWindowController::OnMenuClosed, base::Unretained(this))));
-
- // Wallpaper controller may not be set yet if user clicked on status are
- // before initial animation completion. See crbug.com/222218
- WallpaperWidgetController* wallpaper_widget_controller =
- wm_root_window_controller_->wallpaper_widget_controller();
- if (!wallpaper_widget_controller)
- return;
-
- menu_runner_.reset(new views::MenuRunner(
- menu_model_adapter_->CreateMenu(),
- views::MenuRunner::CONTEXT_MENU | views::MenuRunner::ASYNC));
- ignore_result(
- menu_runner_->RunMenuAt(wallpaper_widget_controller->widget(), nullptr,
- gfx::Rect(location_in_screen, gfx::Size()),
- views::MENU_ANCHOR_TOPLEFT, source_type));
-}
-
void RootWindowController::UpdateShelfVisibility() {
wm_shelf_aura_->UpdateVisibilityState();
}
@@ -857,13 +826,6 @@ void RootWindowController::DisableTouchHudProjection() {
touch_hud_projection_->Remove();
}
-void RootWindowController::OnMenuClosed() {
- menu_runner_.reset();
- menu_model_adapter_.reset();
- menu_model_.reset();
- Shell::GetInstance()->UpdateShelfVisibility();
-}
-
void RootWindowController::OnLoginStateChanged(LoginStatus status) {
wm_shelf_aura_->UpdateVisibilityState();
}
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698