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

Side by Side Diff: chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm

Issue 2723233006: Cocoa Page Info: Take built-in padding into account for "Site settings" button placement. (Closed)
Patch Set: Remove dependency (not needed for this CL). 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
« 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/website_settings/website_settings_bubble_contro ller.h" 5 #import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_contro ller.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 const CGFloat kDefaultWindowWidth = 320; 63 const CGFloat kDefaultWindowWidth = 320;
64 64
65 // Padding around each section 65 // Padding around each section
66 const CGFloat kSectionVerticalPadding = 20; 66 const CGFloat kSectionVerticalPadding = 20;
67 const CGFloat kSectionHorizontalPadding = 16; 67 const CGFloat kSectionHorizontalPadding = 16;
68 68
69 // Links are buttons with invisible padding, so we need to move them back to 69 // Links are buttons with invisible padding, so we need to move them back to
70 // align with other text. 70 // align with other text.
71 const CGFloat kLinkButtonXAdjustment = 1; 71 const CGFloat kLinkButtonXAdjustment = 1;
72 72
73 // Built-in margin for NSButton to take into account.
74 const CGFloat kNSButtonBuiltinMargin = 4;
75
73 // Security Section ------------------------------------------------------------ 76 // Security Section ------------------------------------------------------------
74 77
75 // Spacing between security summary, security details, and cert decisions text. 78 // Spacing between security summary, security details, and cert decisions text.
76 const CGFloat kSecurityParagraphSpacing = 12; 79 const CGFloat kSecurityParagraphSpacing = 12;
77 80
78 // Site Settings Section ------------------------------------------------------- 81 // Site Settings Section -------------------------------------------------------
79 82
80 // Square size of the permission images. 83 // Square size of the permission images.
81 const CGFloat kPermissionImageSize = 16; 84 const CGFloat kPermissionImageSize = 16;
82 85
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // Handler for the link button to revoke user certificate decisions. 437 // Handler for the link button to revoke user certificate decisions.
435 - (void)resetCertificateDecisions:(id)sender { 438 - (void)resetCertificateDecisions:(id)sender {
436 DCHECK(resetDecisionsButton_); 439 DCHECK(resetDecisionsButton_);
437 presenter_->OnRevokeSSLErrorBypassButtonPressed(); 440 presenter_->OnRevokeSSLErrorBypassButtonPressed();
438 [self close]; 441 [self close];
439 } 442 }
440 443
441 - (CGFloat)layoutViewAtRTLStart:(NSView*)view withYPosition:(CGFloat)yPos { 444 - (CGFloat)layoutViewAtRTLStart:(NSView*)view withYPosition:(CGFloat)yPos {
442 CGFloat xPos; 445 CGFloat xPos;
443 if (base::i18n::IsRTL()) { 446 if (base::i18n::IsRTL()) {
444 xPos = 447 xPos = kDefaultWindowWidth - kSectionHorizontalPadding -
445 kDefaultWindowWidth - kSectionHorizontalPadding - NSWidth([view frame]); 448 NSWidth([view frame]) + kNSButtonBuiltinMargin;
446 } else { 449 } else {
447 xPos = kSectionHorizontalPadding; 450 xPos = kSectionHorizontalPadding - kNSButtonBuiltinMargin;
448 } 451 }
449 [view setFrameOrigin:NSMakePoint(xPos, yPos)]; 452 [view setFrameOrigin:NSMakePoint(xPos, yPos - kNSButtonBuiltinMargin)];
450 return yPos + NSHeight([view frame]); 453 return yPos + NSHeight([view frame]) - kNSButtonBuiltinMargin;
451 } 454 }
452 455
453 // Set the Y position of |view| to the given position, and return the position 456 // Set the Y position of |view| to the given position, and return the position
454 // of its bottom edge. 457 // of its bottom edge.
455 - (CGFloat)setYPositionOfView:(NSView*)view to:(CGFloat)position { 458 - (CGFloat)setYPositionOfView:(NSView*)view to:(CGFloat)position {
456 NSRect frame = [view frame]; 459 NSRect frame = [view frame];
457 frame.origin.y = position; 460 frame.origin.y = position;
458 [view setFrame:frame]; 461 [view setFrame:frame];
459 return position + NSHeight(frame); 462 return position + NSHeight(frame);
460 } 463 }
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 const CookieInfoList& cookie_info_list) { 1212 const CookieInfoList& cookie_info_list) {
1210 [bubble_controller_ setCookieInfo:cookie_info_list]; 1213 [bubble_controller_ setCookieInfo:cookie_info_list];
1211 } 1214 }
1212 1215
1213 void WebsiteSettingsUIBridge::SetPermissionInfo( 1216 void WebsiteSettingsUIBridge::SetPermissionInfo(
1214 const PermissionInfoList& permission_info_list, 1217 const PermissionInfoList& permission_info_list,
1215 ChosenObjectInfoList chosen_object_info_list) { 1218 ChosenObjectInfoList chosen_object_info_list) {
1216 [bubble_controller_ setPermissionInfo:permission_info_list 1219 [bubble_controller_ setPermissionInfo:permission_info_list
1217 andChosenObjects:std::move(chosen_object_info_list)]; 1220 andChosenObjects:std::move(chosen_object_info_list)];
1218 } 1221 }
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