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

Side by Side Diff: chrome/browser/ui/cocoa/page_info/page_info_utils_cocoa.mm

Issue 2754383004: Rename WebsiteSettings code to PageInfo. (Closed)
Patch Set: Upload missing comment fix for WebSettingsUI -> PageInfoUI. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/cocoa/page_info/website_settings_utils_cocoa.h" 5 #include "chrome/browser/ui/cocoa/page_info/page_info_utils_cocoa.h"
6 6
7 namespace { 7 namespace {
8 // The amount of horizontal space between the button's title and its arrow icon. 8 // The amount of horizontal space between the button's title and its arrow icon.
9 const CGFloat kButtonTitleRightPadding = 4.0f; 9 const CGFloat kButtonTitleRightPadding = 4.0f;
10 } 10 }
11 11
12 // Determine the size of a popup button with the given title. 12 // Determine the size of a popup button with the given title.
13 NSSize SizeForWebsiteSettingsButtonTitle(NSPopUpButton* button, 13 NSSize SizeForPageInfoButtonTitle(NSPopUpButton* button, NSString* title) {
14 NSString* title) {
15 NSDictionary* textAttributes = 14 NSDictionary* textAttributes =
16 [[button attributedTitle] attributesAtIndex:0 effectiveRange:NULL]; 15 [[button attributedTitle] attributesAtIndex:0 effectiveRange:NULL];
17 NSSize titleSize = [title sizeWithAttributes:textAttributes]; 16 NSSize titleSize = [title sizeWithAttributes:textAttributes];
18 17
19 NSRect frame = [button frame]; 18 NSRect frame = [button frame];
20 NSRect titleRect = [[button cell] titleRectForBounds:frame]; 19 NSRect titleRect = [[button cell] titleRectForBounds:frame];
21 CGFloat width = titleSize.width + NSWidth(frame) - NSWidth(titleRect); 20 CGFloat width = titleSize.width + NSWidth(frame) - NSWidth(titleRect);
22 21
23 return NSMakeSize(width + kButtonTitleRightPadding, NSHeight(frame)); 22 return NSMakeSize(width + kButtonTitleRightPadding, NSHeight(frame));
24 } 23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698