| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 for (size_t i = 0; i < content.size(); i++) { | 102 for (size_t i = 0; i < content.size(); i++) { |
| 103 Browser* browser = chrome::FindBrowserWithWebContents(content[i]); | 103 Browser* browser = chrome::FindBrowserWithWebContents(content[i]); |
| 104 if (browser && browser->window()->GetNativeWindow()->IsVisible()) | 104 if (browser && browser->window()->GetNativeWindow()->IsVisible()) |
| 105 return true; | 105 return true; |
| 106 } | 106 } |
| 107 return false; | 107 return false; |
| 108 } | 108 } |
| 109 | 109 |
| 110 void AppShortcutLauncherItemController::Launch(ash::LaunchSource source, | 110 void AppShortcutLauncherItemController::Launch(ash::LaunchSource source, |
| 111 int event_flags) { | 111 int event_flags) { |
| 112 launcher_controller()->LaunchApp(app_id(), source, event_flags); | 112 launcher_controller()->LaunchAppWithLaunchId(app_id(), launch_id(), source, |
| 113 event_flags); |
| 113 } | 114 } |
| 114 | 115 |
| 115 ash::ShelfItemDelegate::PerformedAction | 116 ash::ShelfItemDelegate::PerformedAction |
| 116 AppShortcutLauncherItemController::Activate(ash::LaunchSource source) { | 117 AppShortcutLauncherItemController::Activate(ash::LaunchSource source) { |
| 117 content::WebContents* content = GetLRUApplication(); | 118 content::WebContents* content = GetLRUApplication(); |
| 118 if (!content) { | 119 if (!content) { |
| 119 if (IsV2App()) { | 120 if (IsV2App()) { |
| 120 // Ideally we come here only once. After that ShellLauncherItemController | 121 // Ideally we come here only once. After that ShellLauncherItemController |
| 121 // will take over when the shell window gets opened. However there are | 122 // will take over when the shell window gets opened. However there are |
| 122 // apps which take a lot of time for pre-processing (like the files app) | 123 // apps which take a lot of time for pre-processing (like the files app) |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 369 |
| 369 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { | 370 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { |
| 370 if (last_launch_attempt_.is_null() || | 371 if (last_launch_attempt_.is_null() || |
| 371 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( | 372 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( |
| 372 kClickSuppressionInMS) < base::Time::Now()) { | 373 kClickSuppressionInMS) < base::Time::Now()) { |
| 373 last_launch_attempt_ = base::Time::Now(); | 374 last_launch_attempt_ = base::Time::Now(); |
| 374 return true; | 375 return true; |
| 375 } | 376 } |
| 376 return false; | 377 return false; |
| 377 } | 378 } |
| OLD | NEW |