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

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: cleanup 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 acda1fb5690d3d48047cb8abc0cabd95baa5c561..3a286f2bb6d9f165b427ed8a21a66f34f77d668a 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
@@ -24,8 +24,9 @@
#include "ui/wm/core/window_animations.h"
ExtensionAppWindowLauncherItemController::
- ExtensionAppWindowLauncherItemController(const ash::ShelfID& shelf_id)
- : AppWindowLauncherItemController(shelf_id) {}
+ ExtensionAppWindowLauncherItemController(const ash::ShelfID& shelf_id,
+ ChromeLauncherController* owner)
+ : AppWindowLauncherItemController(shelf_id, owner) {}
ExtensionAppWindowLauncherItemController::
~ExtensionAppWindowLauncherItemController() {}
@@ -59,8 +60,16 @@ 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()) {
+ // icon = app_window->pp_icon();
msw 2017/05/23 00:02:29 fix this
khmel 2017/05/23 16:11:44 Done.
+ 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