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

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_context_menu.cc

Issue 2272793005: ash: Move alignment and autohide behavior from Shelf to WmShelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 4 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "chrome/browser/ui/ash/launcher/launcher_context_menu.h" 5 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/shelf/shelf_model.h" 10 #include "ash/common/shelf/shelf_model.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return false; 79 return false;
80 } 80 }
81 81
82 base::string16 LauncherContextMenu::GetLabelForCommandId(int command_id) const { 82 base::string16 LauncherContextMenu::GetLabelForCommandId(int command_id) const {
83 NOTREACHED(); 83 NOTREACHED();
84 return base::string16(); 84 return base::string16();
85 } 85 }
86 86
87 bool LauncherContextMenu::IsCommandIdChecked(int command_id) const { 87 bool LauncherContextMenu::IsCommandIdChecked(int command_id) const {
88 if (command_id == MENU_AUTO_HIDE) { 88 if (command_id == MENU_AUTO_HIDE) {
89 return wm_shelf_->GetAutoHideBehavior() == 89 return wm_shelf_->auto_hide_behavior() ==
90 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; 90 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
91 } 91 }
92 DCHECK(command_id < MENU_ITEM_COUNT); 92 DCHECK(command_id < MENU_ITEM_COUNT);
93 return false; 93 return false;
94 } 94 }
95 95
96 bool LauncherContextMenu::IsCommandIdEnabled(int command_id) const { 96 bool LauncherContextMenu::IsCommandIdEnabled(int command_id) const {
97 switch (command_id) { 97 switch (command_id) {
98 case MENU_PIN: 98 case MENU_PIN:
99 return controller_->IsPinnable(item_.id); 99 return controller_->IsPinnable(item_.id);
(...skipping 25 matching lines...) Expand all
125 controller_->Close(item_.id); 125 controller_->Close(item_.id);
126 } 126 }
127 ash::WmShell::Get()->RecordUserMetricsAction( 127 ash::WmShell::Get()->RecordUserMetricsAction(
128 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU); 128 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU);
129 break; 129 break;
130 case MENU_PIN: 130 case MENU_PIN:
131 controller_->TogglePinned(item_.id); 131 controller_->TogglePinned(item_.id);
132 break; 132 break;
133 case MENU_AUTO_HIDE: 133 case MENU_AUTO_HIDE:
134 wm_shelf_->SetAutoHideBehavior( 134 wm_shelf_->SetAutoHideBehavior(
135 wm_shelf_->GetAutoHideBehavior() == 135 wm_shelf_->auto_hide_behavior() ==
136 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS 136 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
137 ? ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER 137 ? ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER
138 : ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 138 : ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
139 break; 139 break;
140 case MENU_ALIGNMENT_MENU: 140 case MENU_ALIGNMENT_MENU:
141 break; 141 break;
142 case MENU_CHANGE_WALLPAPER: 142 case MENU_CHANGE_WALLPAPER:
143 ash::Shell::GetInstance()->user_wallpaper_delegate()-> 143 ash::Shell::GetInstance()->user_wallpaper_delegate()->
144 OpenSetWallpaperPage(); 144 OpenSetWallpaperPage();
145 break; 145 break;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 case MENU_PIN: 199 case MENU_PIN:
200 case MENU_AUTO_HIDE: 200 case MENU_AUTO_HIDE:
201 case MENU_ALIGNMENT_MENU: 201 case MENU_ALIGNMENT_MENU:
202 case MENU_CHANGE_WALLPAPER: 202 case MENU_CHANGE_WALLPAPER:
203 LauncherContextMenu::ExecuteCommand(command_id, event_flags); 203 LauncherContextMenu::ExecuteCommand(command_id, event_flags);
204 return true; 204 return true;
205 default: 205 default:
206 return false; 206 return false;
207 } 207 }
208 } 208 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698