diff options
-rw-r--r-- | chrome/app/generated_resources.grd | 11 | ||||
-rw-r--r-- | chrome/app/nibs/CollectedCookies.xib | 1080 | ||||
-rw-r--r-- | chrome/browser/cocoa/collected_cookies_mac.h | 11 | ||||
-rw-r--r-- | chrome/browser/cocoa/collected_cookies_mac.mm | 213 | ||||
-rw-r--r-- | chrome/browser/gtk/collected_cookies_gtk.cc | 101 | ||||
-rw-r--r-- | chrome/browser/gtk/collected_cookies_gtk.h | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/gtk_tree.h | 4 | ||||
-rw-r--r-- | chrome/browser/host_content_settings_map.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/collected_cookies_win.cc | 172 | ||||
-rw-r--r-- | chrome/browser/views/collected_cookies_win.h | 6 | ||||
-rw-r--r-- | chrome/browser/views/options/managed_prefs_banner_view.cc | 1 | ||||
-rw-r--r-- | views/box_layout.cc | 15 | ||||
-rw-r--r-- | views/box_layout.h | 14 | ||||
-rw-r--r-- | views/box_layout_unittest.cc | 17 | ||||
-rw-r--r-- | views/examples/widget_example.h | 6 |
15 files changed, 1536 insertions, 121 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 3eb0349..87cae30 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6148,7 +6148,7 @@ Keep your key file in a safe place. You will need it to create new versions of y <!-- Collected cookies window --> <message name="IDS_COLLECTED_COOKIES_DIALOG_TITLE" desc="The title of the collect cookies dialog"> - Cookies and site data were set + Cookies set by this page </message> <message name="IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL" desc="The label used to describe the cookies that were allowed"> The following cookies were set when you viewed this page: @@ -6156,6 +6156,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL" desc="The label used to describe the cookies that were blocked"> The following cookies were blocked: </message> + <message name="IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED" desc="The label used to describe the cookies that were blocked include a note that third-party cookies were blocked without exception."> + The following cookies were blocked (third-party cookies are being blocked without exception): + </message> <message name="IDS_COLLECTED_COOKIES_ALLOW_BUTTON" desc="A button that lets the use create a content settings exception to allow certain domains."> Allow </message> @@ -6166,13 +6169,13 @@ Keep your key file in a safe place. You will need it to create new versions of y Block </message> <message name="IDS_COLLECTED_COOKIES_ALLOW_RULE_CREATED" desc="A notification that is displayed when a content exception to allow cookies was created."> - Cookies from <ph name="HOST">$1<ex>example.com</ex></ph> allowed. + Cookies from <ph name="DOMAIN">$1<ex>example.com</ex></ph> allowed. </message> <message name="IDS_COLLECTED_COOKIES_BLOCK_RULE_CREATED" desc="A notification that is displayed when a content exception to block cookies was created."> - Cookies from <ph name="HOST">$1<ex>example.com</ex></ph> blocked. + Cookies from <ph name="DOMAIN">$1<ex>example.com</ex></ph> blocked. </message> <message name="IDS_COLLECTED_COOKIES_SESSION_RULE_CREATED" desc="A notification that is displayed when a content exception to allow cookies for session only was created."> - Cookies from <ph name="HOST">$1<ex>example.com</ex></ph> allowed for session only. + Cookies from <ph name="DOMAIN">$1<ex>example.com</ex></ph> allowed for session only. </message> <message name="IDS_COLLECTED_COOKIES_MULTIPLE_ALLOW_RULES_CREATED" desc="A notification that is displayed when multiple content exceptions to allow cookies were created."> Cookies from multiple sites allowed. diff --git a/chrome/app/nibs/CollectedCookies.xib b/chrome/app/nibs/CollectedCookies.xib index 92dbf18..541d012 100644 --- a/chrome/app/nibs/CollectedCookies.xib +++ b/chrome/app/nibs/CollectedCookies.xib @@ -1,14 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> -<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03"> +<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">9L31a</string> - <string key="IBDocument.InterfaceBuilderVersion">680</string> - <string key="IBDocument.AppKitVersion">949.54</string> - <string key="IBDocument.HIToolboxVersion">353.00</string> + <string key="IBDocument.SystemVersion">10D2063a</string> + <string key="IBDocument.InterfaceBuilderVersion">762</string> + <string key="IBDocument.AppKitVersion">1038.29</string> + <string key="IBDocument.HIToolboxVersion">460.00</string> + <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="NS.object.0">762</string> + </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="379"/> + <integer value="1"/> + <integer value="405"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -16,7 +21,7 @@ </object> <object class="NSMutableDictionary" key="IBDocument.Metadata"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys" id="0"> <bool key="EncodedWithXMLCoder">YES</bool> </object> <object class="NSMutableArray" key="dict.values"> @@ -42,11 +47,11 @@ <string key="NSWindowTitle"/> <string key="NSWindowClass">NSWindow</string> <nil key="NSViewClass"/> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <string key="NSWindowContentMinSize">{499, 513}</string> <object class="NSView" key="NSWindowView" id="1006"> <reference key="NSNextResponder"/> - <int key="NSvFlags">256</int> + <int key="NSvFlags">274</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSSplitView" id="1042467467"> @@ -83,16 +88,16 @@ <object class="NSMutableArray" key="NSTableColumns"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSTableColumn" id="936123567"> - <double key="NSWidth">4.550000e+02</double> - <double key="NSMinWidth">1.600000e+01</double> - <double key="NSMaxWidth">1.000000e+03</double> + <double key="NSWidth">455</double> + <double key="NSMinWidth">16</double> + <double key="NSMaxWidth">1000</double> <object class="NSTableHeaderCell" key="NSHeaderCell"> <int key="NSCellFlags">75628096</int> <int key="NSCellFlags2">2048</int> <string key="NSContents"/> <object class="NSFont" key="NSSupport" id="26"> <string key="NSName">LucidaGrande</string> - <double key="NSSize">1.100000e+01</double> + <double key="NSSize">11</double> <int key="NSfFlags">3100</int> </object> <object class="NSColor" key="NSBackgroundColor"> @@ -121,7 +126,7 @@ <string key="NSColorName">controlBackgroundColor</string> <object class="NSColor" key="NSColor" id="848879610"> <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MC42NjY2NjY2OQA</bytes> + <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes> </object> </object> <object class="NSColor" key="NSTextColor" id="593135112"> @@ -136,8 +141,8 @@ <reference key="NSTableView" ref="120560"/> </object> </object> - <double key="NSIntercellSpacingWidth">2.000000e+00</double> - <double key="NSIntercellSpacingHeight">3.000000e+00</double> + <double key="NSIntercellSpacingWidth">2</double> + <double key="NSIntercellSpacingHeight">3</double> <reference key="NSBackgroundColor" ref="657409763"/> <object class="NSColor" key="NSGridColor" id="953355163"> <int key="NSColorSpace">6</int> @@ -148,12 +153,15 @@ <bytes key="NSWhite">MC41AA</bytes> </object> </object> - <double key="NSRowHeight">1.400000e+01</double> + <double key="NSRowHeight">14</double> <int key="NSTvFlags">-633339904</int> + <reference key="NSDelegate"/> + <reference key="NSDataSource"/> <int key="NSColumnAutoresizingStyle">4</int> <int key="NSDraggingSourceMaskForLocal">15</int> <int key="NSDraggingSourceMaskForNonLocal">0</int> <bool key="NSAllowsTypeSelect">YES</bool> + <int key="NSTableViewDraggingDestinationStyle">0</int> </object> </object> <string key="NSFrame">{{1, 1}, {457, 274}}</string> @@ -171,7 +179,7 @@ <int key="NSsFlags">256</int> <reference key="NSTarget" ref="1002552068"/> <string key="NSAction">_doScroller:</string> - <double key="NSPercent">9.411765e-01</double> + <double key="NSPercent">0.94117649999999997</double> </object> <object class="NSScroller" id="33257460"> <reference key="NSNextResponder" ref="1002552068"/> @@ -181,7 +189,7 @@ <int key="NSsFlags">513</int> <reference key="NSTarget" ref="1002552068"/> <string key="NSAction">_doScroller:</string> - <double key="NSPercent">9.759300e-01</double> + <double key="NSPercent">0.97592999999999996</double> </object> </object> <string key="NSFrame">{{20, 40}, {459, 276}}</string> @@ -205,7 +213,7 @@ <string key="NSContents">^IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL</string> <object class="NSFont" key="NSSupport" id="743256162"> <string key="NSName">LucidaGrande</string> - <double key="NSSize">1.300000e+01</double> + <double key="NSSize">13</double> <int key="NSfFlags">1044</int> </object> <reference key="NSControlView" ref="91932637"/> @@ -265,8 +273,8 @@ <reference key="NSSuperview" ref="552178720"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="156287056"> - <int key="NSCellFlags">68288064</int> - <int key="NSCellFlags2">272630784</int> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">272629760</int> <string key="NSContents">^IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL</string> <reference key="NSSupport" ref="743256162"/> <reference key="NSControlView" ref="477810653"/> @@ -298,9 +306,9 @@ <object class="NSMutableArray" key="NSTableColumns"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSTableColumn" id="969301028"> - <double key="NSWidth">4.550000e+02</double> - <double key="NSMinWidth">1.600000e+01</double> - <double key="NSMaxWidth">1.000000e+03</double> + <double key="NSWidth">455</double> + <double key="NSMinWidth">16</double> + <double key="NSMaxWidth">1000</double> <object class="NSTableHeaderCell" key="NSHeaderCell"> <int key="NSCellFlags">75628096</int> <int key="NSCellFlags2">2048</int> @@ -326,16 +334,19 @@ <reference key="NSTableView" ref="865839264"/> </object> </object> - <double key="NSIntercellSpacingWidth">2.000000e+00</double> - <double key="NSIntercellSpacingHeight">3.000000e+00</double> + <double key="NSIntercellSpacingWidth">2</double> + <double key="NSIntercellSpacingHeight">3</double> <reference key="NSBackgroundColor" ref="657409763"/> <reference key="NSGridColor" ref="953355163"/> - <double key="NSRowHeight">1.400000e+01</double> + <double key="NSRowHeight">14</double> <int key="NSTvFlags">-633339904</int> + <reference key="NSDelegate"/> + <reference key="NSDataSource"/> <int key="NSColumnAutoresizingStyle">4</int> <int key="NSDraggingSourceMaskForLocal">15</int> <int key="NSDraggingSourceMaskForNonLocal">0</int> <bool key="NSAllowsTypeSelect">YES</bool> + <int key="NSTableViewDraggingDestinationStyle">0</int> </object> </object> <string key="NSFrame">{{1, 1}, {457, 285}}</string> @@ -353,8 +364,8 @@ <int key="NSsFlags">256</int> <reference key="NSTarget" ref="979906343"/> <string key="NSAction">_doScroller:</string> - <double key="NSCurValue">3.797468e-02</double> - <double key="NSPercent">1.000000e+00</double> + <double key="NSCurValue">0.037974679999999997</double> + <double key="NSPercent">1</double> </object> <object class="NSScroller" id="634021446"> <reference key="NSNextResponder" ref="979906343"/> @@ -364,7 +375,7 @@ <int key="NSsFlags">513</int> <reference key="NSTarget" ref="979906343"/> <string key="NSAction">_doScroller:</string> - <double key="NSPercent">1.000000e+00</double> + <double key="NSPercent">1</double> </object> </object> <string key="NSFrame">{{20, 49}, {459, 287}}</string> @@ -472,7 +483,61 @@ </object> <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string> <string key="NSMinSize">{499, 535}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> + </object> + <object class="NSCustomView" id="618086819"> + <reference key="NSNextResponder"/> + <int key="NSvFlags">266</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSImageView" id="392217213"> + <reference key="NSNextResponder" ref="618086819"/> + <int key="NSvFlags">256</int> + <object class="NSMutableSet" key="NSDragTypes"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="set.sortedObjects"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>Apple PDF pasteboard type</string> + <string>Apple PICT pasteboard type</string> + <string>Apple PNG pasteboard type</string> + <string>NSFilenamesPboardType</string> + <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string> + <string>NeXT TIFF v4.0 pasteboard type</string> + </object> + </object> + <string key="NSFrameSize">{27, 27}</string> + <reference key="NSSuperview" ref="618086819"/> + <bool key="NSEnabled">YES</bool> + <object class="NSImageCell" key="NSCell" id="587433526"> + <int key="NSCellFlags">130560</int> + <int key="NSCellFlags2">33554432</int> + <int key="NSAlign">0</int> + <int key="NSScale">0</int> + <int key="NSStyle">0</int> + <bool key="NSAnimates">NO</bool> + </object> + <bool key="NSEditable">YES</bool> + </object> + <object class="NSTextField" id="540234737"> + <reference key="NSNextResponder" ref="618086819"/> + <int key="NSvFlags">258</int> + <string key="NSFrame">{{32, 5}, {511, 17}}</string> + <reference key="NSSuperview" ref="618086819"/> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="522519425"> + <int key="NSCellFlags">67239488</int> + <int key="NSCellFlags2">272631808</int> + <string key="NSContents"/> + <reference key="NSSupport" ref="743256162"/> + <reference key="NSControlView" ref="540234737"/> + <reference key="NSBackgroundColor" ref="466057361"/> + <reference key="NSTextColor" ref="593135112"/> + </object> + </object> + </object> + <string key="NSFrameSize">{499, 27}</string> + <reference key="NSSuperview"/> + <string key="NSClassName">VerticalGradientView</string> </object> <object class="NSTreeController" id="317796902"> <object class="NSMutableArray" key="NSDeclaredKeys"> @@ -762,34 +827,80 @@ </object> <int key="connectionID">404</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">infoBar_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="618086819"/> + </object> + <int key="connectionID">410</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">infoBarIcon_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="392217213"/> + </object> + <int key="connectionID">413</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">infoBarText_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="540234737"/> + </object> + <int key="connectionID">414</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">lowerScrollView_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="979906343"/> + </object> + <int key="connectionID">417</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">splitView_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="1042467467"/> + </object> + <int key="connectionID">418</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">blockedCookiesText_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="477810653"/> + </object> + <int key="connectionID">419</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBObjectRecord"> <int key="objectID">0</int> - <object class="NSArray" key="object" id="901467297"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> + <reference key="object" ref="0"/> <reference key="children" ref="1000"/> <nil key="parent"/> </object> <object class="IBObjectRecord"> <int key="objectID">-2</int> <reference key="object" ref="1001"/> - <reference key="parent" ref="901467297"/> - <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string> + <reference key="parent" ref="0"/> + <string key="objectName">File's Owner</string> </object> <object class="IBObjectRecord"> <int key="objectID">-1</int> <reference key="object" ref="1003"/> - <reference key="parent" ref="901467297"/> + <reference key="parent" ref="0"/> <string key="objectName">First Responder</string> </object> <object class="IBObjectRecord"> <int key="objectID">-3</int> <reference key="object" ref="1004"/> - <reference key="parent" ref="901467297"/> + <reference key="parent" ref="0"/> <string key="objectName">Application</string> </object> <object class="IBObjectRecord"> @@ -799,7 +910,7 @@ <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="1006"/> </object> - <reference key="parent" ref="901467297"/> + <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">2</int> @@ -814,7 +925,7 @@ <object class="IBObjectRecord"> <int key="objectID">51</int> <reference key="object" ref="317796902"/> - <reference key="parent" ref="901467297"/> + <reference key="parent" ref="0"/> <string key="objectName">Allowed Tree Controller</string> </object> <object class="IBObjectRecord"> @@ -843,17 +954,17 @@ <object class="IBObjectRecord"> <int key="objectID">136</int> <reference key="object" ref="524486310"/> - <reference key="parent" ref="901467297"/> + <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">137</int> <reference key="object" ref="505547508"/> - <reference key="parent" ref="901467297"/> + <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">357</int> <reference key="object" ref="502850313"/> - <reference key="parent" ref="901467297"/> + <reference key="parent" ref="0"/> <string key="objectName">Blocked Tree Controller</string> </object> <object class="IBObjectRecord"> @@ -872,8 +983,8 @@ <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="458745968"/> - <reference ref="1002552068"/> <reference ref="91932637"/> + <reference ref="1002552068"/> </object> <reference key="parent" ref="1042467467"/> </object> @@ -1065,11 +1176,50 @@ <reference key="object" ref="444577418"/> <reference key="parent" ref="737287713"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">405</int> + <reference key="object" ref="618086819"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="540234737"/> + <reference ref="392217213"/> + </object> + <reference key="parent" ref="0"/> + <string key="objectName">Infobar</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">406</int> + <reference key="object" ref="540234737"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="522519425"/> + </object> + <reference key="parent" ref="618086819"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">407</int> + <reference key="object" ref="392217213"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="587433526"/> + </object> + <reference key="parent" ref="618086819"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">408</int> + <reference key="object" ref="587433526"/> + <reference key="parent" ref="392217213"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">409</int> + <reference key="object" ref="522519425"/> + <reference key="parent" ref="540234737"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>-1.IBPluginDependency</string> <string>-2.IBPluginDependency</string> @@ -1110,6 +1260,12 @@ <string>389.IBPluginDependency</string> <string>390.IBPluginDependency</string> <string>4.IBPluginDependency</string> + <string>405.IBEditorWindowLastContentRect</string> + <string>405.IBPluginDependency</string> + <string>406.IBPluginDependency</string> + <string>407.IBPluginDependency</string> + <string>408.IBPluginDependency</string> + <string>409.IBPluginDependency</string> <string>5.IBPluginDependency</string> <string>51.IBPluginDependency</string> <string>6.IBPluginDependency</string> @@ -1121,11 +1277,11 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{595, 136}, {499, 720}}</string> + <string>{{594, 136}, {499, 720}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <boolean value="NO" id="6"/> - <string>{{595, 136}, {499, 720}}</string> - <reference ref="6"/> + <boolean value="NO"/> + <string>{{594, 136}, {499, 720}}</string> + <boolean value="NO"/> <string>{196, 240}</string> <string>{{357, 418}, {480, 270}}</string> <boolean value="YES"/> @@ -1141,7 +1297,7 @@ <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBUserGuide"> <reference key="view" ref="1006"/> - <float key="location">1.500000e+01</float> + <double key="location">15</double> <int key="affinity">1</int> </object> </object> @@ -1164,6 +1320,12 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>{{547, 986}, {499, 27}}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -1173,9 +1335,7 @@ </object> <object class="NSMutableDictionary" key="unlocalizedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> + <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> @@ -1183,15 +1343,13 @@ <nil key="activeLocalization"/> <object class="NSMutableDictionary" key="localizations"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> + <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <nil key="sourceID"/> - <int key="maxID">404</int> + <int key="maxID">419</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -1209,7 +1367,7 @@ <string key="superclassName">NSWindowController</string> <object class="NSMutableDictionary" key="actions"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>allowForSessionFromOrigin:</string> <string>allowOrigin:</string> @@ -1226,19 +1384,31 @@ </object> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>allowedOutlineView_</string> <string>allowedTreeController_</string> + <string>blockedCookiesText_</string> <string>blockedOutlineView_</string> <string>blockedTreeController_</string> + <string>infoBarIcon_</string> + <string>infoBarText_</string> + <string>infoBar_</string> + <string>lowerScrollView_</string> + <string>splitView_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>NSOutlineView</string> <string>NSTreeController</string> + <string>NSTextField</string> <string>NSOutlineView</string> <string>NSTreeController</string> + <string>NSImageView</string> + <string>NSTextField</string> + <string>VerticalGradientView</string> + <string>NSScrollView</string> + <string>NSSplitView</string> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> @@ -1251,7 +1421,7 @@ <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>otherObjectToLocalize_</string> <string>owner_</string> @@ -1274,7 +1444,7 @@ <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>localizerOwner_</string> <string>localizer_</string> @@ -1297,7 +1467,7 @@ <string key="superclassName">NSView</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>viewToResize_</string> <string>viewToSlideAndResize_</string> @@ -1349,6 +1519,13 @@ </object> </object> <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/view_id_util.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> <string key="className">NSWindow</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> @@ -1362,9 +1539,786 @@ <string key="minorKey">browser/cocoa/themed_window.h</string> </object> </object> + <object class="IBPartialClassDescription"> + <string key="className">VerticalGradientView</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/vertical_gradient_view.h</string> + </object> + </object> + </object> + <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBPartialClassDescription"> + <string key="className">NSActionCell</string> + <string key="superclassName">NSCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <string key="superclassName">NSResponder</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="183338268"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="159780611"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="433661017"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSButton</string> + <string key="superclassName">NSControl</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSButton.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSButtonCell</string> + <string key="superclassName">NSActionCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSCell</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSControl</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="964889572"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSControl.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSController</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSFormatter</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSImageCell</string> + <string key="superclassName">NSCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSImageCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSImageView</string> + <string key="superclassName">NSControl</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSImageView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSMenu</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="266715582"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AddressBook.framework/Headers/ABActions.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSAlert.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSAnimation.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="183338268"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="159780611"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSBrowser.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="433661017"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSComboBox.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSComboBoxCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="964889572"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSDatePickerCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="683216508"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSImage.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="266715582"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="839282017"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSRuleEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSound.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSpeechRecognizer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSpeechSynthesizer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="418188125"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSplitView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTabView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="859849217"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSText.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTextStorage.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTextView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTokenField.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTokenFieldCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSToolbar.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="612437743"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="373551715"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSWindow.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSConnection.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSError.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSMetadata.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSObject.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSPort.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSSpellServer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSStream.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSURL.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Print.framework/Headers/PDEPluginInterface.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">SecurityInterface.framework/Headers/SFAuthorizationView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">SecurityInterface.framework/Headers/SFCertificatePanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">SecurityInterface.framework/Headers/SFChooseIdentityPanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObjectController</string> + <string key="superclassName">NSController</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSObjectController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSOutlineView</string> + <string key="superclassName">NSTableView</string> + <reference key="sourceIdentifier" ref="839282017"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSResponder</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSResponder</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSScrollView</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSScrollView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSScroller</string> + <string key="superclassName">NSControl</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSScroller.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSSplitView</string> + <string key="superclassName">NSView</string> + <reference key="sourceIdentifier" ref="418188125"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSTableColumn</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTableColumn.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSTableView</string> + <string key="superclassName">NSControl</string> + <reference key="sourceIdentifier" ref="859849217"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSTextField</string> + <string key="superclassName">NSControl</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSTextFieldCell</string> + <string key="superclassName">NSActionCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSTreeController</string> + <string key="superclassName">NSObjectController</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTreeController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <string key="superclassName">NSResponder</string> + <reference key="sourceIdentifier" ref="612437743"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <reference key="sourceIdentifier" ref="683216508"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <string key="superclassName">NSResponder</string> + <reference key="sourceIdentifier" ref="373551715"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindowController</string> + <string key="superclassName">NSResponder</string> + <object class="NSMutableDictionary" key="actions"> + <string key="NS.key.0">showWindow:</string> + <string key="NS.object.0">id</string> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string> + </object> + </object> </object> </object> <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> + <integer value="1050" key="NS.object.0"/> + </object> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> + <integer value="1050" key="NS.object.0"/> + </object> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> + <integer value="3000" key="NS.object.0"/> + </object> + <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <string key="IBDocument.LastKnownRelativeProjectPath">../../chrome.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> </data> diff --git a/chrome/browser/cocoa/collected_cookies_mac.h b/chrome/browser/cocoa/collected_cookies_mac.h index 7bd7a90..2392763 100644 --- a/chrome/browser/cocoa/collected_cookies_mac.h +++ b/chrome/browser/cocoa/collected_cookies_mac.h @@ -13,6 +13,7 @@ #include "chrome/common/notification_registrar.h" @class CollectedCookiesWindowController; +@class VerticalGradientView; class TabContents; // The constrained window delegate reponsible for managing the collected @@ -73,8 +74,18 @@ class CollectedCookiesMac : public ConstrainedWindowMacDelegateCustomSheet, IBOutlet NSTreeController* blockedTreeController_; IBOutlet NSOutlineView* allowedOutlineView_; IBOutlet NSOutlineView* blockedOutlineView_; + IBOutlet VerticalGradientView* infoBar_; + IBOutlet NSImageView* infoBarIcon_; + IBOutlet NSTextField* infoBarText_; + IBOutlet NSSplitView* splitView_; + IBOutlet NSScrollView* lowerScrollView_; + IBOutlet NSTextField* blockedCookiesText_; + + scoped_nsobject<NSViewAnimation> animation_; TabContents* tabContents_; // weak + + BOOL infoBarVisible_; } @property (readonly, nonatomic) NSTreeController* allowedTreeController; @property (readonly, nonatomic) NSTreeController* blockedTreeController; diff --git a/chrome/browser/cocoa/collected_cookies_mac.mm b/chrome/browser/cocoa/collected_cookies_mac.mm index 693c8e4..e01c62d 100644 --- a/chrome/browser/cocoa/collected_cookies_mac.mm +++ b/chrome/browser/cocoa/collected_cookies_mac.mm @@ -10,7 +10,7 @@ #include "app/resource_bundle.h" #import "base/mac_util.h" #include "base/sys_string_conversions.h" -#include "chrome/browser/cocoa/content_settings_dialog_controller.h" +#import "chrome/browser/cocoa/vertical_gradient_view.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/notification_service.h" @@ -19,8 +19,20 @@ #include "skia/ext/skia_utils_mac.h" #include "third_party/apple/ImageAndTextCell.h" #include "third_party/skia/include/core/SkBitmap.h" +#import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" +#import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" -static const CGFloat kMinCollectedCookiesViewHeight = 116; +namespace { +// Colors for the infobar. +const double kBannerGradientColorTop[3] = + {255.0 / 255.0, 242.0 / 255.0, 183.0 / 255.0}; +const double kBannerGradientColorBottom[3] = + {250.0 / 255.0, 230.0 / 255.0, 145.0 / 255.0}; +const double kBannerStrokeColor = 135.0 / 255.0; + +// Minimal height for the collected cookies dialog. +const CGFloat kMinCollectedCookiesViewHeight = 116; +} // namespace #pragma mark Bridge between the constrained window delegate and the sheet @@ -101,6 +113,13 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { #pragma mark Window Controller +@interface CollectedCookiesWindowController(Private) +-(void)showInfoBarForDomain:(const string16&)domain + setting:(ContentSetting)setting; +-(void)showInfoBarForMultipleDomainsAndSetting:(ContentSetting)setting; +-(void)animateInfoBar; +@end + @implementation CollectedCookiesWindowController @synthesize allowedCookiesButtonsEnabled = @@ -113,20 +132,78 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { - (id)initWithTabContents:(TabContents*)tabContents { DCHECK(tabContents); + infoBarVisible_ = NO; + tabContents_ = tabContents; + NSString* nibpath = [mac_util::MainAppBundle() pathForResource:@"CollectedCookies" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { - tabContents_ = tabContents; - [self loadTreeModelFromTabContents]; + + animation_.reset([[NSViewAnimation alloc] init]); + [animation_ setAnimationBlockingMode:NSAnimationNonblocking]; } return self; } +- (void)awakeFromNib { + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + NSImage* infoIcon = rb.GetNSImageNamed(IDR_INFO); + DCHECK(infoIcon); + [infoBarIcon_ setImage:infoIcon]; + + // Initialize the banner gradient and stroke color. + NSColor* bannerStartingColor = + [NSColor colorWithCalibratedRed:kBannerGradientColorTop[0] + green:kBannerGradientColorTop[1] + blue:kBannerGradientColorTop[2] + alpha:1.0]; + NSColor* bannerEndingColor = + [NSColor colorWithCalibratedRed:kBannerGradientColorBottom[0] + green:kBannerGradientColorBottom[1] + blue:kBannerGradientColorBottom[2] + alpha:1.0]; + scoped_nsobject<NSGradient> bannerGradient( + [[NSGradient alloc] initWithStartingColor:bannerStartingColor + endingColor:bannerEndingColor]); + [infoBar_ setGradient:bannerGradient]; + + NSColor* bannerStrokeColor = + [NSColor colorWithCalibratedWhite:kBannerStrokeColor + alpha:1.0]; + [infoBar_ setStrokeColor:bannerStrokeColor]; + + // Change the label of the blocked cookies part if necessary. + if (tabContents_->profile()->GetHostContentSettingsMap()-> + BlockThirdPartyCookies()) { + [blockedCookiesText_ setStringValue:l10n_util::GetNSString( + IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED)]; + CGFloat textDeltaY = [GTMUILocalizerAndLayoutTweaker + sizeToFitFixedWidthTextField:blockedCookiesText_]; + + // Shrink the upper custom view. + NSView* upperContentView = [[splitView_ subviews] objectAtIndex:0]; + NSRect frame = [upperContentView frame]; + [splitView_ setPosition:(frame.size.height - textDeltaY/2.0) + ofDividerAtIndex:0]; + + // Shrink the lower outline view. + frame = [lowerScrollView_ frame]; + frame.size.height -= textDeltaY; + [lowerScrollView_ setFrame:frame]; + + // Move the label down so it actually fits. + frame = [blockedCookiesText_ frame]; + frame.origin.y -= textDeltaY; + [blockedCookiesText_ setFrame:frame]; + } +} + - (void)windowWillClose:(NSNotification*)notif { [allowedOutlineView_ setDelegate:nil]; [blockedOutlineView_ setDelegate:nil]; + [animation_ stopAnimation]; [self autorelease]; } @@ -137,6 +214,8 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { - (void)addException:(ContentSetting)setting forTreeController:(NSTreeController*)controller { NSArray* nodes = [controller selectedNodes]; + BOOL multipleDomainsChanged = NO; + string16 lastDomain; for (NSTreeNode* treeNode in nodes) { CocoaCookieTreeNode* node = [treeNode representedObject]; CookieTreeNode* cookie = static_cast<CookieTreeNode*>([node treeNode]); @@ -149,11 +228,14 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { origin_node->CreateContentException( tabContents_->profile()->GetHostContentSettingsMap(), setting); + if (!lastDomain.empty()) + multipleDomainsChanged = YES; + lastDomain = origin_node->GetTitleAsString16(); } - [[ContentSettingsDialogController - showContentSettingsForType:CONTENT_SETTINGS_TYPE_COOKIES - profile:tabContents_->profile()] - showCookieExceptions:self]; + if (multipleDomainsChanged) + [self showInfoBarForMultipleDomainsAndSetting:setting]; + else + [self showInfoBarForDomain:lastDomain setting:setting]; } - (IBAction)allowOrigin:(id)sender { @@ -299,4 +381,119 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { [self setCocoaBlockedTreeModel:model.get()]; // Takes ownership. } +-(void)showInfoBarForMultipleDomainsAndSetting:(ContentSetting)setting { + NSString* label; + switch (setting) { + case CONTENT_SETTING_BLOCK: + label = l10n_util::GetNSString( + IDS_COLLECTED_COOKIES_MULTIPLE_BLOCK_RULES_CREATED); + break; + + case CONTENT_SETTING_ALLOW: + label = l10n_util::GetNSString( + IDS_COLLECTED_COOKIES_MULTIPLE_ALLOW_RULES_CREATED); + break; + + case CONTENT_SETTING_SESSION_ONLY: + label = l10n_util::GetNSString( + IDS_COLLECTED_COOKIES_MULTIPLE_SESSION_RULES_CREATED); + break; + + default: + NOTREACHED(); + label = [[[NSString alloc] init] autorelease]; + } + [infoBarText_ setStringValue:label]; + [self animateInfoBar]; +} + +-(void)showInfoBarForDomain:(const string16&)domain + setting:(ContentSetting)setting { + NSString* label; + switch (setting) { + case CONTENT_SETTING_BLOCK: + label = l10n_util::GetNSStringF( + IDS_COLLECTED_COOKIES_BLOCK_RULE_CREATED, + domain); + break; + + case CONTENT_SETTING_ALLOW: + label = l10n_util::GetNSStringF( + IDS_COLLECTED_COOKIES_ALLOW_RULE_CREATED, + domain); + break; + + case CONTENT_SETTING_SESSION_ONLY: + label = l10n_util::GetNSStringF( + IDS_COLLECTED_COOKIES_SESSION_RULE_CREATED, + domain); + break; + + default: + NOTREACHED(); + label = [[[NSString alloc] init] autorelease]; + } + [infoBarText_ setStringValue:label]; + [self animateInfoBar]; +} + +-(void)animateInfoBar { + if (infoBarVisible_) + return; + + infoBarVisible_ = YES; + + NSMutableArray* animations = [NSMutableArray arrayWithCapacity:3]; + + NSWindow* sheet = [self window]; + NSRect sheetFrame = [sheet frame]; + NSRect infoBarFrame = [infoBar_ frame]; + NSRect splitViewFrame = [splitView_ frame]; + + // Calculate the end position of the info bar and set it to its start + // position. + infoBarFrame.origin.y = NSHeight(sheetFrame); + infoBarFrame.size.width = NSWidth(sheetFrame); + NSRect infoBarStartFrame = infoBarFrame; + infoBarStartFrame.origin.y += NSHeight(infoBarFrame); + infoBarStartFrame.size.height = 0.0; + [infoBar_ setFrame:infoBarStartFrame]; + [[[self window] contentView] addSubview:infoBar_]; + + // Calculate the new position of the sheet. + sheetFrame.origin.y -= NSHeight(infoBarFrame); + sheetFrame.size.height += NSHeight(infoBarFrame); + + // Slide the infobar in. + [animations addObject: + [NSDictionary dictionaryWithObjectsAndKeys: + infoBar_, NSViewAnimationTargetKey, + [NSValue valueWithRect:infoBarFrame], + NSViewAnimationEndFrameKey, + [NSValue valueWithRect:infoBarStartFrame], + NSViewAnimationStartFrameKey, + nil]]; + // Make sure the split view ends up in the right position. + [animations addObject: + [NSDictionary dictionaryWithObjectsAndKeys: + splitView_, NSViewAnimationTargetKey, + [NSValue valueWithRect:splitViewFrame], + NSViewAnimationEndFrameKey, + nil]]; + + // Grow the sheet. + [animations addObject: + [NSDictionary dictionaryWithObjectsAndKeys: + sheet, NSViewAnimationTargetKey, + [NSValue valueWithRect:sheetFrame], + NSViewAnimationEndFrameKey, + nil]]; + [animation_ setViewAnimations:animations]; + // The default duration is 0.5s, which actually feels slow in here, so speed + // it up a bit. + [animation_ gtm_setDuration:0.2 + eventMask:NSLeftMouseUpMask]; + [animation_ startAnimation]; +} + @end diff --git a/chrome/browser/gtk/collected_cookies_gtk.cc b/chrome/browser/gtk/collected_cookies_gtk.cc index 2992120..8d4dbf7 100644 --- a/chrome/browser/gtk/collected_cookies_gtk.cc +++ b/chrome/browser/gtk/collected_cookies_gtk.cc @@ -13,8 +13,56 @@ #include "grit/generated_resources.h" namespace { -// Height of the cookie tree view. +// Width and height of the cookie tree view. +const int kTreeViewWidth = 450; const int kTreeViewHeight = 150; + +// Padding within the banner box. +const int kBannerPadding = 3; + +// Returns the text to display in the info bar when content settings were +// created. +const std::string GetInfobarLabel(ContentSetting setting, + bool multiple_domains_added, + const string16& domain_name) { + if (multiple_domains_added) { + switch (setting) { + case CONTENT_SETTING_BLOCK: + return l10n_util::GetStringUTF8( + IDS_COLLECTED_COOKIES_MULTIPLE_BLOCK_RULES_CREATED); + + case CONTENT_SETTING_ALLOW: + return l10n_util::GetStringUTF8( + IDS_COLLECTED_COOKIES_MULTIPLE_ALLOW_RULES_CREATED); + + case CONTENT_SETTING_SESSION_ONLY: + return l10n_util::GetStringUTF8( + IDS_COLLECTED_COOKIES_MULTIPLE_SESSION_RULES_CREATED); + + default: + NOTREACHED(); + return std::string(); + } + } + + switch (setting) { + case CONTENT_SETTING_BLOCK: + return l10n_util::GetStringFUTF8( + IDS_COLLECTED_COOKIES_BLOCK_RULE_CREATED, domain_name); + + case CONTENT_SETTING_ALLOW: + return l10n_util::GetStringFUTF8( + IDS_COLLECTED_COOKIES_ALLOW_RULE_CREATED, domain_name); + + case CONTENT_SETTING_SESSION_ONLY: + return l10n_util::GetStringFUTF8( + IDS_COLLECTED_COOKIES_SESSION_RULE_CREATED, domain_name); + + default: + NOTREACHED(); + return std::string(); + } +} } // namespace CollectedCookiesGtk::CollectedCookiesGtk(GtkWindow* parent, @@ -29,6 +77,9 @@ CollectedCookiesGtk::CollectedCookiesGtk(GtkWindow* parent, } void CollectedCookiesGtk::Init() { + HostContentSettingsMap* host_content_settings_map = + tab_contents_->profile()->GetHostContentSettingsMap(); + dialog_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); gtk_box_set_spacing(GTK_BOX(dialog_), gtk_util::kContentAreaSpacing); @@ -63,7 +114,7 @@ void CollectedCookiesGtk::Init() { new gtk_tree::TreeAdapter(this, allowed_cookies_tree_model_.get())); allowed_tree_ = gtk_tree_view_new_with_model( GTK_TREE_MODEL(allowed_cookies_tree_adapter_->tree_store())); - gtk_widget_set_size_request(allowed_tree_, -1, kTreeViewHeight); + gtk_widget_set_size_request(allowed_tree_, kTreeViewWidth, kTreeViewHeight); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(allowed_tree_), FALSE); gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(allowed_tree_), TRUE); gtk_container_add(GTK_CONTAINER(scroll_window), allowed_tree_); @@ -99,15 +150,22 @@ void CollectedCookiesGtk::Init() { G_CALLBACK(OnBlockAllowedButtonClickedThunk), this); gtk_container_add(GTK_CONTAINER(button_box), block_allowed_cookie_button_); + GtkWidget* separator = gtk_hseparator_new(); + gtk_box_pack_start(GTK_BOX(dialog_), separator, TRUE, TRUE, 0); + // Blocked Cookie list. cookie_list_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); gtk_box_pack_start(GTK_BOX(dialog_), cookie_list_vbox, TRUE, TRUE, 0); label = gtk_label_new( - l10n_util::GetStringUTF8(IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL). - c_str()); + l10n_util::GetStringUTF8( + host_content_settings_map->BlockThirdPartyCookies() ? + IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED : + IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL).c_str()); + gtk_widget_set_size_request(label, kTreeViewWidth, -1); + gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_box_pack_start(GTK_BOX(cookie_list_vbox), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(cookie_list_vbox), label, TRUE, TRUE, 0); scroll_window = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), @@ -123,7 +181,7 @@ void CollectedCookiesGtk::Init() { new gtk_tree::TreeAdapter(this, blocked_cookies_tree_model_.get())); blocked_tree_ = gtk_tree_view_new_with_model( GTK_TREE_MODEL(blocked_cookies_tree_adapter_->tree_store())); - gtk_widget_set_size_request(blocked_tree_, -1, kTreeViewHeight); + gtk_widget_set_size_request(blocked_tree_, kTreeViewWidth, kTreeViewHeight); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(blocked_tree_), FALSE); gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(blocked_tree_), TRUE); gtk_container_add(GTK_CONTAINER(scroll_window), blocked_tree_); @@ -166,6 +224,24 @@ void CollectedCookiesGtk::Init() { gtk_container_add(GTK_CONTAINER(button_box), for_session_blocked_cookie_button_); + // Infobar. + infobar_ = gtk_frame_new(NULL); + GtkWidget* infobar_contents = gtk_hbox_new(FALSE, kBannerPadding); + gtk_container_set_border_width(GTK_CONTAINER(infobar_contents), + kBannerPadding); + gtk_container_add(GTK_CONTAINER(infobar_), infobar_contents); + GtkWidget* info_image = + gtk_image_new_from_stock(GTK_STOCK_DIALOG_INFO, + GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_box_pack_start(GTK_BOX(infobar_contents), info_image, FALSE, FALSE, 0); + infobar_label_ = gtk_label_new(NULL); + gtk_box_pack_start( + GTK_BOX(infobar_contents), infobar_label_, FALSE, FALSE, 0); + gtk_widget_show_all(infobar_); + gtk_widget_set_no_show_all(infobar_, TRUE); + gtk_widget_hide(infobar_); + gtk_box_pack_start(GTK_BOX(dialog_), infobar_, TRUE, TRUE, 0); + // Close button. button_box = gtk_hbutton_box_new(); gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_END); @@ -259,6 +335,8 @@ void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection, GtkTreeModel* model; GList* paths = gtk_tree_selection_get_selected_rows(selection, &model); + string16 last_domain_name; + bool multiple_domains_added = false; for (GList* item = paths; item; item = item->next) { GtkTreeIter iter; gtk_tree_model_get_iter( @@ -266,12 +344,23 @@ void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection, CookieTreeOriginNode* node = static_cast<CookieTreeOriginNode*>( adapter->GetNode(&iter)); if (node->CanCreateContentException()) { + if (!last_domain_name.empty()) + multiple_domains_added = true; + last_domain_name = node->GetTitleAsString16(); node->CreateContentException( tab_contents_->profile()->GetHostContentSettingsMap(), setting); } } g_list_foreach(paths, reinterpret_cast<GFunc>(gtk_tree_path_free), NULL); g_list_free(paths); + if (last_domain_name.empty()) { + gtk_widget_hide(infobar_); + } else { + gtk_label_set_text( + GTK_LABEL(infobar_label_), GetInfobarLabel( + setting, multiple_domains_added, last_domain_name).c_str()); + gtk_widget_show(infobar_); + } } void CollectedCookiesGtk::OnBlockAllowedButtonClicked(GtkWidget* button) { diff --git a/chrome/browser/gtk/collected_cookies_gtk.h b/chrome/browser/gtk/collected_cookies_gtk.h index a68d963..be983c3 100644 --- a/chrome/browser/gtk/collected_cookies_gtk.h +++ b/chrome/browser/gtk/collected_cookies_gtk.h @@ -89,6 +89,10 @@ class CollectedCookiesGtk : public ConstrainedDialogDelegate, GtkTreeSelection* allowed_selection_; GtkTreeSelection* blocked_selection_; + // The infobar widget. + GtkWidget* infobar_; + GtkWidget* infobar_label_; + // The tab contents. TabContents* tab_contents_; diff --git a/chrome/browser/gtk/gtk_tree.h b/chrome/browser/gtk/gtk_tree.h index a302bba..61475ac 100644 --- a/chrome/browser/gtk/gtk_tree.h +++ b/chrome/browser/gtk/gtk_tree.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -160,6 +160,8 @@ class TreeAdapter : public TreeModelObserver { GtkTreeStore* tree_store_; TreeModel* tree_model_; std::vector<GdkPixbuf*> pixbufs_; + + DISALLOW_COPY_AND_ASSIGN(TreeAdapter); }; } // namespace gtk_tree diff --git a/chrome/browser/host_content_settings_map.cc b/chrome/browser/host_content_settings_map.cc index 0e10e25..8dc11bd 100644 --- a/chrome/browser/host_content_settings_map.cc +++ b/chrome/browser/host_content_settings_map.cc @@ -340,6 +340,8 @@ ContentSettings HostContentSettingsMap::GetContentSettings( const GURL& url) const { ContentSettings output = GetNonDefaultContentSettings(url); + AutoLock auto_lock(lock_); + // Make the remaining defaults explicit. for (int j = 0; j < CONTENT_SETTINGS_NUM_TYPES; ++j) if (output.settings[j] == CONTENT_SETTING_DEFAULT || diff --git a/chrome/browser/views/collected_cookies_win.cc b/chrome/browser/views/collected_cookies_win.cc index 1a7f405..3f25992 100644 --- a/chrome/browser/views/collected_cookies_win.cc +++ b/chrome/browser/views/collected_cookies_win.cc @@ -5,15 +5,23 @@ #include "chrome/browser/views/collected_cookies_win.h" #include "app/l10n_util.h" +#include "app/resource_bundle.h" #include "chrome/browser/cookies_tree_model.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/notification_service.h" +#include "gfx/color_utils.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" -#include "views/controls/label.h" +#include "grit/theme_resources.h" +#include "views/box_layout.h" #include "views/controls/button/native_button.h" +#include "views/controls/image_view.h" +#include "views/controls/label.h" +#include "views/controls/separator.h" #include "views/standard_layout.h" +#include "views/widget/root_view.h" +#include "views/widget/widget_win.h" #include "views/window/window.h" namespace browser { @@ -27,6 +35,119 @@ void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, } // namespace browser +namespace { +// Spacing between the infobar frame and its contents. +const int kInfobarVerticalPadding = 3; +const int kInfobarHorizontalPadding = 8; + +// Width of the infobar frame. +const int kInfobarBorderSize = 1; + +// Dimensions of the tree views. +const int kTreeViewWidth = 400; +const int kTreeViewHeight = 125; + +} // namespace + +// A custom view that conditionally displays an infobar. +class InfobarView : public views::View { + public: + InfobarView() { + content_ = new views::View; + SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW); + views::Border* border = views::Border::CreateSolidBorder( + kInfobarBorderSize, border_color); + content_->set_border(border); + + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + info_image_ = new views::ImageView(); + info_image_->SetImage(rb.GetBitmapNamed(IDR_INFO)); + label_ = new views::Label(); + } + virtual ~InfobarView() {} + + // Update the visibility of the infobar. If |is_visible| is true, a rule for + // |setting| on |domain_name| was created. + void UpdateVisibility(bool is_visible, + ContentSetting setting, + const std::wstring& domain_name) { + if (!is_visible) { + SetVisible(false); + return; + } + + std::wstring label; + switch (setting) { + case CONTENT_SETTING_BLOCK: + label = l10n_util::GetStringF( + IDS_COLLECTED_COOKIES_BLOCK_RULE_CREATED, domain_name); + break; + + case CONTENT_SETTING_ALLOW: + label = l10n_util::GetStringF( + IDS_COLLECTED_COOKIES_ALLOW_RULE_CREATED, domain_name); + break; + + case CONTENT_SETTING_SESSION_ONLY: + label = l10n_util::GetStringF( + IDS_COLLECTED_COOKIES_SESSION_RULE_CREATED, domain_name); + break; + + default: + NOTREACHED(); + } + label_->SetText(label); + content_->Layout(); + SetVisible(true); + } + + private: + // Initialize contents and layout. + void Init() { + AddChildView(content_); + content_->SetLayoutManager( + new views::BoxLayout(views::BoxLayout::kHorizontal, + kInfobarHorizontalPadding, + kInfobarVerticalPadding, + kRelatedControlSmallHorizontalSpacing)); + content_->AddChildView(info_image_); + content_->AddChildView(label_); + UpdateVisibility(false, CONTENT_SETTING_BLOCK, std::wstring()); + } + + // views::View overrides. + virtual gfx::Size GetPreferredSize() { + if (!IsVisible()) + return gfx::Size(); + + // Add space around the banner. + gfx::Size size(content_->GetPreferredSize()); + size.Enlarge(0, 2 * kRelatedControlVerticalSpacing); + return size; + } + + virtual void Layout() { + content_->SetBounds( + 0, kRelatedControlVerticalSpacing, + width(), height() - kRelatedControlVerticalSpacing); + } + + virtual void ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child) { + if (is_add && child == this) + Init(); + } + + // Holds the info icon image and text label and renders the border. + views::View* content_; + // Info icon image. + views::ImageView* info_image_; + // The label responsible for rendering the text. + views::Label* label_; + + DISALLOW_COPY_AND_ASSIGN(InfobarView); +}; /////////////////////////////////////////////////////////////////////////////// // CollectedCookiesWin, constructor and destructor: @@ -40,7 +161,8 @@ CollectedCookiesWin::CollectedCookiesWin(gfx::NativeWindow parent_window, blocked_cookies_tree_(NULL), block_allowed_button_(NULL), allow_blocked_button_(NULL), - for_session_blocked_button_(NULL) { + for_session_blocked_button_(NULL), + infobar_(NULL) { TabSpecificContentSettings* content_settings = tab_contents->GetTabSpecificContentSettings(); registrar_.Add(this, NotificationType::COLLECTED_COOKIES_SHOWN, @@ -59,6 +181,8 @@ CollectedCookiesWin::~CollectedCookiesWin() { void CollectedCookiesWin::Init() { TabSpecificContentSettings* content_settings = tab_contents_->GetTabSpecificContentSettings(); + HostContentSettingsMap* host_content_settings_map = + tab_contents_->profile()->GetHostContentSettingsMap(); // Allowed Cookie list. allowed_label_ = new views::Label( @@ -75,7 +199,12 @@ void CollectedCookiesWin::Init() { // Blocked Cookie list. blocked_label_ = new views::Label( - l10n_util::GetString(IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL)); + l10n_util::GetString( + host_content_settings_map->BlockThirdPartyCookies() ? + IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED : + IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL)); + blocked_label_->SetMultiLine(true); + blocked_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); blocked_cookies_tree_model_.reset( content_settings->GetBlockedCookiesTreeModel()); blocked_cookies_tree_ = new views::TreeView(); @@ -110,7 +239,8 @@ void CollectedCookiesWin::Init() { layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(1, single_column_layout_id); layout->AddView( - allowed_cookies_tree_, 1, 1, GridLayout::FILL, GridLayout::FILL); + allowed_cookies_tree_, 1, 1, GridLayout::FILL, GridLayout::FILL, + kTreeViewWidth, kTreeViewHeight); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, single_column_layout_id); @@ -121,12 +251,18 @@ void CollectedCookiesWin::Init() { layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); layout->StartRow(0, single_column_layout_id); - layout->AddView(blocked_label_); + layout->AddView( + new views::Separator(), 1, 1, GridLayout::FILL, GridLayout::FILL); + layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); + + layout->StartRow(0, single_column_layout_id); + layout->AddView(blocked_label_, 1, 1, GridLayout::FILL, GridLayout::FILL); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(1, single_column_layout_id); layout->AddView( - blocked_cookies_tree_, 1, 1, GridLayout::FILL, GridLayout::FILL); + blocked_cookies_tree_, 1, 1, GridLayout::FILL, GridLayout::FILL, + kTreeViewWidth, kTreeViewHeight); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, three_columns_layout_id); @@ -137,6 +273,10 @@ void CollectedCookiesWin::Init() { this, l10n_util::GetString(IDS_COLLECTED_COOKIES_SESSION_ONLY_BUTTON)); layout->AddView(for_session_blocked_button_); + layout->StartRow(0, single_column_layout_id); + infobar_ = new InfobarView(); + layout->AddView(infobar_, 1, 1, GridLayout::FILL, GridLayout::FILL); + EnableControls(); } @@ -190,15 +330,6 @@ void CollectedCookiesWin::OnTreeViewSelectionChanged( } /////////////////////////////////////////////////////////////////////////////// -// views::View implementation. - -gfx::Size CollectedCookiesWin::GetPreferredSize() { - return gfx::Size(views::Window::GetLocalizedContentsSize( - IDS_COOKIES_DIALOG_WIDTH_CHARS, - IDS_COOKIES_DIALOG_HEIGHT_LINES)); -} - -/////////////////////////////////////////////////////////////////////////////// // CollectedCookiesWin, private methods. void CollectedCookiesWin::EnableControls() { @@ -234,6 +365,17 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view, static_cast<CookieTreeOriginNode*>(tree_view->GetSelectedNode()); origin_node->CreateContentException( tab_contents_->profile()->GetHostContentSettingsMap(), setting); + infobar_->UpdateVisibility(true, setting, origin_node->GetTitle()); + gfx::Rect bounds; + GetWidget()->GetBounds(&bounds, false); + // WidgetWin::GetBounds returns the bounds relative to the parent window, + // while WidgetWin::SetBounds wants screen coordinates. Do the translation + // here until http://crbug.com/52851 is fixed. + POINT topleft = {bounds.x(), bounds.y()}; + MapWindowPoints(HWND_DESKTOP, tab_contents_->GetNativeView(), &topleft, 1); + gfx::Size size = GetRootView()->GetPreferredSize(); + bounds.SetRect(topleft.x, topleft.y, size.width(), size.height()); + GetWidget()->SetBounds(bounds); } /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/views/collected_cookies_win.h b/chrome/browser/views/collected_cookies_win.h index 93449bf..d9f3c16 100644 --- a/chrome/browser/views/collected_cookies_win.h +++ b/chrome/browser/views/collected_cookies_win.h @@ -17,6 +17,7 @@ class ConstrainedWindow; class CookiesTreeModel; +class InfobarView; class TabContents; namespace views { class Label; @@ -52,9 +53,6 @@ class CollectedCookiesWin : public ConstrainedDialogDelegate, // views::TreeViewController implementation. virtual void OnTreeViewSelectionChanged(views::TreeView* tree_view); - // views::View implementation. - virtual gfx::Size GetPreferredSize(); - private: virtual ~CollectedCookiesWin(); @@ -90,6 +88,8 @@ class CollectedCookiesWin : public ConstrainedDialogDelegate, scoped_ptr<CookiesTreeModel> allowed_cookies_tree_model_; scoped_ptr<CookiesTreeModel> blocked_cookies_tree_model_; + InfobarView* infobar_; + DISALLOW_COPY_AND_ASSIGN(CollectedCookiesWin); }; diff --git a/chrome/browser/views/options/managed_prefs_banner_view.cc b/chrome/browser/views/options/managed_prefs_banner_view.cc index 09febc4..b3fc5f2 100644 --- a/chrome/browser/views/options/managed_prefs_banner_view.cc +++ b/chrome/browser/views/options/managed_prefs_banner_view.cc @@ -38,6 +38,7 @@ void ManagedPrefsBannerView::Init() { content_->SetLayoutManager( new views::BoxLayout(views::BoxLayout::kHorizontal, kPrefsBannerPadding, + kPrefsBannerPadding, kRelatedControlSmallHorizontalSpacing)); content_->AddChildView(warning_image_); content_->AddChildView(label_); diff --git a/views/box_layout.cc b/views/box_layout.cc index 84fb096..adb192f 100644 --- a/views/box_layout.cc +++ b/views/box_layout.cc @@ -7,17 +7,20 @@ namespace views { BoxLayout::BoxLayout(BoxLayout::Orientation orientation, - int inside_border_spacing, + int inside_border_horizontal_spacing, + int inside_border_vertical_spacing, int between_child_spacing) : orientation_(orientation), - inside_border_spacing_(inside_border_spacing), + inside_border_horizontal_spacing_(inside_border_horizontal_spacing), + inside_border_vertical_spacing_(inside_border_vertical_spacing), between_child_spacing_(between_child_spacing) { } void BoxLayout::Layout(View* host) { gfx::Rect childArea(gfx::Rect(host->size())); childArea.Inset(host->GetInsets()); - childArea.Inset(inside_border_spacing_, inside_border_spacing_); + childArea.Inset(inside_border_horizontal_spacing_, + inside_border_vertical_spacing_); int x = childArea.x(); int y = childArea.y(); for (int i = 0; i < host->GetChildViewCount(); ++i) { @@ -58,9 +61,9 @@ gfx::Size BoxLayout::GetPreferredSize(View* host) { } } gfx::Insets insets(host->GetInsets()); - return - gfx::Size(bounds.width() + insets.width() + 2 * inside_border_spacing_, - bounds.height() + insets.height() + 2 * inside_border_spacing_); + return gfx::Size( + bounds.width() + insets.width() + 2 * inside_border_horizontal_spacing_, + bounds.height() + insets.height() + 2 * inside_border_vertical_spacing_); } } // namespace views diff --git a/views/box_layout.h b/views/box_layout.h index ffce6f8..2e86d9b 100644 --- a/views/box_layout.h +++ b/views/box_layout.h @@ -23,11 +23,13 @@ class BoxLayout : public LayoutManager { kVertical, }; - // Use |inside_border_spacing| to add additional space between the child view - // area and the host view border. |between_child_spacing| controls the space - // in between child views. + // Use |inside_border_horizontal_spacing| and + // |inside_border_vertical_spacing| to add additional space between the child + // view area and the host view border. |between_child_spacing| controls the + // space in between child views. BoxLayout(Orientation orientation, - int inside_border_spacing, + int inside_border_horizontal_spacing, + int inside_border_vertical_spacing, int between_child_spacing); virtual ~BoxLayout() {} @@ -39,7 +41,9 @@ class BoxLayout : public LayoutManager { const Orientation orientation_; // Spacing between child views and host view border. - const int inside_border_spacing_; + const int inside_border_horizontal_spacing_; + const int inside_border_vertical_spacing_; + // Spacing to put in between child views. const int between_child_spacing_; diff --git a/views/box_layout_unittest.cc b/views/box_layout_unittest.cc index 712b2ef..d16d782 100644 --- a/views/box_layout_unittest.cc +++ b/views/box_layout_unittest.cc @@ -30,12 +30,13 @@ class BoxLayoutTest : public testing::Test { }; TEST_F(BoxLayoutTest, Empty) { - layout_.reset(new views::BoxLayout(views::BoxLayout::kHorizontal, 10, 20)); + layout_.reset( + new views::BoxLayout(views::BoxLayout::kHorizontal, 10, 10, 20)); EXPECT_EQ(gfx::Size(20, 20), layout_->GetPreferredSize(host_.get())); } TEST_F(BoxLayoutTest, AlignmentHorizontal) { - layout_.reset(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0)); + layout_.reset(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); views::View* v1 = new StaticSizedView(gfx::Size(10, 20)); host_->AddChildView(v1); views::View* v2 = new StaticSizedView(gfx::Size(10, 10)); @@ -48,7 +49,7 @@ TEST_F(BoxLayoutTest, AlignmentHorizontal) { } TEST_F(BoxLayoutTest, AlignmentVertical) { - layout_.reset(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0)); + layout_.reset(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); views::View* v1 = new StaticSizedView(gfx::Size(20, 10)); host_->AddChildView(v1); views::View* v2 = new StaticSizedView(gfx::Size(10, 10)); @@ -61,7 +62,7 @@ TEST_F(BoxLayoutTest, AlignmentVertical) { } TEST_F(BoxLayoutTest, Spacing) { - layout_.reset(new views::BoxLayout(views::BoxLayout::kHorizontal, 7, 8)); + layout_.reset(new views::BoxLayout(views::BoxLayout::kHorizontal, 7, 7, 8)); views::View* v1 = new StaticSizedView(gfx::Size(10, 20)); host_->AddChildView(v1); views::View* v2 = new StaticSizedView(gfx::Size(10, 20)); @@ -74,7 +75,7 @@ TEST_F(BoxLayoutTest, Spacing) { } TEST_F(BoxLayoutTest, Overflow) { - layout_.reset(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0)); + layout_.reset(new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); views::View* v1 = new StaticSizedView(gfx::Size(20, 20)); host_->AddChildView(v1); views::View* v2 = new StaticSizedView(gfx::Size(10, 20)); @@ -86,7 +87,8 @@ TEST_F(BoxLayoutTest, Overflow) { } TEST_F(BoxLayoutTest, NoSpace) { - layout_.reset(new views::BoxLayout(views::BoxLayout::kHorizontal, 10, 10)); + layout_.reset( + new views::BoxLayout(views::BoxLayout::kHorizontal, 10, 10, 10)); views::View* childView = new StaticSizedView(gfx::Size(20, 20)); host_->AddChildView(childView); host_->SetBounds(0, 0, 10, 10); @@ -95,7 +97,8 @@ TEST_F(BoxLayoutTest, NoSpace) { } TEST_F(BoxLayoutTest, InvisibleChild) { - layout_.reset(new views::BoxLayout(views::BoxLayout::kHorizontal, 10, 10)); + layout_.reset( + new views::BoxLayout(views::BoxLayout::kHorizontal, 10, 10, 10)); views::View* v1 = new StaticSizedView(gfx::Size(20, 20)); v1->SetVisible(false); host_->AddChildView(v1); diff --git a/views/examples/widget_example.h b/views/examples/widget_example.h index ef6107a..8932847 100644 --- a/views/examples/widget_example.h +++ b/views/examples/widget_example.h @@ -61,7 +61,7 @@ class WidgetExample : public ExampleBase, public views::ButtonListener { virtual void CreateExampleView(views::View* container) { container->SetLayoutManager( - new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 2)); + new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 2)); BuildButton(container, L"Create a popup widget", POPUP); BuildButton(container, L"Create a transparent popup widget", TRANSPARENT_POPUP); @@ -69,7 +69,7 @@ class WidgetExample : public ExampleBase, public views::ButtonListener { views::View* vert_container = new views::View(); container->AddChildView(vert_container); vert_container->SetLayoutManager( - new views::BoxLayout(views::BoxLayout::kVertical, 0, 20)); + new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 20)); BuildButton(vert_container, L"Create a child widget", CHILD); BuildButton(vert_container, L"Create a transparent child widget", TRANSPARENT_CHILD); @@ -103,7 +103,7 @@ class WidgetExample : public ExampleBase, public views::ButtonListener { views::View* button_container = new views::View(); button_container->SetLayoutManager( - new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 1)); + new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 1)); button_container->AddChildView(close_button); button_container->AddChildView(native_button); |