| Index: trunk/src/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc
|
| ===================================================================
|
| --- trunk/src/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc (revision 226578)
|
| +++ trunk/src/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc (working copy)
|
| @@ -16,8 +16,6 @@
|
| #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.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/browser.h"
|
| #include "chrome/browser/ui/browser_finder.h"
|
| #include "chrome/browser/ui/browser_list.h"
|
| @@ -98,6 +96,10 @@
|
| }
|
| }
|
|
|
| +string16 BrowserShortcutLauncherItemController::GetTitle() {
|
| + return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
|
| +}
|
| +
|
| bool BrowserShortcutLauncherItemController::IsCurrentlyShownInWindow(
|
| aura::Window* window) const {
|
| const BrowserList* ash_browser_list =
|
| @@ -155,6 +157,31 @@
|
| void BrowserShortcutLauncherItemController::Close() {
|
| }
|
|
|
| +void BrowserShortcutLauncherItemController::Clicked(const ui::Event& event) {
|
| + #if defined(OS_CHROMEOS)
|
| + chromeos::default_pinned_apps_field_trial::RecordShelfClick(
|
| + chromeos::default_pinned_apps_field_trial::CHROME);
|
| + #endif
|
| +
|
| + if (event.flags() & ui::EF_CONTROL_DOWN) {
|
| + launcher_controller()->CreateNewWindow();
|
| + return;
|
| + }
|
| +
|
| + // 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) {
|
| + ActivateOrAdvanceToNextBrowser();
|
| + return;
|
| + }
|
| +
|
| + Activate(ash::LAUNCH_FROM_UNKNOWN);
|
| +}
|
| +
|
| +void BrowserShortcutLauncherItemController::OnRemoved() {
|
| + // BrowserShortcutLauncherItemController is owned by ChromeLauncherController.
|
| +}
|
| +
|
| ChromeLauncherAppMenuItems
|
| BrowserShortcutLauncherItemController::GetApplicationList(int event_flags) {
|
| ChromeLauncherAppMenuItems items;
|
| @@ -207,52 +234,6 @@
|
| return items.Pass();
|
| }
|
|
|
| -void BrowserShortcutLauncherItemController::ItemSelected(
|
| - const ui::Event& event) {
|
| -#if defined(OS_CHROMEOS)
|
| - chromeos::default_pinned_apps_field_trial::RecordShelfClick(
|
| - chromeos::default_pinned_apps_field_trial::CHROME);
|
| -#endif
|
| -
|
| - if (event.flags() & ui::EF_CONTROL_DOWN) {
|
| - launcher_controller()->CreateNewWindow();
|
| - return;
|
| - }
|
| -
|
| - // 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) {
|
| - ActivateOrAdvanceToNextBrowser();
|
| - return;
|
| - }
|
| -
|
| - Activate(ash::LAUNCH_FROM_UNKNOWN);
|
| -}
|
| -
|
| -string16 BrowserShortcutLauncherItemController::GetTitle() {
|
| - return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
|
| -}
|
| -
|
| -ui::MenuModel* BrowserShortcutLauncherItemController::CreateContextMenu(
|
| - aura::RootWindow* root_window) {
|
| - ash::LauncherItem item =
|
| - *(launcher_controller()->model()->ItemByID(launcher_id()));
|
| - return new LauncherContextMenu(launcher_controller(), &item, root_window);
|
| -}
|
| -
|
| -ash::LauncherMenuModel*
|
| -BrowserShortcutLauncherItemController::CreateApplicationMenu(int event_flags) {
|
| - return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags));
|
| -}
|
| -
|
| -bool BrowserShortcutLauncherItemController::IsDraggable() {
|
| - return launcher_controller()->CanPin() ? true : false;
|
| -}
|
| -
|
| -bool BrowserShortcutLauncherItemController::ShouldShowTooltip() {
|
| - return true;
|
| -}
|
| -
|
| gfx::Image BrowserShortcutLauncherItemController::GetBrowserListIcon(
|
| content::WebContents* web_contents) const {
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
|
|