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

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

Issue 2171813004: mash: Fold ShelfItemDelegateManager into ShelfModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 5 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/wm_shelf.h" 11 #include "ash/common/shelf/wm_shelf.h"
11 #include "ash/common/wm_shell.h" 12 #include "ash/common/wm_shell.h"
12 #include "ash/desktop_background/user_wallpaper_delegate.h" 13 #include "ash/desktop_background/user_wallpaper_delegate.h"
13 #include "ash/shelf/shelf_widget.h" 14 #include "ash/shelf/shelf_widget.h"
14 #include "ash/shell.h" 15 #include "ash/shell.h"
15 #include "build/build_config.h" 16 #include "build/build_config.h"
16 #include "chrome/browser/fullscreen.h" 17 #include "chrome/browser/fullscreen.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 19 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
19 #include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h" 20 #include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 116 }
116 117
117 void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) { 118 void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) {
118 switch (static_cast<MenuItem>(command_id)) { 119 switch (static_cast<MenuItem>(command_id)) {
119 case MENU_OPEN_NEW: 120 case MENU_OPEN_NEW:
120 controller_->Launch(item_.id, ui::EF_NONE); 121 controller_->Launch(item_.id, ui::EF_NONE);
121 break; 122 break;
122 case MENU_CLOSE: 123 case MENU_CLOSE:
123 if (item_.type == ash::TYPE_DIALOG) { 124 if (item_.type == ash::TYPE_DIALOG) {
124 ash::ShelfItemDelegate* item_delegate = 125 ash::ShelfItemDelegate* item_delegate =
125 ash::Shell::GetInstance() 126 ash::WmShell::Get()->shelf_model()->GetShelfItemDelegate(item_.id);
126 ->shelf_item_delegate_manager()
127 ->GetShelfItemDelegate(item_.id);
128 DCHECK(item_delegate); 127 DCHECK(item_delegate);
129 item_delegate->Close(); 128 item_delegate->Close();
130 } else { 129 } else {
131 // TODO(simonhong): Use ShelfItemDelegate::Close(). 130 // TODO(simonhong): Use ShelfItemDelegate::Close().
132 controller_->Close(item_.id); 131 controller_->Close(item_.id);
133 } 132 }
134 ash::WmShell::Get()->RecordUserMetricsAction( 133 ash::WmShell::Get()->RecordUserMetricsAction(
135 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU); 134 ash::UMA_CLOSE_THROUGH_CONTEXT_MENU);
136 break; 135 break;
137 case MENU_PIN: 136 case MENU_PIN:
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 case MENU_PIN: 205 case MENU_PIN:
207 case MENU_AUTO_HIDE: 206 case MENU_AUTO_HIDE:
208 case MENU_ALIGNMENT_MENU: 207 case MENU_ALIGNMENT_MENU:
209 case MENU_CHANGE_WALLPAPER: 208 case MENU_CHANGE_WALLPAPER:
210 LauncherContextMenu::ExecuteCommand(command_id, event_flags); 209 LauncherContextMenu::ExecuteCommand(command_id, event_flags);
211 return true; 210 return true;
212 default: 211 default:
213 return false; 212 return false;
214 } 213 }
215 } 214 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698