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

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

Issue 2833173002: mash: Support ShelfModel access in Chrome. (Closed)
Patch Set: Address comments; fix test failures. Created 3 years, 7 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 33d3ba664464dd53934b226f0a580ed9bdfb8ca7..00d59c44e35622fce017a3eefbfcd1a7558b0d99 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -26,6 +26,8 @@
#include "components/prefs/pref_change_registrar.h"
#include "components/sync_preferences/pref_service_syncable_observer.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/public/cpp/bindings/interface_ptr_set.h"
class AccountId;
class AppIconLoader;
@@ -356,12 +358,21 @@ class ChromeLauncherController
int64_t display_id) override;
void OnAutoHideBehaviorChanged(ash::ShelfAutoHideBehavior auto_hide,
int64_t display_id) override;
+ void OnShelfItemAdded(int32_t index, const ash::ShelfItem& item) override;
+ void OnShelfItemRemoved(const ash::ShelfID& id) override;
+ void OnShelfItemMoved(const ash::ShelfID& id, int32_t index) override;
+ void OnShelfItemUpdated(const ash::ShelfItem& item) override;
+ void OnShelfItemDelegateChanged(
+ const ash::ShelfID& id,
+ ash::mojom::ShelfItemDelegatePtr delegate) override;
// ash::ShelfModelObserver:
void ShelfItemAdded(int index) override;
void ShelfItemRemoved(int index, const ash::ShelfItem& old_item) override;
void ShelfItemMoved(int start_index, int target_index) override;
void ShelfItemChanged(int index, const ash::ShelfItem& old_item) override;
+ void ShelfItemDelegateChanged(const ash::ShelfID& id,
+ ash::ShelfItemDelegate* delegate) override;
// ash::WindowTreeHostManager::Observer:
void OnDisplayConfigurationChanged() override;
@@ -385,6 +396,9 @@ class ChromeLauncherController
// multi-profile use cases this might change over time.
Profile* profile_ = nullptr;
+ // In classic Ash, this the ShelfModel owned by ash::Shell's ShelfController.
+ // In the mash config, this is a separate ShelfModel instance, owned by
+ // ChromeBrowserMainExtraPartsAsh, and synchronized with Ash's ShelfModel.
ash::ShelfModel* model_;
// Ash's mojom::ShelfController used to change shelf state.
@@ -396,6 +410,10 @@ class ChromeLauncherController
// True when setting a shelf pref in response to an observer notification.
bool updating_shelf_pref_from_observer_ = false;
+ // True when applying changes from the remote ShelfModel owned by Ash.
+ // Changes to the local ShelfModel should not be reported during this time.
+ bool applying_remote_shelf_model_changes_ = false;
+
// When true, changes to pinned shelf items should update the sync model.
bool should_sync_pin_changes_ = true;

Powered by Google App Engine
This is Rietveld 408576698