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

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

Issue 2608013002: mash: Replace ShelfItemDelegate::CanPin with ShelfItem::pinned_by_policy. (Closed)
Patch Set: Fix test. Created 3 years, 11 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/browser_shortcut_launcher_item_controll er.h" 5 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll er.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/shelf/shelf_delegate.h" 10 #include "ash/common/shelf/shelf_delegate.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 base::string16 BrowserShortcutLauncherItemController::GetTitle() { 226 base::string16 BrowserShortcutLauncherItemController::GetTitle() {
227 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); 227 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
228 } 228 }
229 229
230 ash::ShelfMenuModel* 230 ash::ShelfMenuModel*
231 BrowserShortcutLauncherItemController::CreateApplicationMenu(int event_flags) { 231 BrowserShortcutLauncherItemController::CreateApplicationMenu(int event_flags) {
232 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); 232 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags));
233 } 233 }
234 234
235 bool BrowserShortcutLauncherItemController::CanPin() const {
236 return true;
237 }
238
239 bool BrowserShortcutLauncherItemController::IsListOfActiveBrowserEmpty() { 235 bool BrowserShortcutLauncherItemController::IsListOfActiveBrowserEmpty() {
240 return GetListOfActiveBrowsers().empty(); 236 return GetListOfActiveBrowsers().empty();
241 } 237 }
242 238
243 gfx::Image BrowserShortcutLauncherItemController::GetBrowserListIcon( 239 gfx::Image BrowserShortcutLauncherItemController::GetBrowserListIcon(
244 content::WebContents* web_contents) const { 240 content::WebContents* web_contents) const {
245 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 241 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
246 return rb.GetImageNamed(IsIncognito(web_contents) ? 242 return rb.GetImageNamed(IsIncognito(web_contents) ?
247 IDR_ASH_SHELF_LIST_INCOGNITO_BROWSER : 243 IDR_ASH_SHELF_LIST_INCOGNITO_BROWSER :
248 IDR_ASH_SHELF_LIST_BROWSER); 244 IDR_ASH_SHELF_LIST_BROWSER);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 !browser->window()->IsMinimized()) { 339 !browser->window()->IsMinimized()) {
344 continue; 340 continue;
345 } 341 }
346 if (!IsBrowserRepresentedInBrowserList(browser) && 342 if (!IsBrowserRepresentedInBrowserList(browser) &&
347 !browser->is_type_tabbed()) 343 !browser->is_type_tabbed())
348 continue; 344 continue;
349 active_browsers.push_back(browser); 345 active_browsers.push_back(browser);
350 } 346 }
351 return active_browsers; 347 return active_browsers;
352 } 348 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698