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 a86a1934953eee48a40d820913670921ea481193..1d0187ac2b6b4a6a49ac081a6e72de0f94d953e3 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 |
@@ -94,6 +94,9 @@ const CGFloat kPermissionDeleteImageSize = 16; |
// The spacing between individual permissions. |
const CGFloat kPermissionsVerticalSpacing = 16; |
+// The spacing between permissions and their decision description labels. |
+const CGFloat kPermissionsDecisionVerticalSpacing = 4; |
+ |
// Amount to lower each permission icon to align the icon baseline with the |
// label text. |
const CGFloat kPermissionIconYAdjustment = 1; |
@@ -900,8 +903,27 @@ bool IsInternalURL(const GURL& url) { |
[button setEnabled:NO]; |
} |
+ // Update |point| to match the y of the bottomost UI element added (|button|). |
NSRect buttonFrame = [button frame]; |
- return NSMakePoint(NSMaxX(buttonFrame), NSMaxY(buttonFrame)); |
+ point.y = NSMaxY(buttonFrame); |
+ |
+ // Show the reason for the permission decision in a new row if it did not come |
+ // from the user. |
+ base::string16 reason = PageInfoUI::PermissionDecisionReasonToUIString( |
+ [self profile], permissionInfo, url_); |
+ if (!reason.empty()) { |
+ point.y += kPermissionsDecisionVerticalSpacing; |
+ label = [self addText:reason |
+ withSize:[NSFont systemFontSize] |
+ bold:NO |
+ toView:view |
+ atPoint:point]; |
+ label.textColor = skia::SkColorToSRGBNSColor( |
+ PageInfoUI::GetPermissionDecisionTextColor()); |
+ point.y += NSHeight(label.frame); |
+ } |
+ |
+ return NSMakePoint(NSMaxX(buttonFrame), point.y); |
} |
// Adds a new row to the UI listing the permissions. Returns the NSPoint of the |