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

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

Issue 2769323002: mash: Update shelf pin prefs in ShelfModelObserver overrides. (Closed)
Patch Set: Address comments; reduce the reach of our crbug.com/654622 workaround. 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
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..0fdb264fcde31405533ad281688cbeccb915c322 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,11 @@ 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.
+ std::unique_ptr<base::AutoReset<bool>> DoNotSyncPinChanges();
James Cook 2017/03/29 23:23:56 hrm. I like the idea of returning a RAII-style "lo
msw 2017/03/30 00:33:29 Elliot suggests adding move semantics to AutoReset
James Cook 2017/03/30 02:05:28 I think "using" is fine for now. optional name id
msw 2017/03/30 02:22:11 Done.
+
// Sets LauncherControllerHelper or AppIconLoader for test, taking ownership.
void SetLauncherControllerHelperForTest(
std::unique_ptr<LauncherControllerHelper> helper);
@@ -288,6 +294,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_;

Powered by Google App Engine
This is Rietveld 408576698