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

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

Issue 2608013002: mash: Replace ShelfItemDelegate::CanPin with ShelfItem::pinned_by_policy. (Closed)
Patch Set: 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/app_shortcut_launcher_item_controller.h " 5 #include "chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h "
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
10 #include "chrome/browser/chromeos/arc/arc_support_host.h" 10 #include "chrome/browser/chromeos/arc/arc_support_host.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 base::string16 AppShortcutLauncherItemController::GetTitle() { 214 base::string16 AppShortcutLauncherItemController::GetTitle() {
215 return LauncherControllerHelper::GetAppTitle(launcher_controller()->profile(), 215 return LauncherControllerHelper::GetAppTitle(launcher_controller()->profile(),
216 app_id()); 216 app_id());
217 } 217 }
218 218
219 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu( 219 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu(
220 int event_flags) { 220 int event_flags) {
221 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); 221 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags));
222 } 222 }
223 223
224 bool AppShortcutLauncherItemController::CanPin() const {
225 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) ==
226 AppListControllerDelegate::PIN_EDITABLE;
227 }
228
229 content::WebContents* AppShortcutLauncherItemController::GetLRUApplication() { 224 content::WebContents* AppShortcutLauncherItemController::GetLRUApplication() {
230 URLPattern refocus_pattern(URLPattern::SCHEME_ALL); 225 URLPattern refocus_pattern(URLPattern::SCHEME_ALL);
231 refocus_pattern.SetMatchAllURLs(true); 226 refocus_pattern.SetMatchAllURLs(true);
232 227
233 if (!refocus_url_.is_empty()) { 228 if (!refocus_url_.is_empty()) {
234 refocus_pattern.SetMatchAllURLs(false); 229 refocus_pattern.SetMatchAllURLs(false);
235 refocus_pattern.Parse(refocus_url_.spec()); 230 refocus_pattern.Parse(refocus_url_.spec());
236 } 231 }
237 232
238 const Extension* extension = 233 const Extension* extension =
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 360
366 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { 361 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() {
367 if (last_launch_attempt_.is_null() || 362 if (last_launch_attempt_.is_null() ||
368 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( 363 last_launch_attempt_ + base::TimeDelta::FromMilliseconds(
369 kClickSuppressionInMS) < base::Time::Now()) { 364 kClickSuppressionInMS) < base::Time::Now()) {
370 last_launch_attempt_ = base::Time::Now(); 365 last_launch_attempt_ = base::Time::Now();
371 return true; 366 return true;
372 } 367 }
373 return false; 368 return false;
374 } 369 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698