Commit 6c95418d authored by melandory's avatar melandory Committed by Commit bot

Change explanation string for the Subresource Filter prompt.

xib changes:
ContentSubresourceFilter.xib: Aligned title and message fields with the Load full side button, added connection for the message.

BUG=646742

Review-Url: https://codereview.chromium.org/2334283004
Cr-Commit-Position: refs/heads/master@{#419118}
parent 1413bab6
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<outlet property="bubble_" destination="4" id="5"/> <outlet property="bubble_" destination="4" id="5"/>
<outlet property="doneButton_" destination="17" id="32"/> <outlet property="doneButton_" destination="17" id="32"/>
<outlet property="manageButton_" destination="15" id="31"/> <outlet property="manageButton_" destination="15" id="31"/>
<outlet property="messageLabel_" destination="dgF-Po-kkg" id="23a-5O-Xno"/>
<outlet property="titleLabel_" destination="7" id="30"/> <outlet property="titleLabel_" destination="7" id="30"/>
<outlet property="window" destination="1" id="3"/> <outlet property="window" destination="1" id="3"/>
</connections> </connections>
...@@ -67,19 +68,26 @@ DQ ...@@ -67,19 +68,26 @@ DQ
</button> </button>
</subviews> </subviews>
</customView> </customView>
<textField verticalHuggingPriority="750" id="7"> <textField verticalHuggingPriority="750" id="dgF-Po-kkg">
<rect key="frame" x="8" y="68" width="282" height="14"/> <rect key="frame" x="18" y="53" width="282" height="28"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="^IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION" id="8"> <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="^IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_TITLE" id="AxL-Md-rce">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
<connections>
<binding destination="-2" name="displayPatternValue1" keyPath="self.messageLabel_" id="wgi-Vp-Zyf">
<dictionary key="options">
<string key="NSDisplayPattern">%{value1}@</string>
</dictionary>
</binding>
</connections>
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField verticalHuggingPriority="750" id="dgF-Po-kkg"> <textField verticalHuggingPriority="750" id="7">
<rect key="frame" x="8" y="86" width="282" height="28"/> <rect key="frame" x="17" y="100" width="282" height="14"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="^IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_TITLE" id="AxL-Md-rce"> <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="^IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION" id="8">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
......
...@@ -53,6 +53,7 @@ typedef std::map<NSPopUpButton*, MediaMenuParts*, compare_button> ...@@ -53,6 +53,7 @@ typedef std::map<NSPopUpButton*, MediaMenuParts*, compare_button>
@interface ContentSettingBubbleController : BaseBubbleController { @interface ContentSettingBubbleController : BaseBubbleController {
@private @private
IBOutlet NSTextField* titleLabel_; IBOutlet NSTextField* titleLabel_;
IBOutlet NSTextField* messageLabel_;
IBOutlet NSMatrix* allowBlockRadioGroup_; IBOutlet NSMatrix* allowBlockRadioGroup_;
IBOutlet NSButton* manageButton_; IBOutlet NSButton* manageButton_;
......
...@@ -212,6 +212,7 @@ class ContentSettingBubbleWebContentsObserverBridge ...@@ -212,6 +212,7 @@ class ContentSettingBubbleWebContentsObserverBridge
referenceFrame:(NSRect)referenceFrame; referenceFrame:(NSRect)referenceFrame;
- (void)initializeBlockedPluginsList; - (void)initializeBlockedPluginsList;
- (void)initializeTitle; - (void)initializeTitle;
- (void)initializeMessage;
- (void)initializeRadioGroup; - (void)initializeRadioGroup;
- (void)initializeItemList; - (void)initializeItemList;
- (void)initializeGeoLists; - (void)initializeGeoLists;
...@@ -329,6 +330,24 @@ const ContentTypeToNibPath kNibPaths[] = { ...@@ -329,6 +330,24 @@ const ContentTypeToNibPath kNibPaths[] = {
[titleLabel_ setFrame:titleFrame]; [titleLabel_ setFrame:titleFrame];
} }
- (void)initializeMessage {
if (!messageLabel_)
return;
NSString* label = base::SysUTF16ToNSString(
contentSettingBubbleModel_->bubble_content().message);
[messageLabel_ setStringValue:label];
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 { - (void)initializeRadioGroup {
// NOTE! Tags in the xib files must match the order of the radio buttons // 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. // passed in the radio_group and be 1-based, not 0-based.
...@@ -769,6 +788,7 @@ const ContentTypeToNibPath kNibPaths[] = { ...@@ -769,6 +788,7 @@ const ContentTypeToNibPath kNibPaths[] = {
[self initManageDoneButtons]; [self initManageDoneButtons];
[self initializeTitle]; [self initializeTitle];
[self initializeMessage];
// Note that the per-content-type methods and |initializeRadioGroup| below // Note that the per-content-type methods and |initializeRadioGroup| below
// must be kept in the correct order, as they make interdependent adjustments // must be kept in the correct order, as they make interdependent adjustments
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment