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

Unified Diff: chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm

Issue 208643004: UI adjustments for the HIDE button in the screen share notification window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/screen_capture_notification_ui_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm
index 0071c14c31b0847a4d383dfe4f6e5460c2d98c49..29d11515f5e01a1a4c4009b1d12e44219e88ac77 100644
--- a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm
+++ b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm
@@ -29,8 +29,8 @@
const CGFloat kMinimumWidth = 460;
const CGFloat kMaximumWidth = 1000;
const CGFloat kHorizontalMargin = 10;
-const CGFloat kPadding = 5;
-const CGFloat kPaddingLeft = 10;
+const CGFloat kPaddingVertical = 5;
+const CGFloat kPaddingHorizontal = 10;
const CGFloat kWindowCornerRadius = 2;
const CGFloat kWindowAlphaValue = 0.85;
@@ -140,9 +140,14 @@ scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create(
[stopButton_ sizeToFit];
[content addSubview:stopButton_];
- minimizeButton_.reset(
- [[HyperlinkButtonCell buttonWithString:l10n_util::GetNSString(
- IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON)] retain]);
+ base::scoped_nsobject<HyperlinkButtonCell> cell(
+ [[HyperlinkButtonCell alloc]
+ initTextCell:l10n_util::GetNSString(
+ IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON)]);
+ [cell setShouldUnderline:NO];
+
+ minimizeButton_.reset([[NSButton alloc] initWithFrame:NSZeroRect]);
+ [minimizeButton_ setCell:cell.get()];
[minimizeButton_ sizeToFit];
[minimizeButton_ setTarget:self];
[minimizeButton_ setAction:@selector(minimize:)];
@@ -150,20 +155,21 @@ scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create(
CGFloat buttonsWidth = NSWidth([stopButton_ frame]) + kHorizontalMargin +
NSWidth([minimizeButton_ frame]);
- CGFloat totalHeight = kPadding + NSHeight([stopButton_ frame]) + kPadding;
+ CGFloat totalHeight =
+ kPaddingVertical + NSHeight([stopButton_ frame]) + kPaddingVertical;
// Create grip icon.
base::scoped_nsobject<WindowGripView> gripView([[WindowGripView alloc] init]);
[content addSubview:gripView];
CGFloat gripWidth = NSWidth([gripView frame]);
CGFloat gripHeight = NSHeight([gripView frame]);
- [gripView
- setFrameOrigin:NSMakePoint(kPaddingLeft, (totalHeight - gripHeight) / 2)];
+ [gripView setFrameOrigin:NSMakePoint(kPaddingHorizontal,
+ (totalHeight - gripHeight) / 2)];
// Create text label.
int maximumWidth =
std::min(kMaximumWidth, NSWidth([[NSScreen mainScreen] visibleFrame]));
- int maxLabelWidth = maximumWidth - kPaddingLeft - kPadding -
+ int maxLabelWidth = maximumWidth - kPaddingHorizontal * 2 -
kHorizontalMargin * 2 - gripWidth - buttonsWidth;
gfx::FontList font_list;
base::string16 elidedText =
@@ -179,26 +185,26 @@ scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create(
[statusTextField setFont:font_list.GetPrimaryFont().GetNativeFont()];
[statusTextField sizeToFit];
[statusTextField setFrameOrigin:NSMakePoint(
- kPaddingLeft + kHorizontalMargin + gripWidth,
+ kPaddingHorizontal + kHorizontalMargin + gripWidth,
(totalHeight - NSHeight([statusTextField frame])) / 2)];
[content addSubview:statusTextField];
// Resize content view to fit controls.
- CGFloat minimumLableWidth = kMinimumWidth - kPaddingLeft - kPadding -
+ CGFloat minimumLableWidth = kMinimumWidth - kPaddingHorizontal * 2 -
kHorizontalMargin * 2 - gripWidth - buttonsWidth;
CGFloat lableWidth =
std::max(NSWidth([statusTextField frame]), minimumLableWidth);
- CGFloat totalWidth = kPaddingLeft + kPadding + kHorizontalMargin * 2 +
+ CGFloat totalWidth = kPaddingHorizontal * 2 + kHorizontalMargin * 2 +
gripWidth + lableWidth + buttonsWidth;
[content setFrame:NSMakeRect(0, 0, totalWidth, totalHeight)];
// Move the buttons to the right place.
- NSPoint buttonOrigin =
- NSMakePoint(totalWidth - kPadding - buttonsWidth, kPadding);
+ NSPoint buttonOrigin = NSMakePoint(
+ totalWidth - kPaddingHorizontal - buttonsWidth, kPaddingVertical);
[stopButton_ setFrameOrigin:buttonOrigin];
[minimizeButton_ setFrameOrigin:NSMakePoint(
- totalWidth - kPadding - NSWidth([minimizeButton_ frame]),
+ totalWidth - kPaddingHorizontal - NSWidth([minimizeButton_ frame]),
(totalHeight - NSHeight([minimizeButton_ frame])) / 2)];
if (base::i18n::IsRTL()) {
« no previous file with comments | « no previous file | chrome/browser/ui/views/screen_capture_notification_ui_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698