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

Unified Diff: ash/shell/context_menu.cc

Issue 2046843005: mash: Migrate shelf menus to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ash_shell_with_content Created 4 years, 6 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/shell/context_menu.h ('k') | ash/shell/shell_delegate_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell/context_menu.cc
diff --git a/ash/shell/context_menu.cc b/ash/shell/context_menu.cc
index 4bdd5784fa5011ae66885c120fcbbbb62f8cc3b5..ea34813f9410cd5982eac5d1d2464a27c08d7cb4 100644
--- a/ash/shell/context_menu.cc
+++ b/ash/shell/context_menu.cc
@@ -5,15 +5,17 @@
#include "ash/shell/context_menu.h"
#include "ash/common/shelf/shelf_types.h"
-#include "ash/shelf/shelf.h"
+#include "ash/common/shelf/wm_shelf.h"
#include "grit/ash_strings.h"
namespace ash {
namespace shell {
-ContextMenu::ContextMenu(ash::Shelf* shelf)
- : ui::SimpleMenuModel(nullptr), shelf_(shelf), alignment_menu_(shelf) {
- DCHECK(shelf_);
+ContextMenu::ContextMenu(WmShelf* wm_shelf)
+ : ui::SimpleMenuModel(nullptr),
+ wm_shelf_(wm_shelf),
+ alignment_menu_(wm_shelf) {
+ DCHECK(wm_shelf_);
set_delegate(this);
AddCheckItemWithStringId(MENU_AUTO_HIDE,
IDS_ASH_SHELF_CONTEXT_MENU_AUTO_HIDE);
@@ -27,7 +29,7 @@ ContextMenu::~ContextMenu() {
bool ContextMenu::IsCommandIdChecked(int command_id) const {
if (command_id == MENU_AUTO_HIDE)
- return shelf_->auto_hide_behavior() == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
+ return wm_shelf_->GetAutoHideBehavior() == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
return false;
}
@@ -42,10 +44,10 @@ bool ContextMenu::GetAcceleratorForCommandId(int command_id,
void ContextMenu::ExecuteCommand(int command_id, int event_flags) {
if (command_id == MENU_AUTO_HIDE) {
- shelf_->SetAutoHideBehavior(shelf_->auto_hide_behavior() ==
- SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
- ? SHELF_AUTO_HIDE_BEHAVIOR_NEVER
- : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ wm_shelf_->SetAutoHideBehavior(wm_shelf_->GetAutoHideBehavior() ==
+ SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
+ ? SHELF_AUTO_HIDE_BEHAVIOR_NEVER
+ : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
}
}
« no previous file with comments | « ash/shell/context_menu.h ('k') | ash/shell/shell_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698