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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return new AppShortcutLauncherItemController(app_id, launch_id, controller); | 72 return new AppShortcutLauncherItemController(app_id, launch_id, controller); |
73 } | 73 } |
74 | 74 |
75 // Item controller for an app shortcut. Shortcuts track app and launcher ids, | 75 // Item controller for an app shortcut. Shortcuts track app and launcher ids, |
76 // but do not have any associated windows (opening a shortcut will replace the | 76 // but do not have any associated windows (opening a shortcut will replace the |
77 // item with the appropriate LauncherItemController type). | 77 // item with the appropriate LauncherItemController type). |
78 AppShortcutLauncherItemController::AppShortcutLauncherItemController( | 78 AppShortcutLauncherItemController::AppShortcutLauncherItemController( |
79 const std::string& app_id, | 79 const std::string& app_id, |
80 const std::string& launch_id, | 80 const std::string& launch_id, |
81 ChromeLauncherController* controller) | 81 ChromeLauncherController* controller) |
82 : LauncherItemController(TYPE_SHORTCUT, app_id, launch_id, controller), | 82 : LauncherItemController(app_id, launch_id, controller), |
83 chrome_launcher_controller_(controller) { | 83 chrome_launcher_controller_(controller) { |
84 // To detect V1 applications we use their domain and match them against the | 84 // To detect V1 applications we use their domain and match them against the |
85 // used URL. This will also work with applications like Google Drive. | 85 // used URL. This will also work with applications like Google Drive. |
86 const Extension* extension = | 86 const Extension* extension = |
87 GetExtensionForAppID(app_id, controller->profile()); | 87 GetExtensionForAppID(app_id, controller->profile()); |
88 // Some unit tests have no real extension. | 88 // Some unit tests have no real extension. |
89 if (extension) { | 89 if (extension) { |
90 set_refocus_url(GURL( | 90 set_refocus_url(GURL( |
91 extensions::AppLaunchInfo::GetLaunchWebURL(extension).spec() + "*")); | 91 extensions::AppLaunchInfo::GetLaunchWebURL(extension).spec() + "*")); |
92 } | 92 } |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 372 |
373 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { | 373 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { |
374 if (last_launch_attempt_.is_null() || | 374 if (last_launch_attempt_.is_null() || |
375 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( | 375 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( |
376 kClickSuppressionInMS) < base::Time::Now()) { | 376 kClickSuppressionInMS) < base::Time::Now()) { |
377 last_launch_attempt_ = base::Time::Now(); | 377 last_launch_attempt_ = base::Time::Now(); |
378 return true; | 378 return true; |
379 } | 379 } |
380 return false; | 380 return false; |
381 } | 381 } |
OLD | NEW |