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

Unified Diff: chrome/browser/cocoa/extensions/browser_action_button.mm

Issue 3012044: [Mac] Adjust toolbar spacing of browser actions for M6. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Extraneous includes. 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
Index: chrome/browser/cocoa/extensions/browser_action_button.mm
diff --git a/chrome/browser/cocoa/extensions/browser_action_button.mm b/chrome/browser/cocoa/extensions/browser_action_button.mm
index 202cd9351c84a043a3608b7bfd085d56f0d91f82..70f15ee4f7f164de5c2e04bb423b8c98268b0d59 100644
--- a/chrome/browser/cocoa/extensions/browser_action_button.mm
+++ b/chrome/browser/cocoa/extensions/browser_action_button.mm
@@ -35,15 +35,6 @@ NSString* const kBrowserActionButtonDragEndNotification =
static const CGFloat kBrowserActionBadgeOriginYOffset = 5;
-// Since the container is the maximum height of the toolbar, we have to move the
-// buttons up by this amount in order to have them look vertically centered
-// within the toolbar.
-static const CGFloat kBrowserActionOriginYOffset = 6.0;
-
-// The size of each button on the toolbar.
-static const CGFloat kBrowserActionHeight = 27;
-const CGFloat kBrowserActionWidth = 29;
-
namespace {
const CGFloat kAnimationDuration = 0.2;
const CGFloat kShadowOffset = 2.0;
@@ -121,13 +112,10 @@ class ExtensionImageTrackerBridge : public NotificationObserver,
return [BrowserActionCell class];
}
-- (id)initWithExtension:(Extension*)extension
- profile:(Profile*)profile
- tabId:(int)tabId {
- NSRect frame = NSMakeRect(0.0,
- kBrowserActionOriginYOffset,
- kBrowserActionWidth,
- kBrowserActionHeight);
+- (id)initWithFrame:(NSRect)frame
+ extension:(Extension*)extension
+ profile:(Profile*)profile
+ tabId:(int)tabId {
if ((self = [super initWithFrame:frame])) {
BrowserActionCell* cell = [[[BrowserActionCell alloc] init] autorelease];
// [NSButton setCell:] warns to NOT use setCell: other than in the
@@ -280,7 +268,7 @@ class ExtensionImageTrackerBridge : public NotificationObserver,
}
- (NSImage*)compositedImage {
- NSRect bounds = NSMakeRect(0, 0, kBrowserActionWidth, kBrowserActionHeight);
+ NSRect bounds = [self bounds];
NSImage* image = [[[NSImage alloc] initWithSize:bounds.size] autorelease];
[image lockFocus];

Powered by Google App Engine
This is Rietveld 408576698