| OLD | NEW |
| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 base::string16 AppShortcutLauncherItemController::GetTitle() { | 213 base::string16 AppShortcutLauncherItemController::GetTitle() { |
| 214 return LauncherControllerHelper::GetAppTitle(launcher_controller()->profile(), | 214 return LauncherControllerHelper::GetAppTitle(launcher_controller()->profile(), |
| 215 app_id()); | 215 app_id()); |
| 216 } | 216 } |
| 217 | 217 |
| 218 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu( | 218 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu( |
| 219 int event_flags) { | 219 int event_flags) { |
| 220 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); | 220 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); |
| 221 } | 221 } |
| 222 | 222 |
| 223 bool AppShortcutLauncherItemController::IsDraggable() { | |
| 224 return true; | |
| 225 } | |
| 226 | |
| 227 bool AppShortcutLauncherItemController::CanPin() const { | 223 bool AppShortcutLauncherItemController::CanPin() const { |
| 228 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) == | 224 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) == |
| 229 AppListControllerDelegate::PIN_EDITABLE; | 225 AppListControllerDelegate::PIN_EDITABLE; |
| 230 } | 226 } |
| 231 | 227 |
| 232 content::WebContents* AppShortcutLauncherItemController::GetLRUApplication() { | 228 content::WebContents* AppShortcutLauncherItemController::GetLRUApplication() { |
| 233 URLPattern refocus_pattern(URLPattern::SCHEME_ALL); | 229 URLPattern refocus_pattern(URLPattern::SCHEME_ALL); |
| 234 refocus_pattern.SetMatchAllURLs(true); | 230 refocus_pattern.SetMatchAllURLs(true); |
| 235 | 231 |
| 236 if (!refocus_url_.is_empty()) { | 232 if (!refocus_url_.is_empty()) { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 364 |
| 369 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { | 365 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { |
| 370 if (last_launch_attempt_.is_null() || | 366 if (last_launch_attempt_.is_null() || |
| 371 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( | 367 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( |
| 372 kClickSuppressionInMS) < base::Time::Now()) { | 368 kClickSuppressionInMS) < base::Time::Now()) { |
| 373 last_launch_attempt_ = base::Time::Now(); | 369 last_launch_attempt_ = base::Time::Now(); |
| 374 return true; | 370 return true; |
| 375 } | 371 } |
| 376 return false; | 372 return false; |
| 377 } | 373 } |
| OLD | NEW |