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

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

Issue 1492073003: Handle more scale factors for extension Browser Action icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test catches real bug! Created 5 years 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 a911f4acdb63cb688142bd1392552422ca19d508..8a045c9b5104c5a6be165e4dc58843c6fb87f92d 100644
--- a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
@@ -50,10 +50,9 @@ PageActionDecoration::PageActionDecoration(
PageActionDecoration::~PageActionDecoration() {}
-// Always |kPageActionIconMaxSize| wide. |ImageDecoration| draws the
-// image centered.
+// Always |ActionIconSize| wide. |ImageDecoration| draws the image centered.
CGFloat PageActionDecoration::GetWidthForSpace(CGFloat width) {
- return ExtensionAction::kPageActionIconMaxSize;
+ return ExtensionAction::ActionIconSize();
}
bool PageActionDecoration::AcceptsMousePress() {
@@ -93,8 +92,8 @@ void PageActionDecoration::UpdateVisibility(WebContents* contents) {
SetToolTip(viewController_->GetTooltip(contents));
// Set the image.
- gfx::Size size(ExtensionAction::kPageActionIconMaxSize,
- ExtensionAction::kPageActionIconMaxSize);
+ gfx::Size size(ExtensionAction::ActionIconSize(),
+ ExtensionAction::ActionIconSize());
gfx::Image icon = viewController_->GetIcon(contents, size);
if (!icon.IsEmpty()) {
SetImage(icon.ToNSImage());
@@ -120,7 +119,7 @@ NSPoint PageActionDecoration::GetBubblePointInFrame(NSRect frame) {
// easier (the middle of the centered image is the middle of the
// frame).
const CGFloat delta_height =
- NSHeight(frame) - ExtensionAction::kPageActionIconMaxSize;
+ NSHeight(frame) - ExtensionAction::ActionIconSize();
const CGFloat bottom_inset = std::ceil(delta_height / 2.0);
// Return a point just below the bottom of the maximal drawing area.

Powered by Google App Engine
This is Rietveld 408576698