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

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

Issue 1921403002: Pin apps from prefs on the mash shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only use ChromeMashShelfController with use_ash=1. Created 4 years, 8 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 88225b805afc4d07b0567b42e765154605bb1688..1d82489683e1c74e4fda6fbc8646c2758f845449 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -40,6 +40,7 @@ class BrowserShortcutLauncherItemController;
class BrowserStatusMonitor;
class ExtensionEnableFlow;
class GURL;
+class LauncherControllerHelper;
class LauncherItemController;
class Profile;
class AppWindowLauncherController;
@@ -107,25 +108,6 @@ class ChromeLauncherController
APP_STATE_REMOVED
};
- // Mockable interface to get app ids from tabs.
- class AppTabHelper {
- public:
- virtual ~AppTabHelper() {}
-
- // Returns the app id of the specified tab, or an empty string if there is
- // no app. All known profiles will be queried for this.
- virtual std::string GetAppID(content::WebContents* tab) = 0;
-
- // Returns true if |id| is valid for the currently active profile.
- // Used during restore to ignore no longer valid extensions.
- // Note that already running applications are ignored by the restore
- // process.
- virtual bool IsValidIDForCurrentUser(const std::string& id) = 0;
-
- // Sets the currently active profile for the usage of |GetAppID|.
- virtual void SetCurrentUser(Profile* profile) = 0;
- };
-
ChromeLauncherController(Profile* profile, ash::ShelfModel* model);
~ChromeLauncherController() override;
@@ -391,9 +373,8 @@ class ChromeLauncherController
ash::ShelfID CreateAppShortcutLauncherItem(const std::string& app_id,
int index);
- // Sets the AppTabHelper/AppIconLoader, taking ownership of the helper class.
- // These are intended for testing.
- void SetAppTabHelperForTest(AppTabHelper* helper);
+ // Sets LauncherControllerHelper/AppIconLoader for test, taking ownership.
+ void SetLauncherControllerHelperForTest(LauncherControllerHelper* helper);
void SetAppIconLoadersForTest(
std::vector<std::unique_ptr<AppIconLoader>>& loaders);
const std::string& GetAppIdFromShelfIdForTest(ash::ShelfID id);
@@ -485,9 +466,6 @@ class ChromeLauncherController
// Update browser shortcut's index.
void PersistChromeItemIndex(int index);
- // Get browser shortcut's index from pref.
- int GetChromeIconIndexFromPref() const;
-
// Depending on the provided flags, move either the chrome icon, the app icon
// or none to the given |target_index|. The provided |chrome_index| and
// |app_list_index| locations will get adjusted within this call to finalize
@@ -507,9 +485,6 @@ class ChromeLauncherController
// configuration of pinned and known (but not running) apps.
int GetChromeIconIndexForCreation();
- // Get the list of pinned programs from the preferences.
- std::vector<std::string> GetListOfPinnedAppsAndBrowser();
-
// Close all windowed V1 applications of a certain extension which was already
// deleted.
void CloseWindowedAppsFromRemovedExtension(const std::string& app_id,
@@ -549,9 +524,9 @@ class ChromeLauncherController
app_window_controllers_;
// Used to get app info for tabs.
- std::unique_ptr<AppTabHelper> app_tab_helper_;
+ std::unique_ptr<LauncherControllerHelper> launcher_controller_helper_;
- // Used to load the image for an extension app item.
+ // Used to load the images for app items.
std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_;
// Used to handle app load/unload events.

Powered by Google App Engine
This is Rietveld 408576698