| 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/extensions/launch_util.h" | 10 #include "chrome/browser/extensions/launch_util.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // In case of a keyboard event, we were called by a hotkey. In that case we | 193 // In case of a keyboard event, we were called by a hotkey. In that case we |
| 194 // activate the next item in line if an item of our list is already active. | 194 // activate the next item in line if an item of our list is already active. |
| 195 if (event.type() == ui::ET_KEY_RELEASED) { | 195 if (event.type() == ui::ET_KEY_RELEASED) { |
| 196 if (AdvanceToNextApp()) | 196 if (AdvanceToNextApp()) |
| 197 return kExistingWindowActivated; | 197 return kExistingWindowActivated; |
| 198 } | 198 } |
| 199 return Activate(ash::LAUNCH_FROM_UNKNOWN); | 199 return Activate(ash::LAUNCH_FROM_UNKNOWN); |
| 200 } | 200 } |
| 201 | 201 |
| 202 base::string16 AppShortcutLauncherItemController::GetTitle() { | 202 base::string16 AppShortcutLauncherItemController::GetTitle() { |
| 203 return GetAppTitle(); | 203 return GetAppTitle(launcher_controller()->profile(), app_id()); |
| 204 } | 204 } |
| 205 | 205 |
| 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 } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { | 360 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { |
| 361 if (last_launch_attempt_.is_null() || | 361 if (last_launch_attempt_.is_null() || |
| 362 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( | 362 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( |
| 363 kClickSuppressionInMS) < base::Time::Now()) { | 363 kClickSuppressionInMS) < base::Time::Now()) { |
| 364 last_launch_attempt_ = base::Time::Now(); | 364 last_launch_attempt_ = base::Time::Now(); |
| 365 return true; | 365 return true; |
| 366 } | 366 } |
| 367 return false; | 367 return false; |
| 368 } | 368 } |
| OLD | NEW |