| 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 "apps/ui/native_app_window.h" | 7 #include "apps/ui/native_app_window.h" |
| 8 #include "ash/shelf/shelf_model.h" | 8 #include "ash/shelf/shelf_model.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 return GetAppTitle(); | 213 return GetAppTitle(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 ui::MenuModel* AppShortcutLauncherItemController::CreateContextMenu( | 216 ui::MenuModel* AppShortcutLauncherItemController::CreateContextMenu( |
| 217 aura::Window* root_window) { | 217 aura::Window* root_window) { |
| 218 ash::LauncherItem item = | 218 ash::LauncherItem item = |
| 219 *(launcher_controller()->model()->ItemByID(launcher_id())); | 219 *(launcher_controller()->model()->ItemByID(launcher_id())); |
| 220 return new LauncherContextMenu(launcher_controller(), &item, root_window); | 220 return new LauncherContextMenu(launcher_controller(), &item, root_window); |
| 221 } | 221 } |
| 222 | 222 |
| 223 ash::LauncherMenuModel* | 223 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu( |
| 224 AppShortcutLauncherItemController::CreateApplicationMenu(int event_flags) { | 224 int event_flags) { |
| 225 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); | 225 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); |
| 226 } | 226 } |
| 227 | 227 |
| 228 bool AppShortcutLauncherItemController::IsDraggable() { | 228 bool AppShortcutLauncherItemController::IsDraggable() { |
| 229 return true; | 229 return true; |
| 230 } | 230 } |
| 231 | 231 |
| 232 bool AppShortcutLauncherItemController::ShouldShowTooltip() { | 232 bool AppShortcutLauncherItemController::ShouldShowTooltip() { |
| 233 return true; | 233 return true; |
| 234 } | 234 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 361 |
| 362 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { | 362 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { |
| 363 if (last_launch_attempt_.is_null() || | 363 if (last_launch_attempt_.is_null() || |
| 364 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( | 364 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( |
| 365 kClickSuppressionInMS) < base::Time::Now()) { | 365 kClickSuppressionInMS) < base::Time::Now()) { |
| 366 last_launch_attempt_ = base::Time::Now(); | 366 last_launch_attempt_ = base::Time::Now(); |
| 367 return true; | 367 return true; |
| 368 } | 368 } |
| 369 return false; | 369 return false; |
| 370 } | 370 } |
| OLD | NEW |