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

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

Issue 2649323006: Change the Bluetooth chooser buttons order to be Cancel/Pair on MacOS (Closed)
Patch Set: change the Bluetooth chooser buttons order to be Cancel/Pair on MacOS Created 3 years, 11 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/ui/cocoa/device_chooser_content_view_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/device_chooser_content_view_cocoa.mm b/chrome/browser/ui/cocoa/device_chooser_content_view_cocoa.mm
index 7067b8ce1b58d02c7713a80ddeef439e1960cf04..d75486523e876c7a4fe195e27537216816254675 100644
--- a/chrome/browser/ui/cocoa/device_chooser_content_view_cocoa.mm
+++ b/chrome/browser/ui/cocoa/device_chooser_content_view_cocoa.mm
@@ -402,7 +402,7 @@ void ChooserContentViewController::UpdateTableView() {
// | | | |
// | | | |
// | -------------------------------- |
- // | [ Connect ] [ Cancel ] |
+ // | [ Cancel ] [ Connect ] |
// |----------------------------------|
// | Get help |
// ------------------------------------
@@ -434,14 +434,14 @@ void ChooserContentViewController::UpdateTableView() {
IDS_BLUETOOTH_DEVICE_CHOOSER_TURN_ADAPTER_OFF, base::string16()));
CGFloat adapterOffMessageWidth = NSWidth([adapterOffMessage_ frame]);
- // Connect button.
- connectButton_ = [self createConnectButton];
- CGFloat connectButtonWidth = NSWidth([connectButton_ frame]);
- CGFloat connectButtonHeight = NSHeight([connectButton_ frame]);
-
// Cancel button.
cancelButton_ = [self createCancelButton];
CGFloat cancelButtonWidth = NSWidth([cancelButton_ frame]);
+ CGFloat cancelButtonHeight = NSHeight([cancelButton_ frame]);
+
+ // Connect button.
+ connectButton_ = [self createConnectButton];
+ CGFloat connectButtonWidth = NSWidth([connectButton_ frame]);
// Separator.
separator_ = [self createSeparator];
@@ -480,13 +480,13 @@ void ChooserContentViewController::UpdateTableView() {
kChooserHeight - 2 * kMarginY -
(chooserController_->ShouldShowFootnoteView() ? 4 * kVerticalPadding
: 2 * kVerticalPadding) -
- titleHeight - connectButtonHeight - helpButtonHeight;
+ titleHeight - cancelButtonHeight - helpButtonHeight;
CGFloat scrollViewOriginX = kMarginX;
CGFloat scrollViewOriginY =
kMarginY + helpButtonHeight +
(chooserController_->ShouldShowFootnoteView() ? 3 * kVerticalPadding
: kVerticalPadding) +
- connectButtonHeight;
+ cancelButtonHeight;
NSRect scrollFrame = NSMakeRect(scrollViewOriginX, scrollViewOriginY,
scrollViewWidth, scrollViewHeight);
scrollView_.reset([[NSScrollView alloc] initWithFrame:scrollFrame]);
@@ -558,26 +558,27 @@ void ChooserContentViewController::UpdateTableView() {
[spinner_ setHidden:YES];
[self addSubview:spinner_];
- // Connect button.
- CGFloat connectButtonOriginX = kChooserWidth - kMarginX -
- kHorizontalPadding - connectButtonWidth -
- cancelButtonWidth;
- CGFloat connectButtonOriginY =
+ // Cancel button.
+ CGFloat cancelButtonOriginX = kChooserWidth - kMarginX -
+ kHorizontalPadding - cancelButtonWidth -
+ connectButtonWidth;
+ CGFloat cancelButtonOriginY =
kMarginY + helpButtonHeight +
(chooserController_->ShouldShowFootnoteView() ? 2 * kVerticalPadding
: 0.0f);
+ [cancelButton_
+ setFrameOrigin:NSMakePoint(cancelButtonOriginX, cancelButtonOriginY)];
+ [self addSubview:cancelButton_];
+
+ // Connect button.
+ CGFloat connectButtonOriginX =
+ kChooserWidth - kMarginX - connectButtonWidth;
+ CGFloat connectButtonOriginY = cancelButtonOriginY;
[connectButton_
setFrameOrigin:NSMakePoint(connectButtonOriginX, connectButtonOriginY)];
[connectButton_ setEnabled:NO];
[self addSubview:connectButton_];
- // Cancel button.
- CGFloat cancelButtonOriginX = kChooserWidth - kMarginX - cancelButtonWidth;
- CGFloat cancelButtonOriginY = connectButtonOriginY;
- [cancelButton_
- setFrameOrigin:NSMakePoint(cancelButtonOriginX, cancelButtonOriginY)];
- [self addSubview:cancelButton_];
-
if (chooserController_->ShouldShowFootnoteView()) {
// Separator.
CGFloat separatorOriginX = 0.0f;
« 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