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

Unified Diff: chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm

Issue 9586018: Add support for multiple icon sizes for Mac platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 8 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
Index: chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
index 39467d9bd39d646c97f1bcc4789d63db9ab63788..29a1bcf5bdc9d82399c62b574ebbc77a053f9c98 100644
--- a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
@@ -114,8 +114,9 @@ bool PageActionDecoration::OnMousePressed(NSRect frame) {
return true;
}
-void PageActionDecoration::OnImageLoaded(
- SkBitmap* image, const ExtensionResource& resource, int index) {
+void PageActionDecoration::OnImageLoaded(const gfx::Image& image,
+ const std::string& extension_id,
+ int index) {
// We loaded icons()->size() icons, plus one extra if the Page Action had
// a default icon.
int total_icons = static_cast<int>(page_action_->icon_paths()->size());
@@ -125,11 +126,12 @@ void PageActionDecoration::OnImageLoaded(
// Map the index of the loaded image back to its name. If we ever get an
// index greater than the number of icons, it must be the default icon.
- if (image) {
+ if (!image.IsEmpty()) {
+ const SkBitmap* bitmap = image.ToSkBitmap();
if (index < static_cast<int>(page_action_->icon_paths()->size()))
- page_action_icons_[page_action_->icon_paths()->at(index)] = *image;
+ page_action_icons_[page_action_->icon_paths()->at(index)] = *bitmap;
else
- page_action_icons_[page_action_->default_icon_path()] = *image;
+ page_action_icons_[page_action_->default_icon_path()] = *bitmap;
}
// If we have no owner, that means this class is still being constructed and
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/page_action_decoration.h ('k') | chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698