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

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

Issue 2055553004: arc: Support pinned apps across Arc-enabled and Arc-disabled platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup and update Created 4 years, 6 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 e6a1c0bee8ddec7f09f6673cbbadea57bb29bc8b..cb67eedcbbdb2c2ffa5f70635aa21d88c1cffc77 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -24,6 +24,7 @@
#include "build/build_config.h"
#include "chrome/browser/ui/app_icon_loader.h"
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
+#include "chrome/browser/ui/app_list/app_list_syncable_service.h"
#include "chrome/browser/ui/ash/app_sync_ui_state_observer.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h"
@@ -88,7 +89,8 @@ class ChromeLauncherController
public syncable_prefs::PrefServiceSyncableObserver,
public AppSyncUIStateObserver,
public LauncherAppUpdater::Delegate,
- public ash::ShelfItemDelegateManagerObserver {
+ public ash::ShelfItemDelegateManagerObserver,
+ public app_list::AppListSyncableService::Observer {
public:
// Indicates if a shelf item is incognito or not.
enum IncognitoState {
@@ -212,11 +214,6 @@ class ChromeLauncherController
// incognito window.
void CreateNewIncognitoWindow();
- // 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.
- void PersistPinnedState();
-
// Accessor to the currently loaded profile. Note that in multi profile use
// cases this might change over time.
Profile* profile();
@@ -290,6 +287,9 @@ class ChromeLauncherController
void OnAppImageUpdated(const std::string& app_id,
const gfx::ImageSkia& image) override;
+ // app_list::AppListSyncableService::Observer:
+ void OnSyncModelUpdated() override;
+
// Called when the active user has changed.
void ActiveUserChanged(const std::string& user_email);
@@ -419,7 +419,10 @@ class ChromeLauncherController
// app.
void UnpinRunningAppInternal(int index);
- // Re-syncs shelf model with prefs::kPinnedLauncherApps.
+ // Updates pin position for the item specified by |id| in sync model.
+ void SyncPinPosition(ash::ShelfID id);
+
+ // Re-syncs shelf model.
void UpdateAppLaunchersFromPref();
// Sets the shelf auto-hide behavior from prefs.
@@ -458,23 +461,8 @@ class ChromeLauncherController
// Check if the given |web_contents| is in incognito mode.
bool IsIncognito(const content::WebContents* web_contents) const;
- // Update browser shortcut's index.
- void PersistChromeItemIndex(int index);
-
- // 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
- // the action and to make sure that the other item can still be moved
- // afterwards (index adjustments).
- void MoveChromeOrApplistToFinalPosition(
- bool is_chrome,
- bool is_app_list,
- int target_index,
- int* chrome_index,
- int* app_list_index);
-
// Finds the index of where to insert the next item.
- int FindInsertionPoint(bool is_app_list);
+ int FindInsertionPoint();
// Get the browser shortcut's index in the shelf using the current's systems
// configuration of pinned and known (but not running) apps.
@@ -502,7 +490,7 @@ class ChromeLauncherController
ash::ShelfModel* model_;
- ash::ShelfItemDelegateManager* item_delegate_manager_;
+ ash::ShelfItemDelegateManager* item_delegate_manager_ = nullptr;
// Profile used for prefs and loading extensions. This is NOT necessarily the
// profile new windows are created with.
@@ -529,7 +517,7 @@ class ChromeLauncherController
PrefChangeRegistrar pref_change_registrar_;
- AppSyncUIState* app_sync_ui_state_;
+ AppSyncUIState* app_sync_ui_state_ = nullptr;
// The owned browser status monitor.
std::unique_ptr<BrowserStatusMonitor> browser_status_monitor_;
@@ -541,7 +529,7 @@ class ChromeLauncherController
std::unique_ptr<ArcAppDeferredLauncherController> arc_deferred_launcher_;
// If true, incoming pinned state changes should be ignored.
- bool ignore_persist_pinned_state_change_;
+ bool ignore_persist_pinned_state_change_ = false;
// The list of running & un-pinned applications for different users on hidden
// desktops.

Powered by Google App Engine
This is Rietveld 408576698