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

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

Issue 22429004: Refactor LauncherDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add some comments Created 7 years, 4 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: chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
index dafc18dc9fe18e1acc0827973cda006037055acb..a5132926b9c8739e051f1ee17e92e9341e6ab2ae 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -21,6 +21,7 @@ class ChromeLauncherAppMenuItem;
class ChromeLauncherControllerPerApp;
namespace ash {
+class LauncherItemDelegate;
class LauncherModel;
}
@@ -179,10 +180,6 @@ class ChromeLauncherController
// Returns the id of the app for the specified tab.
virtual std::string GetAppID(content::WebContents* tab) = 0;
- // Returns the launcherID of the first non-panel item whose app_id
- // matches |app_id| or 0 if none match.
- virtual ash::LauncherID GetLauncherIDForAppID(const std::string& app_id) = 0;
-
// Returns the id of the app for the specified id (which must exist).
virtual std::string GetAppIDForLauncherID(ash::LauncherID id) = 0;
@@ -190,22 +187,12 @@ class ChromeLauncherController
virtual void SetLauncherItemImage(ash::LauncherID launcher_id,
const gfx::ImageSkia& image) = 0;
- // Returns true if a pinned launcher item with given |app_id| could be found.
- virtual bool IsAppPinned(const std::string& app_id) = 0;
-
- // Pins an app with |app_id| to launcher. If there is a running instance in
- // launcher, the running instance is pinned. If there is no running instance,
- // a new launcher item is created and pinned.
- virtual void PinAppWithID(const std::string& app_id) = 0;
// Updates the launche type of the app for the specified id to |launch_type|.
virtual void SetLaunchType(
ash::LauncherID id,
extensions::ExtensionPrefs::LaunchType launch_type) = 0;
- // Unpins any app items whose id is |app_id|.
- virtual void UnpinAppsWithID(const std::string& app_id) = 0;
-
// Returns true if the user is currently logged in as a guest.
virtual bool IsLoggedInAsGuest() = 0;
@@ -217,10 +204,6 @@ class ChromeLauncherController
// incognito window.
virtual void CreateNewIncognitoWindow() = 0;
- // Checks whether the user is allowed to pin apps. Pinning may be disallowed
- // by policy in case there is a pre-defined set of pinned apps.
- virtual bool CanPin() const = 0;
-
// Updates the pinned pref state. The pinned state consists of a list pref.
// Each item of the list is a dictionary. The key |kAppIDPath| gives the
// id of the app.
@@ -264,19 +247,18 @@ class ChromeLauncherController
// it, the the window will get minimized instead.
virtual void ActivateWindowOrMinimizeIfActive(ui::BaseWindow* window,
bool allow_minimize) = 0;
+
// ash::LauncherDelegate overrides:
- virtual void ItemSelected(const ash::LauncherItem& item,
- const ui::Event& event) OVERRIDE = 0;
- virtual string16 GetTitle(const ash::LauncherItem& item) OVERRIDE = 0;
- virtual ui::MenuModel* CreateContextMenu(
- const ash::LauncherItem& item, aura::RootWindow* root) OVERRIDE = 0;
- virtual ash::LauncherMenuModel* CreateApplicationMenu(
- const ash::LauncherItem& item,
- int event_flags) OVERRIDE = 0;
virtual ash::LauncherID GetIDByWindow(aura::Window* window) OVERRIDE = 0;
- virtual bool IsDraggable(const ash::LauncherItem& item) OVERRIDE = 0;
- virtual bool ShouldShowTooltip(const ash::LauncherItem& item) OVERRIDE = 0;
- virtual bool IsPerAppLauncher() OVERRIDE;
+ virtual void OnLauncherCreated(ash::Launcher* launcher) OVERRIDE = 0;
+ virtual void OnLauncherDestroyed(ash::Launcher* launcher) OVERRIDE = 0;
+ virtual ash::LauncherID GetLauncherIDForAppID(
+ const std::string& app_id) OVERRIDE= 0;
+ virtual void PinAppWithID(const std::string& app_id) OVERRIDE = 0;
+ virtual bool IsAppPinned(const std::string& app_id) OVERRIDE = 0;
+ virtual void UnpinAppsWithID(const std::string& app_id) OVERRIDE = 0;
+ virtual ash::LauncherItemDelegate* GetLauncherItemDelegate(
+ const ash::LauncherItem& item) OVERRIDE = 0;
// extensions::AppIconLoader overrides:
virtual void SetAppImage(const std::string& app_id,

Powered by Google App Engine
This is Rietveld 408576698