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

Unified Diff: chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm

Issue 2334283004: Change explanation string for the Subresource Filter prompt. (Closed)
Patch Set: add connection to xib Created 4 years, 3 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 | « chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
index e0e09f2c99a5d4b49476dfc412164237bc71e119..4dffd5015b4fde372295b7c33da50cfe50bda1bc 100644
--- a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
+++ b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm
@@ -212,6 +212,7 @@ class ContentSettingBubbleWebContentsObserverBridge
referenceFrame:(NSRect)referenceFrame;
- (void)initializeBlockedPluginsList;
- (void)initializeTitle;
+- (void)initializeMessage;
- (void)initializeRadioGroup;
- (void)initializeItemList;
- (void)initializeGeoLists;
@@ -329,6 +330,25 @@ const ContentTypeToNibPath kNibPaths[] = {
[titleLabel_ setFrame:titleFrame];
}
+- (void)initializeMessage {
+ if (!messageLabel_)
+ return;
+
+ NSString* label = base::SysUTF16ToNSString(
+ contentSettingBubbleModel_->bubble_content().message);
+ [messageLabel_ setStringValue:label];
+
+ // Layout title post-localization.
+ CGFloat deltaY = [GTMUILocalizerAndLayoutTweaker
+ sizeToFitFixedWidthTextField:messageLabel_];
+ NSRect windowFrame = [[self window] frame];
+ windowFrame.size.height += deltaY;
+ [[self window] setFrame:windowFrame display:NO];
+ NSRect messageFrame = [messageLabel_ frame];
+ messageFrame.origin.y -= deltaY;
+ [messageLabel_ setFrame:messageFrame];
+}
+
- (void)initializeRadioGroup {
// NOTE! Tags in the xib files must match the order of the radio buttons
// passed in the radio_group and be 1-based, not 0-based.
@@ -770,6 +790,8 @@ const ContentTypeToNibPath kNibPaths[] = {
[self initializeTitle];
Nico 2016/09/15 19:26:50 nit: i wouldn't put a newline here
melandory 2016/09/15 19:55:02 Done.
+ [self initializeMessage];
+
// Note that the per-content-type methods and |initializeRadioGroup| below
// must be kept in the correct order, as they make interdependent adjustments
// of the bubble's height.
« no previous file with comments | « chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698