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 <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // app was started we suppress any further clicks within a special time out. | 109 // app was started we suppress any further clicks within a special time out. |
110 if (IsV2App() && !AllowNextLaunchAttempt()) { | 110 if (IsV2App() && !AllowNextLaunchAttempt()) { |
111 std::move(callback).Run( | 111 std::move(callback).Run( |
112 ash::SHELF_ACTION_NONE, | 112 ash::SHELF_ACTION_NONE, |
113 GetAppMenuItems(event ? event->flags() : ui::EF_NONE)); | 113 GetAppMenuItems(event ? event->flags() : ui::EF_NONE)); |
114 return; | 114 return; |
115 } | 115 } |
116 | 116 |
117 // Launching some items replaces this item controller instance, which | 117 // Launching some items replaces this item controller instance, which |
118 // destroys its ShelfID string pair; making copies avoid crashes. | 118 // destroys its ShelfID string pair; making copies avoid crashes. |
119 ChromeLauncherController::instance()->LaunchApp(ash::ShelfID(shelf_id()), | 119 ChromeLauncherController::instance()->LaunchApp( |
120 source, ui::EF_NONE); | 120 ash::ShelfID(shelf_id()), source, ui::EF_NONE, display_id); |
121 std::move(callback).Run(ash::SHELF_ACTION_NEW_WINDOW_CREATED, | 121 std::move(callback).Run(ash::SHELF_ACTION_NEW_WINDOW_CREATED, |
122 base::nullopt); | 122 base::nullopt); |
123 return; | 123 return; |
124 } | 124 } |
125 | 125 |
126 const ash::ShelfAction action = ActivateContent(content); | 126 const ash::ShelfAction action = ActivateContent(content); |
127 std::move(callback).Run( | 127 std::move(callback).Run( |
128 action, GetAppMenuItems(event ? event->flags() : ui::EF_NONE)); | 128 action, GetAppMenuItems(event ? event->flags() : ui::EF_NONE)); |
129 } | 129 } |
130 | 130 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { | 364 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { |
365 if (last_launch_attempt_.is_null() || | 365 if (last_launch_attempt_.is_null() || |
366 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( | 366 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( |
367 kClickSuppressionInMS) < base::Time::Now()) { | 367 kClickSuppressionInMS) < base::Time::Now()) { |
368 last_launch_attempt_ = base::Time::Now(); | 368 last_launch_attempt_ = base::Time::Now(); |
369 return true; | 369 return true; |
370 } | 370 } |
371 return false; | 371 return false; |
372 } | 372 } |
OLD | NEW |