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

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

Issue 2771663002: mash: Refactor ChromeLauncherController's ShelfDelegate code. (Closed)
Patch Set: Address comments. 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 | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/shelf/shelf_model.h" 9 #include "ash/common/shelf/shelf_model.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 DCHECK(item_delegate); 120 DCHECK(item_delegate);
121 item_delegate->Close(); 121 item_delegate->Close();
122 } else { 122 } else {
123 // TODO(simonhong): Use ShelfItemDelegate::Close(). 123 // TODO(simonhong): Use ShelfItemDelegate::Close().
124 controller_->Close(item_.id); 124 controller_->Close(item_.id);
125 } 125 }
126 ash::WmShell::Get()->RecordUserMetricsAction( 126 ash::WmShell::Get()->RecordUserMetricsAction(
127 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU); 127 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU);
128 break; 128 break;
129 case MENU_PIN: 129 case MENU_PIN:
130 controller_->TogglePinned(item_.id); 130 if (controller_->IsAppPinned(item_.app_launch_id.app_id()))
131 controller_->UnpinAppWithID(item_.app_launch_id.app_id());
132 else
133 controller_->PinAppWithID(item_.app_launch_id.app_id());
131 break; 134 break;
132 case MENU_AUTO_HIDE: 135 case MENU_AUTO_HIDE:
133 wm_shelf_->SetAutoHideBehavior( 136 wm_shelf_->SetAutoHideBehavior(
134 wm_shelf_->auto_hide_behavior() == 137 wm_shelf_->auto_hide_behavior() ==
135 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS 138 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
136 ? ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER 139 ? ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER
137 : ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); 140 : ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
138 break; 141 break;
139 case MENU_ALIGNMENT_MENU: 142 case MENU_ALIGNMENT_MENU:
140 break; 143 break;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 case MENU_PIN: 201 case MENU_PIN:
199 case MENU_AUTO_HIDE: 202 case MENU_AUTO_HIDE:
200 case MENU_ALIGNMENT_MENU: 203 case MENU_ALIGNMENT_MENU:
201 case MENU_CHANGE_WALLPAPER: 204 case MENU_CHANGE_WALLPAPER:
202 LauncherContextMenu::ExecuteCommand(command_id, event_flags); 205 LauncherContextMenu::ExecuteCommand(command_id, event_flags);
203 return true; 206 return true;
204 default: 207 default:
205 return false; 208 return false;
206 } 209 }
207 } 210 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698