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

Unified Diff: ash/shelf/shelf_controller.cc

Issue 2870683002: ash: Remove ShelfModel id conversion functions. (Closed)
Patch Set: Address comments. 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
« no previous file with comments | « ash/shelf/shelf_controller.h ('k') | ash/shelf/shelf_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_controller.cc
diff --git a/ash/shelf/shelf_controller.cc b/ash/shelf/shelf_controller.cc
index 2a1011ba72dc361a8112ad671edb09368e10071c..4059d5940ff3cf60f6e824d0315ec402fc3908bd 100644
--- a/ash/shelf/shelf_controller.cc
+++ b/ash/shelf/shelf_controller.cc
@@ -12,31 +12,13 @@
#include "ash/wm_window.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/base/models/simple_menu_model.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 {
-// Returns an icon image from an SkBitmap, or the default shelf icon image if
-// the bitmap is empty. Assumes the bitmap is a 1x icon.
-// TODO(jamescook): Support other scale factors.
-gfx::ImageSkia GetShelfIconFromBitmap(const SkBitmap& bitmap) {
- gfx::ImageSkia icon_image;
- if (!bitmap.isNull()) {
- icon_image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap);
- } else {
- // Use default icon.
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- icon_image = *rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
- }
- return icon_image;
-}
-
// Returns the WmShelf instance for the display with the given |display_id|.
WmShelf* GetShelfForDisplay(int64_t display_id) {
// The controller may be null for invalid ids or for displays being removed.
@@ -122,14 +104,7 @@ void ShelfController::UnpinItem(const std::string& app_id) {
void ShelfController::SetItemImage(const std::string& app_id,
const SkBitmap& image) {
- if (!app_id_to_shelf_id_.count(app_id))
- return;
- ShelfID shelf_id = app_id_to_shelf_id_[app_id];
- int index = model_.ItemIndexByID(shelf_id);
- DCHECK_GE(index, 0);
- ShelfItem item = *model_.ItemByID(shelf_id);
- item.image = GetShelfIconFromBitmap(image);
- model_.Set(index, item);
+ NOTIMPLEMENTED();
}
} // namespace ash
« no previous file with comments | « ash/shelf/shelf_controller.h ('k') | ash/shelf/shelf_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698