| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 return Activate(ash::LAUNCH_FROM_UNKNOWN); | 201 return Activate(ash::LAUNCH_FROM_UNKNOWN); |
| 202 } | 202 } |
| 203 | 203 |
| 204 base::string16 AppShortcutLauncherItemController::GetTitle() { | 204 base::string16 AppShortcutLauncherItemController::GetTitle() { |
| 205 return GetAppTitle(); | 205 return GetAppTitle(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 ui::MenuModel* AppShortcutLauncherItemController::CreateContextMenu( | 208 ui::MenuModel* AppShortcutLauncherItemController::CreateContextMenu( |
| 209 aura::Window* root_window) { | 209 aura::Window* root_window) { |
| 210 ash::LauncherItem item = | 210 ash::ShelfItem item = |
| 211 *(launcher_controller()->model()->ItemByID(launcher_id())); | 211 *(launcher_controller()->model()->ItemByID(shelf_id())); |
| 212 return new LauncherContextMenu(launcher_controller(), &item, root_window); | 212 return new LauncherContextMenu(launcher_controller(), &item, root_window); |
| 213 } | 213 } |
| 214 | 214 |
| 215 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu( | 215 ash::ShelfMenuModel* AppShortcutLauncherItemController::CreateApplicationMenu( |
| 216 int event_flags) { | 216 int event_flags) { |
| 217 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); | 217 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); |
| 218 } | 218 } |
| 219 | 219 |
| 220 bool AppShortcutLauncherItemController::IsDraggable() { | 220 bool AppShortcutLauncherItemController::IsDraggable() { |
| 221 return true; | 221 return true; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 353 |
| 354 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { | 354 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { |
| 355 if (last_launch_attempt_.is_null() || | 355 if (last_launch_attempt_.is_null() || |
| 356 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( | 356 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( |
| 357 kClickSuppressionInMS) < base::Time::Now()) { | 357 kClickSuppressionInMS) < base::Time::Now()) { |
| 358 last_launch_attempt_ = base::Time::Now(); | 358 last_launch_attempt_ = base::Time::Now(); |
| 359 return true; | 359 return true; |
| 360 } | 360 } |
| 361 return false; | 361 return false; |
| 362 } | 362 } |
| OLD | NEW |