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

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

Issue 3047031: [Mac] Give page actions a default image when preview enabled. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: comment about icons updating. Created 10 years, 5 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/cocoa/location_bar/page_action_decoration.mm
diff --git a/chrome/browser/cocoa/location_bar/page_action_decoration.mm b/chrome/browser/cocoa/location_bar/page_action_decoration.mm
index 1813bb858df5f16851465c283e73a971f5c20ac9..31e1c2301dd0760789605afe4306edc684e43dc3 100644
--- a/chrome/browser/cocoa/location_bar/page_action_decoration.mm
+++ b/chrome/browser/cocoa/location_bar/page_action_decoration.mm
@@ -141,8 +141,17 @@ void PageActionDecoration::UpdateVisibility(
}
}
- if (!skia_icon.isNull())
+ if (!skia_icon.isNull()) {
SetImage(gfx::SkBitmapToNSImage(skia_icon));
+ } else if (!GetImage()) {
+ // During install the action can be displayed before the icons
+ // have come in. Rather than deal with this in multiple places,
+ // provide a placeholder image. This will be replaced when an
+ // icon comes in.
+ const NSSize default_size = NSMakeSize(Extension::kPageActionIconMaxSize,
+ Extension::kPageActionIconMaxSize);
+ SetImage([[NSImage alloc] initWithSize:default_size]);
+ }
}
if (IsVisible() != visible) {
SetVisible(visible);
« 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