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

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

Issue 1919593003: arc: Prevent showing Opt-in UI when it is not expected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TODO added Created 4 years, 8 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/extensions/launch_util.h" 10 #include "chrome/browser/extensions/launch_util.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu( 206 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu(
207 int event_flags) { 207 int event_flags) {
208 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); 208 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags));
209 } 209 }
210 210
211 bool AppShortcutLauncherItemController::IsDraggable() { 211 bool AppShortcutLauncherItemController::IsDraggable() {
212 return CanPin(); 212 return CanPin();
213 } 213 }
214 214
215 bool AppShortcutLauncherItemController::CanPin() const { 215 bool AppShortcutLauncherItemController::CanPin() const {
216 return launcher_controller()->CanPin(app_id()); 216 return launcher_controller()->GetPinnable(app_id()) ==
217 AppListControllerDelegate::PIN_EDITABLE;
217 } 218 }
218 219
219 bool AppShortcutLauncherItemController::ShouldShowTooltip() { 220 bool AppShortcutLauncherItemController::ShouldShowTooltip() {
220 return true; 221 return true;
221 } 222 }
222 223
223 content::WebContents* AppShortcutLauncherItemController::GetLRUApplication() { 224 content::WebContents* AppShortcutLauncherItemController::GetLRUApplication() {
224 URLPattern refocus_pattern(URLPattern::SCHEME_ALL); 225 URLPattern refocus_pattern(URLPattern::SCHEME_ALL);
225 refocus_pattern.SetMatchAllURLs(true); 226 refocus_pattern.SetMatchAllURLs(true);
226 227
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 360
360 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { 361 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() {
361 if (last_launch_attempt_.is_null() || 362 if (last_launch_attempt_.is_null() ||
362 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( 363 last_launch_attempt_ + base::TimeDelta::FromMilliseconds(
363 kClickSuppressionInMS) < base::Time::Now()) { 364 kClickSuppressionInMS) < base::Time::Now()) {
364 last_launch_attempt_ = base::Time::Now(); 365 last_launch_attempt_ = base::Time::Now();
365 return true; 366 return true;
366 } 367 }
367 return false; 368 return false;
368 } 369 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698