Index: trunk/src/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h |
=================================================================== |
--- trunk/src/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h (revision 226578) |
+++ trunk/src/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h (working copy) |
@@ -46,7 +46,6 @@ |
class TabContents; |
namespace ash { |
-class LauncherItemDelegateManager; |
class LauncherModel; |
} |
@@ -86,7 +85,10 @@ |
// * App shell windows have ShellWindowLauncherItemController, owned by |
// ShellWindowLauncherController. |
// * Shortcuts have no LauncherItemController. |
+// TODO(simon.hong81): Move LauncherItemDelegate out from |
+// ChromeLauncherController and makes separate subclass with it. |
class ChromeLauncherController : public ash::LauncherDelegate, |
+ public ash::LauncherItemDelegate, |
public ash::LauncherModelObserver, |
public ash::ShellObserver, |
public ash::DisplayController::Observer, |
@@ -294,6 +296,18 @@ |
virtual bool CanPin() const OVERRIDE; |
virtual void UnpinAppWithID(const std::string& app_id) OVERRIDE; |
+ // ash::LauncherItemDelegate overrides: |
+ virtual void ItemSelected(const ash::LauncherItem& item, |
+ const ui::Event& event) OVERRIDE; |
+ virtual string16 GetTitle(const ash::LauncherItem& item) OVERRIDE; |
+ virtual ui::MenuModel* CreateContextMenu( |
+ const ash::LauncherItem& item, aura::RootWindow* root) OVERRIDE; |
+ virtual ash::LauncherMenuModel* CreateApplicationMenu( |
+ const ash::LauncherItem& item, |
+ int event_flags) OVERRIDE; |
+ virtual bool IsDraggable(const ash::LauncherItem& item) OVERRIDE; |
+ virtual bool ShouldShowTooltip(const ash::LauncherItem& item) OVERRIDE; |
+ |
// ash::LauncherModelObserver overrides: |
virtual void LauncherItemAdded(int index) OVERRIDE; |
virtual void LauncherItemRemoved(int index, ash::LauncherID id) OVERRIDE; |
@@ -371,8 +385,6 @@ |
BrowserShortcutLauncherItemController* |
GetBrowserShortcutLauncherItemController(); |
- LauncherItemController* GetLauncherItemController(const ash::LauncherID id); |
- |
protected: |
// Creates a new app shortcut item and controller on the launcher at |index|. |
// Use kInsertItemAtEnd to add a shortcut as the last item. |
@@ -385,11 +397,6 @@ |
void SetAppIconLoaderForTest(extensions::AppIconLoader* loader); |
const std::string& GetAppIdFromLauncherIdForTest(ash::LauncherID id); |
- // Sets the ash::LauncherItemDelegateManager only for unittests and doesn't |
- // take an ownership of it. |
- void SetLauncherItemDelegateManagerForTest( |
- ash::LauncherItemDelegateManager* manager); |
- |
private: |
friend class ChromeLauncherControllerTest; |
friend class LauncherAppBrowserTest; |
@@ -501,10 +508,8 @@ |
// deleted. |
void CloseWindowedAppsFromRemovedExtension(const std::string& app_id); |
- // Set LauncherItemDelegate |item_delegate| for |id| and take an ownership. |
- // TODO(simon.hong81): Make this take a scoped_ptr of |item_delegate|. |
- void SetLauncherItemDelegate(ash::LauncherID id, |
- ash::LauncherItemDelegate* item_delegate); |
+ // Register LauncherItemDelegate. |
+ void RegisterLauncherItemDelegate(); |
// Attach to a specific profile. |
void AttachProfile(Profile* proifile); |
@@ -516,8 +521,6 @@ |
ash::LauncherModel* model_; |
- ash::LauncherItemDelegateManager* item_delegate_manager_; |
- |
// Profile used for prefs and loading extensions. This is NOT necessarily the |
// profile new windows are created with. |
Profile* profile_; |
@@ -550,6 +553,9 @@ |
// Launchers that are currently being observed. |
std::set<ash::Launcher*> launchers_; |
+ // The owned browser shortcut item. |
+ scoped_ptr<BrowserShortcutLauncherItemController> browser_item_controller_; |
+ |
// The owned browser status monitor. |
scoped_ptr<BrowserStatusMonitor> browser_status_monitor_; |