OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser_shortcut_launcher_item_controll
er.h" | 5 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/launcher/launcher.h" | 9 #include "ash/launcher/launcher.h" |
10 #include "ash/shelf/shelf_model.h" | 10 #include "ash/shelf/shelf_model.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 230 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
231 } | 231 } |
232 | 232 |
233 ui::MenuModel* BrowserShortcutLauncherItemController::CreateContextMenu( | 233 ui::MenuModel* BrowserShortcutLauncherItemController::CreateContextMenu( |
234 aura::Window* root_window) { | 234 aura::Window* root_window) { |
235 ash::LauncherItem item = | 235 ash::LauncherItem item = |
236 *(launcher_controller()->model()->ItemByID(launcher_id())); | 236 *(launcher_controller()->model()->ItemByID(launcher_id())); |
237 return new LauncherContextMenu(launcher_controller(), &item, root_window); | 237 return new LauncherContextMenu(launcher_controller(), &item, root_window); |
238 } | 238 } |
239 | 239 |
240 ash::LauncherMenuModel* | 240 ash::ShelfMenuModel* |
241 BrowserShortcutLauncherItemController::CreateApplicationMenu(int event_flags) { | 241 BrowserShortcutLauncherItemController::CreateApplicationMenu(int event_flags) { |
242 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); | 242 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); |
243 } | 243 } |
244 | 244 |
245 bool BrowserShortcutLauncherItemController::IsDraggable() { | 245 bool BrowserShortcutLauncherItemController::IsDraggable() { |
246 return launcher_controller()->CanPin() ? true : false; | 246 return launcher_controller()->CanPin() ? true : false; |
247 } | 247 } |
248 | 248 |
249 bool BrowserShortcutLauncherItemController::ShouldShowTooltip() { | 249 bool BrowserShortcutLauncherItemController::ShouldShowTooltip() { |
250 return true; | 250 return true; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 return (browser && | 328 return (browser && |
329 launcher_controller()->IsBrowserFromActiveUser(browser) && | 329 launcher_controller()->IsBrowserFromActiveUser(browser) && |
330 browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH && | 330 browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH && |
331 (browser->is_type_tabbed() || | 331 (browser->is_type_tabbed() || |
332 !browser->is_app() || | 332 !browser->is_app() || |
333 !browser->is_type_popup() || | 333 !browser->is_type_popup() || |
334 launcher_controller()-> | 334 launcher_controller()-> |
335 GetLauncherIDForAppID(web_app::GetExtensionIdFromApplicationName( | 335 GetLauncherIDForAppID(web_app::GetExtensionIdFromApplicationName( |
336 browser->app_name())) <= 0)); | 336 browser->app_name())) <= 0)); |
337 } | 337 } |
OLD | NEW |