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

Unified Diff: chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_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/extension_app_window_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc
index 04bc180a64b35d401bce6d37d7b3198827cb9de5..78c557b092b425bee0c4d86ea220f4ea3f8708b5 100644
--- a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc
@@ -58,8 +58,15 @@ ash::MenuItemList ExtensionAppWindowLauncherItemController::GetAppMenuItems(
favicon::ContentFaviconDriver::FromWebContents(
app_window->web_contents());
gfx::Image icon = favicon_driver->GetFavicon();
- if (icon.IsEmpty())
- icon = app_window->app_icon();
+ if (icon.IsEmpty()) {
+ const gfx::ImageSkia* app_icon = nullptr;
+ if (app_window->GetNativeWindow()) {
+ app_icon = app_window->GetNativeWindow()->GetProperty(
+ aura::client::kAppIconKey);
+ }
+ if (app_icon && !app_icon->isNull())
+ icon = gfx::Image(*app_icon);
+ }
if (!icon.IsEmpty())
item->image = *icon.ToSkBitmap();
items.push_back(std::move(item));

Powered by Google App Engine
This is Rietveld 408576698