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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_mash_shelf_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_mash_shelf_controller.h
diff --git a/chrome/browser/ui/ash/launcher/chrome_mash_shelf_controller.h b/chrome/browser/ui/ash/launcher/chrome_mash_shelf_controller.h
index b458fa369f8cd021941b7a46f622b98fba340182..198f63d8f513162aedc6fcd247c69654cdcb789b 100644
--- a/chrome/browser/ui/ash/launcher/chrome_mash_shelf_controller.h
+++ b/chrome/browser/ui/ash/launcher/chrome_mash_shelf_controller.h
@@ -8,14 +8,17 @@
#include <map>
#include <memory>
#include <string>
+#include <vector>
+#include "chrome/browser/ui/app_icon_loader.h"
#include "mash/shelf/public/interfaces/shelf.mojom.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
class ChromeShelfItemDelegate;
// ChromeMashShelfController manages chrome's interaction with the mash shelf.
-class ChromeMashShelfController : public mash::shelf::mojom::ShelfObserver {
+class ChromeMashShelfController : public mash::shelf::mojom::ShelfObserver,
+ public AppIconLoaderDelegate {
public:
~ChromeMashShelfController() override;
@@ -30,11 +33,19 @@ class ChromeMashShelfController : public mash::shelf::mojom::ShelfObserver {
void Init();
+ void PinAppsFromPrefs();
+
+ AppIconLoader* GetAppIconLoaderForApp(const std::string& app_id);
+
// mash::shelf::mojom::ShelfObserver:
void OnAlignmentChanged(mash::shelf::mojom::Alignment alignment) override;
void OnAutoHideBehaviorChanged(
mash::shelf::mojom::AutoHideBehavior auto_hide) override;
+ // AppIconLoaderDelegate:
+ void OnAppImageUpdated(const std::string& app_id,
+ const gfx::ImageSkia& image) override;
+
static ChromeMashShelfController* instance_;
mash::shelf::mojom::ShelfControllerPtr shelf_controller_;
@@ -42,6 +53,9 @@ class ChromeMashShelfController : public mash::shelf::mojom::ShelfObserver {
std::map<std::string, std::unique_ptr<ChromeShelfItemDelegate>>
app_id_to_item_delegate_;
+ // Used to load the images for app items.
+ std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeMashShelfController);
};

Powered by Google App Engine
This is Rietveld 408576698