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

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

Issue 2900783003: Handle app custom icon via aura::Window property. (Closed)
Patch Set: fix mac compile 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.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
index 8908e859722dc188a200fdb9ecb512073f1da768..b49122170383a3e66834fc3b67ab2406a669a1ea 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -422,6 +422,7 @@ void ChromeLauncherController::ActivateApp(const std::string& app_id,
void ChromeLauncherController::SetLauncherItemImage(
const ash::ShelfID& shelf_id,
const gfx::ImageSkia& image) {
+ DCHECK(!image.isNull());
const ash::ShelfItem* item = GetItem(shelf_id);
if (item) {
ash::ShelfItem new_item = *item;
@@ -430,6 +431,13 @@ void ChromeLauncherController::SetLauncherItemImage(
}
}
+void ChromeLauncherController::UpdateLauncherItemImage(
+ const std::string& app_id) {
+ AppIconLoader* icon_loader = GetAppIconLoaderForApp(app_id);
+ if (icon_loader)
+ icon_loader->UpdateImage(app_id);
+}
+
void ChromeLauncherController::UpdateAppState(content::WebContents* contents,
AppState app_state) {
ash::ShelfID shelf_id(launcher_controller_helper_->GetAppID(contents));
@@ -686,16 +694,6 @@ ChromeLauncherController::GetArcDeferredLauncher() {
return arc_deferred_launcher_.get();
}
-AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp(
- const std::string& app_id) {
- for (const auto& app_icon_loader : app_icon_loaders_) {
- if (app_icon_loader->CanLoadImageForApp(app_id))
- return app_icon_loader.get();
- }
-
- return nullptr;
-}
-
void ChromeLauncherController::SetShelfAutoHideBehaviorFromPrefs() {
if (!ConnectToShelfController() || updating_shelf_pref_from_observer_)
return;
@@ -761,6 +759,16 @@ void ChromeLauncherController::UnpinAppWithID(const std::string& app_id) {
model_->UnpinAppWithID(app_id);
}
+AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp(
+ const std::string& app_id) {
+ for (const auto& app_icon_loader : app_icon_loaders_) {
+ if (app_icon_loader->CanLoadImageForApp(app_id))
+ return app_icon_loader.get();
+ }
+
+ return nullptr;
+}
+
///////////////////////////////////////////////////////////////////////////////
// LauncherAppUpdater::Delegate:

Powered by Google App Engine
This is Rietveld 408576698