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

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

Issue 2714193004: [Mac RTL] Fix the RTLness of the website settings bubble header. (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h" 5 #import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // These will be created only if necessary. 350 // These will be created only if necessary.
351 resetDecisionsField_ = nil; 351 resetDecisionsField_ = nil;
352 resetDecisionsButton_ = nil; 352 resetDecisionsButton_ = nil;
353 353
354 NSString* connectionHelpButtonText = l10n_util::GetNSString(IDS_LEARN_MORE); 354 NSString* connectionHelpButtonText = l10n_util::GetNSString(IDS_LEARN_MORE);
355 connectionHelpButton_ = [self addLinkButtonWithText:connectionHelpButtonText 355 connectionHelpButton_ = [self addLinkButtonWithText:connectionHelpButtonText
356 toView:securitySectionView]; 356 toView:securitySectionView];
357 [connectionHelpButton_ setTarget:self]; 357 [connectionHelpButton_ setTarget:self];
358 [connectionHelpButton_ setAction:@selector(openConnectionHelp:)]; 358 [connectionHelpButton_ setAction:@selector(openConnectionHelp:)];
359 359
360 if (base::i18n::IsRTL()) {
361 securitySummaryField_.alignment = NSRightTextAlignment;
362 securityDetailsField_.alignment = NSRightTextAlignment;
363 }
364
360 return securitySectionView.get(); 365 return securitySectionView.get();
361 } 366 }
362 367
363 // Create and return a subview for the site settings and add it to the given 368 // Create and return a subview for the site settings and add it to the given
364 // |superview|. |superview| retains the new view. 369 // |superview|. |superview| retains the new view.
365 - (NSView*)addSiteSettingsSectionToView:(NSView*)superview { 370 - (NSView*)addSiteSettingsSectionToView:(NSView*)superview {
366 base::scoped_nsobject<NSView> siteSettingsSectionView( 371 base::scoped_nsobject<NSView> siteSettingsSectionView(
367 [[FlippedView alloc] initWithFrame:[superview frame]]); 372 [[FlippedView alloc] initWithFrame:[superview frame]]);
368 [superview addSubview:siteSettingsSectionView]; 373 [superview addSubview:siteSettingsSectionView];
369 374
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 CGFloat yPos = 0; 506 CGFloat yPos = 0;
502 507
503 [self sizeTextFieldHeightToFit:securitySummaryField_]; 508 [self sizeTextFieldHeightToFit:securitySummaryField_];
504 yPos = [self setYPositionOfView:securitySummaryField_ 509 yPos = [self setYPositionOfView:securitySummaryField_
505 to:yPos + kSectionVerticalPadding]; 510 to:yPos + kSectionVerticalPadding];
506 511
507 [self sizeTextFieldHeightToFit:securityDetailsField_]; 512 [self sizeTextFieldHeightToFit:securityDetailsField_];
508 yPos = [self setYPositionOfView:securityDetailsField_ 513 yPos = [self setYPositionOfView:securityDetailsField_
509 to:yPos + kSecurityParagraphSpacing]; 514 to:yPos + kSecurityParagraphSpacing];
510 515
511 [connectionHelpButton_ setFrameOrigin:NSMakePoint(kSectionHorizontalPadding - 516 NSPoint helpOrigin =
512 kLinkButtonXAdjustment, 517 NSMakePoint(kSectionHorizontalPadding - kLinkButtonXAdjustment, yPos);
513 yPos)]; 518 if (base::i18n::IsRTL()) {
519 helpOrigin.x = NSWidth([contentView_ frame]) - helpOrigin.x -
520 NSWidth(connectionHelpButton_.frame);
521 }
522 [connectionHelpButton_ setFrameOrigin:helpOrigin];
514 yPos = NSMaxY([connectionHelpButton_ frame]); 523 yPos = NSMaxY([connectionHelpButton_ frame]);
515 524
516 if (resetDecisionsButton_) { 525 if (resetDecisionsButton_) {
517 DCHECK(resetDecisionsField_); 526 DCHECK(resetDecisionsField_);
518 yPos = [self setYPositionOfView:resetDecisionsField_ 527 yPos = [self setYPositionOfView:resetDecisionsField_
519 to:yPos + kSecurityParagraphSpacing]; 528 to:yPos + kSecurityParagraphSpacing];
520 [resetDecisionsButton_ 529 [resetDecisionsButton_
521 setFrameOrigin:NSMakePoint(NSMinX([resetDecisionsButton_ frame]) - 530 setFrameOrigin:NSMakePoint(NSMinX([resetDecisionsButton_ frame]) -
522 kLinkButtonXAdjustment, 531 kLinkButtonXAdjustment,
523 yPos)]; 532 yPos)];
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 void PageInfoUIBridge::SetCookieInfo(const CookieInfoList& cookie_info_list) { 1228 void PageInfoUIBridge::SetCookieInfo(const CookieInfoList& cookie_info_list) {
1220 [bubble_controller_ setCookieInfo:cookie_info_list]; 1229 [bubble_controller_ setCookieInfo:cookie_info_list];
1221 } 1230 }
1222 1231
1223 void PageInfoUIBridge::SetPermissionInfo( 1232 void PageInfoUIBridge::SetPermissionInfo(
1224 const PermissionInfoList& permission_info_list, 1233 const PermissionInfoList& permission_info_list,
1225 ChosenObjectInfoList chosen_object_info_list) { 1234 ChosenObjectInfoList chosen_object_info_list) {
1226 [bubble_controller_ setPermissionInfo:permission_info_list 1235 [bubble_controller_ setPermissionInfo:permission_info_list
1227 andChosenObjects:std::move(chosen_object_info_list)]; 1236 andChosenObjects:std::move(chosen_object_info_list)];
1228 } 1237 }
OLDNEW
« 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