| Index: chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
|
| diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
|
| index ec5ccab2fb3d19272212ec2c0afe83873fc4c865..463ee02826e7ae37f45dce357e8b5f2ddd11a4f5 100644
|
| --- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
|
| +++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h"
|
|
|
| #include "apps/native_app_window.h"
|
| +#include "ash/launcher/launcher_model.h"
|
| #include "ash/wm/window_util.h"
|
| #include "chrome/browser/extensions/extension_process_manager.h"
|
| #include "chrome/browser/extensions/extension_system.h"
|
| @@ -12,6 +13,8 @@
|
| #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h"
|
| #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h"
|
| #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
|
| +#include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h"
|
| +#include "chrome/browser/ui/ash/launcher/launcher_context_menu.h"
|
| #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_finder.h"
|
| @@ -25,6 +28,10 @@
|
| #include "ui/base/events/event.h"
|
| #include "ui/views/corewm/window_animations.h"
|
|
|
| +#if defined(OS_CHROMEOS)
|
| +#include "chrome/browser/chromeos/login/default_pinned_apps_field_trial.h"
|
| +#endif
|
| +
|
| using extensions::Extension;
|
|
|
| namespace {
|
| @@ -56,10 +63,6 @@ AppShortcutLauncherItemController::AppShortcutLauncherItemController(
|
| AppShortcutLauncherItemController::~AppShortcutLauncherItemController() {
|
| }
|
|
|
| -string16 AppShortcutLauncherItemController::GetTitle() {
|
| - return GetAppTitle();
|
| -}
|
| -
|
| bool AppShortcutLauncherItemController::IsCurrentlyShownInWindow(
|
| aura::Window* window) const {
|
| Browser* browser = chrome::FindBrowserWithWindow(window);
|
| @@ -130,16 +133,6 @@ void AppShortcutLauncherItemController::Close() {
|
| }
|
| }
|
|
|
| -void AppShortcutLauncherItemController::Clicked(const ui::Event& event) {
|
| - // In case of a keyboard event, we were called by a hotkey. In that case we
|
| - // activate the next item in line if an item of our list is already active.
|
| - if (event.type() == ui::ET_KEY_RELEASED) {
|
| - if (AdvanceToNextApp())
|
| - return;
|
| - }
|
| - Activate();
|
| -}
|
| -
|
| void AppShortcutLauncherItemController::OnRemoved() {
|
| // AppShortcutLauncherItemController is unowned; delete on removal.
|
| delete this;
|
| @@ -198,6 +191,44 @@ AppShortcutLauncherItemController::GetRunningApplications() {
|
| return items;
|
| }
|
|
|
| +void AppShortcutLauncherItemController::ItemSelected(const ui::Event& event) {
|
| +#if defined(OS_CHROMEOS)
|
| + if (!app_id().empty())
|
| + chromeos::default_pinned_apps_field_trial::RecordShelfAppClick(app_id());
|
| +#endif
|
| + // In case of a keyboard event, we were called by a hotkey. In that case we
|
| + // activate the next item in line if an item of our list is already active.
|
| + if (event.type() == ui::ET_KEY_RELEASED) {
|
| + if (AdvanceToNextApp())
|
| + return;
|
| + }
|
| + Activate();
|
| +}
|
| +
|
| +base::string16 AppShortcutLauncherItemController::GetTitle() {
|
| + return GetAppTitle();
|
| +}
|
| +
|
| +ui::MenuModel* AppShortcutLauncherItemController::CreateContextMenu(
|
| + aura::RootWindow* root_window) {
|
| + ash::LauncherItem item =
|
| + *(launcher_controller()->model()->ItemByID(launcher_id()));
|
| + return new LauncherContextMenu(launcher_controller(), &item, root_window);
|
| +}
|
| +
|
| +ash::LauncherMenuModel*
|
| +AppShortcutLauncherItemController::CreateApplicationMenu(int event_flags) {
|
| + return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags));
|
| +}
|
| +
|
| +bool AppShortcutLauncherItemController::IsDraggable() {
|
| + return true;
|
| +}
|
| +
|
| +bool AppShortcutLauncherItemController::ShouldShowTooltip() {
|
| + return true;
|
| +}
|
| +
|
| content::WebContents* AppShortcutLauncherItemController::GetLRUApplication() {
|
| URLPattern refocus_pattern(URLPattern::SCHEME_ALL);
|
| refocus_pattern.SetMatchAllURLs(true);
|
|
|