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

Unified Diff: trunk/src/ash/shelf/app_list_shelf_item_delegate.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
« no previous file with comments | « trunk/src/ash/shelf/app_list_shelf_item_delegate.h ('k') | trunk/src/ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ash/shelf/app_list_shelf_item_delegate.cc
===================================================================
--- trunk/src/ash/shelf/app_list_shelf_item_delegate.cc (revision 226578)
+++ trunk/src/ash/shelf/app_list_shelf_item_delegate.cc (working copy)
@@ -4,8 +4,10 @@
#include "ash/shelf/app_list_shelf_item_delegate.h"
+#include "ash/launcher/launcher_item_delegate_manager.h"
#include "ash/launcher/launcher_model.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -16,18 +18,23 @@
LauncherItem app_list;
app_list.type = TYPE_APP_LIST;
Shell::GetInstance()->launcher_model()->Add(app_list);
+
+ ash::Shell::GetInstance()->launcher_item_delegate_manager()->
+ RegisterLauncherItemDelegate(ash::TYPE_APP_LIST, this);
}
AppListShelfItemDelegate::~AppListShelfItemDelegate() {
- // LauncherItemDelegateManager owns and destroys this class.
+ // Don't unregister this from LauncherItemDelegateManager.
+ // LauncherItemDelegateManager is already destroyed.
}
-void AppListShelfItemDelegate::ItemSelected(const ui::Event& event) {
+void AppListShelfItemDelegate::ItemSelected(const LauncherItem& item,
+ const ui::Event& event) {
// Pass NULL here to show the app list in the currently active RootWindow.
Shell::GetInstance()->ToggleAppList(NULL);
}
-base::string16 AppListShelfItemDelegate::GetTitle() {
+base::string16 AppListShelfItemDelegate::GetTitle(const LauncherItem& item) {
LauncherModel* model = Shell::GetInstance()->launcher_model();
DCHECK(model);
return model->status() == LauncherModel::STATUS_LOADING ?
@@ -36,21 +43,23 @@
}
ui::MenuModel* AppListShelfItemDelegate::CreateContextMenu(
+ const LauncherItem& item,
aura::RootWindow* root_window) {
return NULL;
}
LauncherMenuModel* AppListShelfItemDelegate::CreateApplicationMenu(
+ const LauncherItem& item,
int event_flags) {
// AppList does not show an application menu.
return NULL;
}
-bool AppListShelfItemDelegate::IsDraggable() {
+bool AppListShelfItemDelegate::IsDraggable(const LauncherItem& item) {
return false;
}
-bool AppListShelfItemDelegate::ShouldShowTooltip() {
+bool AppListShelfItemDelegate::ShouldShowTooltip(const LauncherItem& item) {
return true;
}
« no previous file with comments | « trunk/src/ash/shelf/app_list_shelf_item_delegate.h ('k') | trunk/src/ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698