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

Unified Diff: ash/mus/shelf_delegate_mus.cc

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
« no previous file with comments | « ash/mus/shelf_delegate_mus.h ('k') | chrome/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/shelf_delegate_mus.cc
diff --git a/ash/mus/shelf_delegate_mus.cc b/ash/mus/shelf_delegate_mus.cc
index 617edeebc444958006dc1b06fbcd8e390858969a..62f1d2c15c16f12b8537784a55b182f7afaa4ce2 100644
--- a/ash/mus/shelf_delegate_mus.cc
+++ b/ash/mus/shelf_delegate_mus.cc
@@ -313,6 +313,18 @@ void ShelfDelegateMus::UnpinItem(const mojo::String& app_id) {
}
}
+void ShelfDelegateMus::SetItemImage(const mojo::String& app_id,
+ skia::mojom::BitmapPtr image) {
+ if (!app_id_to_shelf_id_.count(app_id.To<std::string>()))
+ return;
+ ShelfID shelf_id = app_id_to_shelf_id_[app_id.To<std::string>()];
+ int index = model_->ItemIndexByID(shelf_id);
+ DCHECK_GE(index, 0);
+ ShelfItem item = *model_->ItemByID(shelf_id);
+ item.image = GetShelfIconFromBitmap(image.To<SkBitmap>());
+ model_->Set(index, item);
+}
+
void ShelfDelegateMus::OnUserWindowObserverAdded(
mojo::Array<mash::wm::mojom::UserWindowPtr> user_windows) {
for (size_t i = 0; i < user_windows.size(); ++i)
« no previous file with comments | « ash/mus/shelf_delegate_mus.h ('k') | chrome/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698