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

Unified Diff: trunk/src/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h

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/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_;

Powered by Google App Engine
This is Rietveld 408576698