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

Unified Diff: ash/launcher/launcher_item_delegate.h

Issue 23606016: Refactor LauncherItemController and LauncherItemDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for LauncherTest and observing LauncherModel in DelegateManager Created 7 years, 3 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: ash/launcher/launcher_item_delegate.h
diff --git a/ash/launcher/launcher_item_delegate.h b/ash/launcher/launcher_item_delegate.h
index e1d940d509b7571a157cc83d58a06bd7b84daa45..a2b28e2798fa4a157d4048194f9130d4f133207c 100644
--- a/ash/launcher/launcher_item_delegate.h
+++ b/ash/launcher/launcher_item_delegate.h
@@ -35,7 +35,6 @@ class ASH_EXPORT LauncherMenuModel : public ui::SimpleMenuModel {
};
// Delegate for the LauncherItem.
-// TODO(simon.hong81): Remove LauncherItem from abstract function parameters.
class ASH_EXPORT LauncherItemDelegate {
public:
virtual ~LauncherItemDelegate() {}
@@ -45,18 +44,19 @@ class ASH_EXPORT LauncherItemDelegate {
// and has an instance of |views::View| as the event target
// but not |aura::Window|. If the |event| is of type KeyEvent, it is assumed
// that this was triggered by keyboard action (Alt+<number>) and special
- // handling might happen.
- virtual void ItemSelected(const LauncherItem& item,
- const ui::Event& event) = 0;
+ // handling might happen. The behavior varies by the number of windows
+ // associated with the item:
+ // * One window: toggles the minimize state.
+ // * Multiple windows: cycles the active window.
+ virtual void ItemSelected(const ui::Event& event) = 0;
- // Returns the title to display for the specified launcher item.
- virtual base::string16 GetTitle(const LauncherItem& item) = 0;
+ // Returns the title to display.
+ virtual base::string16 GetTitle() = 0;
// Returns the context menumodel for the specified item on
// |root_window|. Return NULL if there should be no context
// menu. The caller takes ownership of the returned model.
- virtual ui::MenuModel* CreateContextMenu(const LauncherItem& item,
- aura::RootWindow* root_window) = 0;
+ virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root_window) = 0;
// Returns the application menu model for the specified item. There are three
// possible return values:
@@ -67,15 +67,13 @@ class ASH_EXPORT LauncherItemDelegate {
// - A list containing the title and the active list of items.
// The caller takes ownership of the returned model.
// |event_flags| specifies the flags of the event which triggered this menu.
- virtual LauncherMenuModel* CreateApplicationMenu(
- const LauncherItem& item,
- int event_flags) = 0;
+ virtual ash::LauncherMenuModel* CreateApplicationMenu(int event_flags) = 0;
- // Whether the given launcher item is draggable.
- virtual bool IsDraggable(const LauncherItem& item) = 0;
+ // Whether the launcher item is draggable.
+ virtual bool IsDraggable() = 0;
- // Returns true if a tooltip should be shown for the item.
- virtual bool ShouldShowTooltip(const LauncherItem& item) = 0;
+ // Returns true if a tooltip should be shown.
+ virtual bool ShouldShowTooltip() = 0;
};
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698