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

Unified Diff: ash/common/shelf/shelf_window_watcher.cc

Issue 2514473003: Replace IDR window property use with gfx::ImageSkia icons. (Closed)
Patch Set: Add owership comments. Created 4 years, 1 month 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/common/shelf/shelf_constants.h ('k') | ash/common/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_window_watcher.cc
diff --git a/ash/common/shelf/shelf_window_watcher.cc b/ash/common/shelf/shelf_window_watcher.cc
index b277f579bd2a5a2c63756152fa02d1c957bffec6..648a8060b2086a5c6f2fa454a28b307d9a249fa7 100644
--- a/ash/common/shelf/shelf_window_watcher.cc
+++ b/ash/common/shelf/shelf_window_watcher.cc
@@ -15,11 +15,8 @@
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
#include "ash/public/cpp/shell_window_ids.h"
-#include "ui/base/resource/resource_bundle.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
-#include "ui/gfx/image/image_skia.h"
-#include "ui/resources/grit/ui_resources.h"
namespace ash {
namespace {
@@ -38,15 +35,9 @@ void UpdateShelfItemForWindow(ShelfItem* item, WmWindow* window) {
item->app_id = window->GetStringProperty(WmWindowProperty::APP_ID);
// Prefer app icons over window icons, they're typically larger.
- gfx::ImageSkia image = window->GetAppIcon();
- if (image.isNull())
- image = window->GetWindowIcon();
- if (image.isNull()) {
- int icon = window->GetIntProperty(WmWindowProperty::SHELF_ICON_RESOURCE_ID);
- if (icon != kInvalidImageResourceID)
- image = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(icon);
- }
- item->image = image;
+ item->image = window->GetAppIcon();
+ if (item->image.isNull())
+ item->image = window->GetWindowIcon();
}
} // namespace
@@ -90,7 +81,6 @@ void ShelfWindowWatcher::UserWindowObserver::OnWindowPropertyChanged(
property == WmWindowProperty::APP_ID ||
property == WmWindowProperty::DRAW_ATTENTION ||
property == WmWindowProperty::SHELF_ITEM_TYPE ||
- property == WmWindowProperty::SHELF_ICON_RESOURCE_ID ||
property == WmWindowProperty::WINDOW_ICON) {
window_watcher_->OnUserWindowPropertyChanged(window);
}
« no previous file with comments | « ash/common/shelf/shelf_constants.h ('k') | ash/common/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698