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

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

Issue 2769323002: mash: Update shelf pin prefs in ShelfModelObserver overrides. (Closed)
Patch Set: Use ScopedPinSyncDisabler name suggestion. Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3741cfdf7d5dc0d576de6df9a910aecfa9f6477c..839c08abd0820f32f081455cecd34cde70e03cfe 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -12,6 +12,7 @@
#include "ash/public/cpp/app_launch_id.h"
#include "ash/public/cpp/shelf_item.h"
#include "ash/public/interfaces/shelf.mojom.h"
+#include "base/auto_reset.h"
#include "chrome/browser/ui/app_icon_loader.h"
#include "chrome/browser/ui/app_icon_loader_delegate.h"
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
@@ -232,6 +233,12 @@ class ChromeLauncherController : public ash::mojom::ShelfObserver,
void SetShelfAlignmentFromPrefs();
void SetShelfBehaviorsFromPrefs();
+ bool should_sync_pin_changes() const { return should_sync_pin_changes_; }
+
+ // Temporarily prevent pinned shelf item changes from updating the sync model.
+ using ScopedPinSyncDisabler = std::unique_ptr<base::AutoReset<bool>>;
+ ScopedPinSyncDisabler GetScopedPinSyncDisabler();
+
// Sets LauncherControllerHelper or AppIconLoader for test, taking ownership.
void SetLauncherControllerHelperForTest(
std::unique_ptr<LauncherControllerHelper> helper);
@@ -288,6 +295,9 @@ class ChromeLauncherController : public ash::mojom::ShelfObserver,
// True when setting a shelf pref in response to an observer notification.
bool updating_shelf_pref_from_observer_ = false;
+ // When true, changes to pinned shelf items should update the sync model.
+ bool should_sync_pin_changes_ = true;
+
// Used to get app info for tabs.
std::unique_ptr<LauncherControllerHelper> launcher_controller_helper_;
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698