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

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

Issue 2055553004: arc: Support pinned apps across Arc-enabled and Arc-disabled platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased, comments addressed, add policy pins movable, add and extends unit tests Created 4 years, 6 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 return LauncherControllerHelper::GetAppTitle( 216 return LauncherControllerHelper::GetAppTitle(
217 launcher_controller()->GetProfile(), app_id()); 217 launcher_controller()->GetProfile(), app_id());
218 } 218 }
219 219
220 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu( 220 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu(
221 int event_flags) { 221 int event_flags) {
222 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); 222 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags));
223 } 223 }
224 224
225 bool AppShortcutLauncherItemController::IsDraggable() { 225 bool AppShortcutLauncherItemController::IsDraggable() {
226 return CanPin(); 226 return true;
227 } 227 }
228 228
229 bool AppShortcutLauncherItemController::CanPin() const { 229 bool AppShortcutLauncherItemController::CanPin() const {
230 return launcher_controller()->GetPinnable(app_id()) == 230 return launcher_controller()->GetPinnable(app_id()) ==
231 AppListControllerDelegate::PIN_EDITABLE; 231 AppListControllerDelegate::PIN_EDITABLE;
232 } 232 }
233 233
234 bool AppShortcutLauncherItemController::ShouldShowTooltip() { 234 bool AppShortcutLauncherItemController::ShouldShowTooltip() {
235 return true; 235 return true;
236 } 236 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { 375 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() {
376 if (last_launch_attempt_.is_null() || 376 if (last_launch_attempt_.is_null() ||
377 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( 377 last_launch_attempt_ + base::TimeDelta::FromMilliseconds(
378 kClickSuppressionInMS) < base::Time::Now()) { 378 kClickSuppressionInMS) < base::Time::Now()) {
379 last_launch_attempt_ = base::Time::Now(); 379 last_launch_attempt_ = base::Time::Now();
380 return true; 380 return true;
381 } 381 }
382 return false; 382 return false;
383 } 383 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698