Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: trunk/src/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc

Issue 25716004: Revert 226547 "Refactor LauncherItemController and LauncherItemD..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698