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

Unified Diff: ash/shelf/app_list_shelf_item_delegate.cc

Issue 23606016: Refactor LauncherItemController and LauncherItemDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for unittest.. 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 | « ash/shelf/app_list_shelf_item_delegate.h ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/app_list_shelf_item_delegate.cc
diff --git a/ash/shelf/app_list_shelf_item_delegate.cc b/ash/shelf/app_list_shelf_item_delegate.cc
index 615a381b7d53bbba0f1d30288911a08b090d1dbb..231f68d8afcf08683fa5171808d4c7ed92839c0e 100644
--- a/ash/shelf/app_list_shelf_item_delegate.cc
+++ b/ash/shelf/app_list_shelf_item_delegate.cc
@@ -4,10 +4,8 @@
#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"
@@ -18,23 +16,18 @@ AppListShelfItemDelegate::AppListShelfItemDelegate() {
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() {
- // Don't unregister this from LauncherItemDelegateManager.
- // LauncherItemDelegateManager is already destroyed.
+ // LauncherItemDelegateManager owns and destroys this class.
}
-void AppListShelfItemDelegate::ItemSelected(const LauncherItem& item,
- const ui::Event& event) {
+void AppListShelfItemDelegate::ItemSelected(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(const LauncherItem& item) {
+base::string16 AppListShelfItemDelegate::GetTitle() {
LauncherModel* model = Shell::GetInstance()->launcher_model();
DCHECK(model);
return model->status() == LauncherModel::STATUS_LOADING ?
@@ -43,23 +36,21 @@ base::string16 AppListShelfItemDelegate::GetTitle(const LauncherItem& item) {
}
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(const LauncherItem& item) {
+bool AppListShelfItemDelegate::IsDraggable() {
return false;
}
-bool AppListShelfItemDelegate::ShouldShowTooltip(const LauncherItem& item) {
+bool AppListShelfItemDelegate::ShouldShowTooltip() {
return true;
}
« no previous file with comments | « ash/shelf/app_list_shelf_item_delegate.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698