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

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

Issue 162813003: Restore ShellWindow app icon in RegisterApp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
index d0755c2fa018b52b824c425ebc499216cb9ce4f4..4198ff79db802f2dfb0ac65bfe2513dc346efa74 100644
--- a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
@@ -170,10 +170,17 @@ void ShellWindowLauncherController::RegisterApp(ShellWindow* shell_window) {
// item for this app id (e.g. pinned), use that shelf item.
if (app_shelf_id == app_id)
shelf_id = owner_->GetShelfIDForAppID(app_id);
- if (shelf_id == 0)
+ if (shelf_id == 0) {
shelf_id = owner_->CreateAppLauncherItem(controller, app_id, status);
- else
+ // Restore any existing app icon and flag as set.
+ const gfx::Image& app_icon = shell_window->app_icon();
+ if (!app_icon.IsEmpty()) {
+ owner_->SetLauncherItemImage(shelf_id, app_icon.AsImageSkia());
+ controller->set_image_set_by_controller(true);
+ }
+ } else {
owner_->SetItemController(shelf_id, controller);
+ }
const std::string app_shelf_id = GetAppShelfId(shell_window);
app_controller_map_[app_shelf_id] = controller;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698