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

Side by Side Diff: ash/mus/context_menu_mus.cc

Issue 2741273002: chromeos: Promotes more from WmShell to Shell (Closed)
Patch Set: feedback Created 3 years, 9 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/mus/window_manager.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "ash/mus/context_menu_mus.h" 5 #include "ash/mus/context_menu_mus.h"
6 6
7 #include "ash/common/shelf/wm_shelf.h" 7 #include "ash/common/shelf/wm_shelf.h"
8 #include "ash/common/wallpaper/wallpaper_controller.h" 8 #include "ash/common/wallpaper/wallpaper_controller.h"
9 #include "ash/common/wallpaper/wallpaper_delegate.h" 9 #include "ash/common/wallpaper/wallpaper_delegate.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 18 matching lines...) Expand all
29 ContextMenuMus::~ContextMenuMus() {} 29 ContextMenuMus::~ContextMenuMus() {}
30 30
31 bool ContextMenuMus::IsCommandIdChecked(int command_id) const { 31 bool ContextMenuMus::IsCommandIdChecked(int command_id) const {
32 if (command_id == MENU_AUTO_HIDE) 32 if (command_id == MENU_AUTO_HIDE)
33 return wm_shelf_->auto_hide_behavior() == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; 33 return wm_shelf_->auto_hide_behavior() == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
34 return false; 34 return false;
35 } 35 }
36 36
37 bool ContextMenuMus::IsCommandIdEnabled(int command_id) const { 37 bool ContextMenuMus::IsCommandIdEnabled(int command_id) const {
38 if (command_id == MENU_CHANGE_WALLPAPER) 38 if (command_id == MENU_CHANGE_WALLPAPER)
39 return WmShell::Get()->wallpaper_delegate()->CanOpenSetWallpaperPage(); 39 return Shell::Get()->wallpaper_delegate()->CanOpenSetWallpaperPage();
40 return true; 40 return true;
41 } 41 }
42 42
43 void ContextMenuMus::ExecuteCommand(int command_id, int event_flags) { 43 void ContextMenuMus::ExecuteCommand(int command_id, int event_flags) {
44 if (command_id == MENU_AUTO_HIDE) { 44 if (command_id == MENU_AUTO_HIDE) {
45 wm_shelf_->SetAutoHideBehavior(wm_shelf_->auto_hide_behavior() == 45 wm_shelf_->SetAutoHideBehavior(wm_shelf_->auto_hide_behavior() ==
46 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS 46 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
47 ? SHELF_AUTO_HIDE_BEHAVIOR_NEVER 47 ? SHELF_AUTO_HIDE_BEHAVIOR_NEVER
48 : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 48 : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
49 } else if (command_id == MENU_CHANGE_WALLPAPER) { 49 } else if (command_id == MENU_CHANGE_WALLPAPER) {
50 Shell::GetInstance()->wallpaper_controller()->OpenSetWallpaperPage(); 50 Shell::GetInstance()->wallpaper_controller()->OpenSetWallpaperPage();
51 } 51 }
52 } 52 }
53 53
54 } // namespace ash 54 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.cc ('k') | ash/mus/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698