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

Unified Diff: chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.mm

Issue 2841013002: Permissions/Mac: Fix RTL positions for permission decision strings. (Closed)
Patch Set: Wrap instead of ellide. Created 3 years, 8 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/page_info/page_info_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.mm b/chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.mm
index 4f50b6dacdb108c9616c69e78856bd9939a00038..56903beae75b2c3919955565eb6e9dba91db856b 100644
--- a/chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.mm
@@ -913,11 +913,24 @@ bool IsInternalURL(const GURL& url) {
base::string16 reason = PageInfoUI::PermissionDecisionReasonToUIString(
[self profile], permissionInfo, url_);
if (!reason.empty()) {
+ // Do this even in RTL to make sure -addText sets the right width for the
+ // permission decision reason label.
+ point.x = kSectionHorizontalPadding + kPermissionImageSize +
+ kPermissionImageSpacing;
+
label = [self addText:reason
withSize:[NSFont smallSystemFontSize]
bold:NO
toView:view
atPoint:point];
+ if (isRTL) {
+ [label setAlignment:NSRightTextAlignment];
+ // Shift the reason left to align the permission label and the permission
+ // decision reason's right edges.
+ point.x -= (kPermissionImageSize + kPermissionImageSpacing);
+ [label setFrameOrigin:point];
+ }
+
label.textColor = skia::SkColorToSRGBNSColor(
PageInfoUI::GetPermissionDecisionTextColor());
point.y += NSHeight(label.frame);
« 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