diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 15:54:19 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 15:54:19 +0000 |
commit | facc6ada0300c8e9a67b0cf283257a2c70fa15c2 (patch) | |
tree | 7abfb80d70b15b344e2c246fc4d3bf13bc8f7d4e /chrome | |
parent | 0dad8074499c8a2784505f826505bd8862d618a1 (diff) | |
download | chromium_src-facc6ada0300c8e9a67b0cf283257a2c70fa15c2.zip chromium_src-facc6ada0300c8e9a67b0cf283257a2c70fa15c2.tar.gz chromium_src-facc6ada0300c8e9a67b0cf283257a2c70fa15c2.tar.bz2 |
Display a tab modal dialog of the allowed/blocked cookies.
BUG=45230
TEST=CollectedCookiesTest.*
Review URL: http://codereview.chromium.org/2907003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
35 files changed, 2149 insertions, 3 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index c802f74..36beb3b 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -2331,7 +2331,7 @@ each locale. --> Manage cookie blocking... </message> <message name="IDS_BLOCKED_COOKIES_INFO" desc="Info link to a dialog showing the blocked/allowed cookies, displayed in bubble when a page tries to write cookies or other site data."> - See cookies and other site data... + Show cookies and other site data... </message> <message name="IDS_BLOCKED_IMAGES_TITLE" desc="Tooltip and bubble info header text when a page is not allowed to display images."> Images were blocked on this page. @@ -6017,6 +6017,17 @@ Keep your key file in a safe place. You will need it to create new versions of y Use DNS pre-fetching to improve page load performance </message> + <!-- Collected cookies window --> + <message name="IDS_COLLECTED_COOKIES_DIALOG_TITLE" desc="The title of the collect cookies dialog"> + Cookies were set + </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: + </message> + <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> + <!-- Cookies Window --> <message name="IDS_COOKIES_WINDOW_TITLE" desc="The title of the Cookies Window"> Cookies diff --git a/chrome/app/nibs/CollectedCookies.xib b/chrome/app/nibs/CollectedCookies.xib new file mode 100644 index 0000000..d3eae41 --- /dev/null +++ b/chrome/app/nibs/CollectedCookies.xib @@ -0,0 +1,1114 @@ +<?xml version="1.0" encoding="UTF-8"?> +<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03"> + <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> + <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> + <bool key="EncodedWithXMLCoder">YES</bool> + <integer value="379"/> + </object> + <object class="NSArray" key="IBDocument.PluginDependencies"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + </object> + <object class="NSMutableDictionary" key="IBDocument.Metadata"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> + <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSCustomObject" id="1001"> + <string key="NSClassName">CollectedCookiesWindowController</string> + </object> + <object class="NSCustomObject" id="1003"> + <string key="NSClassName">FirstResponder</string> + </object> + <object class="NSCustomObject" id="1004"> + <string key="NSClassName">NSApplication</string> + </object> + <object class="NSWindowTemplate" id="1005"> + <int key="NSWindowStyleMask">15</int> + <int key="NSWindowBacking">2</int> + <string key="NSWindowRect">{{476, -31}, {499, 599}}</string> + <int key="NSWTFlags">544735232</int> + <string key="NSWindowTitle"/> + <string key="NSWindowClass">NSWindow</string> + <nil key="NSViewClass"/> + <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMinSize">{499, 513}</string> + <object class="NSView" key="NSWindowView" id="1006"> + <reference key="NSNextResponder"/> + <int key="NSvFlags">256</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSCustomView" id="351729448"> + <reference key="NSNextResponder" ref="1006"/> + <int key="NSvFlags">289</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSButton" id="877515252"> + <reference key="NSNextResponder" ref="351729448"/> + <int key="NSvFlags">289</int> + <string key="NSFrame">{{14, 12}, {96, 32}}</string> + <reference key="NSSuperview" ref="351729448"/> + <bool key="NSEnabled">YES</bool> + <object class="NSButtonCell" key="NSCell" id="899809726"> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">134217728</int> + <string key="NSContents">^IDS_CLOSE</string> + <object class="NSFont" key="NSSupport" id="743256162"> + <string key="NSName">LucidaGrande</string> + <double key="NSSize">1.300000e+01</double> + <int key="NSfFlags">1044</int> + </object> + <reference key="NSControlView" ref="877515252"/> + <int key="NSButtonFlags">-2038284033</int> + <int key="NSButtonFlags2">129</int> + <string key="NSAlternateContents"/> + <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string> + <int key="NSPeriodicDelay">200</int> + <int key="NSPeriodicInterval">25</int> + </object> + </object> + </object> + <string key="NSFrame">{{375, 0}, {124, 51}}</string> + <reference key="NSSuperview" ref="1006"/> + <string key="NSClassName">GTMWidthBasedTweaker</string> + </object> + <object class="NSSplitView" id="1042467467"> + <reference key="NSNextResponder" ref="1006"/> + <int key="NSvFlags">274</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSCustomView" id="394193544"> + <reference key="NSNextResponder" ref="1042467467"/> + <int key="NSvFlags">274</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSScrollView" id="1002552068"> + <reference key="NSNextResponder" ref="394193544"/> + <int key="NSvFlags">274</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSClipView" id="68591532"> + <reference key="NSNextResponder" ref="1002552068"/> + <int key="NSvFlags">2304</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSOutlineView" id="120560"> + <reference key="NSNextResponder" ref="68591532"/> + <int key="NSvFlags">256</int> + <string key="NSFrameSize">{457, 227}</string> + <reference key="NSSuperview" ref="68591532"/> + <bool key="NSEnabled">YES</bool> + <object class="_NSCornerView" key="NSCornerView"> + <nil key="NSNextResponder"/> + <int key="NSvFlags">-2147483392</int> + <string key="NSFrame">{{443, 0}, {16, 17}}</string> + </object> + <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> + <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> + <int key="NSfFlags">3100</int> + </object> + <object class="NSColor" key="NSBackgroundColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes> + </object> + <object class="NSColor" key="NSTextColor" id="491967741"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">headerTextColor</string> + <object class="NSColor" key="NSColor" id="386908440"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MAA</bytes> + </object> + </object> + </object> + <object class="NSTextFieldCell" key="NSDataCell" id="363879356"> + <int key="NSCellFlags">69336641</int> + <int key="NSCellFlags2">133120</int> + <string key="NSContents">Text Cell</string> + <reference key="NSSupport" ref="26"/> + <reference key="NSControlView" ref="120560"/> + <object class="NSColor" key="NSBackgroundColor" id="657409763"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">controlBackgroundColor</string> + <object class="NSColor" key="NSColor" id="848879610"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC42NjY2NjY2OQA</bytes> + </object> + </object> + <object class="NSColor" key="NSTextColor" id="593135112"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">controlTextColor</string> + <reference key="NSColor" ref="386908440"/> + </object> + </object> + <int key="NSResizingMask">3</int> + <bool key="NSIsResizeable">YES</bool> + <reference key="NSTableView" ref="120560"/> + </object> + </object> + <double key="NSIntercellSpacingWidth">2.000000e+00</double> + <double key="NSIntercellSpacingHeight">3.000000e+00</double> + <reference key="NSBackgroundColor" ref="657409763"/> + <object class="NSColor" key="NSGridColor" id="953355163"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">gridColor</string> + <object class="NSColor" key="NSColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC41AA</bytes> + </object> + </object> + <double key="NSRowHeight">1.400000e+01</double> + <int key="NSTvFlags">-767557632</int> + <int key="NSColumnAutoresizingStyle">4</int> + <int key="NSDraggingSourceMaskForLocal">15</int> + <int key="NSDraggingSourceMaskForNonLocal">0</int> + <bool key="NSAllowsTypeSelect">YES</bool> + </object> + </object> + <string key="NSFrame">{{1, 1}, {457, 227}}</string> + <reference key="NSSuperview" ref="1002552068"/> + <reference key="NSNextKeyView" ref="120560"/> + <reference key="NSDocView" ref="120560"/> + <reference key="NSBGColor" ref="657409763"/> + <int key="NScvFlags">4</int> + </object> + <object class="NSScroller" id="342557255"> + <reference key="NSNextResponder" ref="1002552068"/> + <int key="NSvFlags">-2147483392</int> + <string key="NSFrame">{{447, 1}, {11, 222}}</string> + <reference key="NSSuperview" ref="1002552068"/> + <int key="NSsFlags">256</int> + <reference key="NSTarget" ref="1002552068"/> + <string key="NSAction">_doScroller:</string> + <double key="NSCurValue">3.797468e-02</double> + <double key="NSPercent">1.000000e+00</double> + </object> + <object class="NSScroller" id="33257460"> + <reference key="NSNextResponder" ref="1002552068"/> + <int key="NSvFlags">-2147483392</int> + <string key="NSFrame">{{1, 223}, {446, 15}}</string> + <reference key="NSSuperview" ref="1002552068"/> + <int key="NSsFlags">513</int> + <reference key="NSTarget" ref="1002552068"/> + <string key="NSAction">_doScroller:</string> + <double key="NSPercent">1.000000e+00</double> + </object> + </object> + <string key="NSFrame">{{20, 0}, {459, 229}}</string> + <reference key="NSSuperview" ref="394193544"/> + <reference key="NSNextKeyView" ref="68591532"/> + <int key="NSsFlags">562</int> + <reference key="NSVScroller" ref="342557255"/> + <reference key="NSHScroller" ref="33257460"/> + <reference key="NSContentView" ref="68591532"/> + <bytes key="NSScrollAmts">QSAAAEEgAABBiAAAQYgAAA</bytes> + </object> + <object class="NSTextField" id="91932637"> + <reference key="NSNextResponder" ref="394193544"/> + <int key="NSvFlags">266</int> + <string key="NSFrame">{{17, 237}, {465, 17}}</string> + <reference key="NSSuperview" ref="394193544"/> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="901192651"> + <int key="NSCellFlags">68288064</int> + <int key="NSCellFlags2">272630784</int> + <string key="NSContents">^IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL</string> + <reference key="NSSupport" ref="743256162"/> + <reference key="NSControlView" ref="91932637"/> + <object class="NSColor" key="NSBackgroundColor" id="466057361"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">controlColor</string> + <reference key="NSColor" ref="848879610"/> + </object> + <reference key="NSTextColor" ref="593135112"/> + </object> + </object> + </object> + <string key="NSFrameSize">{499, 274}</string> + <reference key="NSSuperview" ref="1042467467"/> + <string key="NSClassName">NSView</string> + </object> + <object class="NSCustomView" id="552178720"> + <reference key="NSNextResponder" ref="1042467467"/> + <int key="NSvFlags">274</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSTextField" id="477810653"> + <reference key="NSNextResponder" ref="552178720"/> + <int key="NSvFlags">266</int> + <string key="NSFrame">{{17, 266}, {465, 17}}</string> + <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> + <string key="NSContents">^IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL</string> + <reference key="NSSupport" ref="743256162"/> + <reference key="NSControlView" ref="477810653"/> + <reference key="NSBackgroundColor" ref="466057361"/> + <reference key="NSTextColor" ref="593135112"/> + </object> + </object> + <object class="NSScrollView" id="979906343"> + <reference key="NSNextResponder" ref="552178720"/> + <int key="NSvFlags">274</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSClipView" id="228119952"> + <reference key="NSNextResponder" ref="979906343"/> + <int key="NSvFlags">2304</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSOutlineView" id="865839264"> + <reference key="NSNextResponder" ref="228119952"/> + <int key="NSvFlags">256</int> + <string key="NSFrameSize">{457, 234}</string> + <reference key="NSSuperview" ref="228119952"/> + <bool key="NSEnabled">YES</bool> + <object class="_NSCornerView" key="NSCornerView"> + <nil key="NSNextResponder"/> + <int key="NSvFlags">-2147483392</int> + <string key="NSFrame">{{443, 0}, {16, 17}}</string> + </object> + <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> + <object class="NSTableHeaderCell" key="NSHeaderCell"> + <int key="NSCellFlags">75628096</int> + <int key="NSCellFlags2">2048</int> + <string key="NSContents"/> + <reference key="NSSupport" ref="26"/> + <object class="NSColor" key="NSBackgroundColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes> + </object> + <reference key="NSTextColor" ref="491967741"/> + </object> + <object class="NSTextFieldCell" key="NSDataCell" id="361039448"> + <int key="NSCellFlags">69336641</int> + <int key="NSCellFlags2">133120</int> + <string key="NSContents">Text Cell</string> + <reference key="NSSupport" ref="26"/> + <reference key="NSControlView" ref="865839264"/> + <reference key="NSBackgroundColor" ref="657409763"/> + <reference key="NSTextColor" ref="593135112"/> + </object> + <int key="NSResizingMask">3</int> + <bool key="NSIsResizeable">YES</bool> + <reference key="NSTableView" ref="865839264"/> + </object> + </object> + <double key="NSIntercellSpacingWidth">2.000000e+00</double> + <double key="NSIntercellSpacingHeight">3.000000e+00</double> + <reference key="NSBackgroundColor" ref="657409763"/> + <reference key="NSGridColor" ref="953355163"/> + <double key="NSRowHeight">1.400000e+01</double> + <int key="NSTvFlags">-767557632</int> + <int key="NSColumnAutoresizingStyle">4</int> + <int key="NSDraggingSourceMaskForLocal">15</int> + <int key="NSDraggingSourceMaskForNonLocal">0</int> + <bool key="NSAllowsTypeSelect">YES</bool> + </object> + </object> + <string key="NSFrame">{{1, 1}, {457, 234}}</string> + <reference key="NSSuperview" ref="979906343"/> + <reference key="NSNextKeyView" ref="865839264"/> + <reference key="NSDocView" ref="865839264"/> + <reference key="NSBGColor" ref="657409763"/> + <int key="NScvFlags">4</int> + </object> + <object class="NSScroller" id="708315878"> + <reference key="NSNextResponder" ref="979906343"/> + <int key="NSvFlags">-2147483392</int> + <string key="NSFrame">{{447, 1}, {11, 222}}</string> + <reference key="NSSuperview" ref="979906343"/> + <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> + </object> + <object class="NSScroller" id="634021446"> + <reference key="NSNextResponder" ref="979906343"/> + <int key="NSvFlags">-2147483392</int> + <string key="NSFrame">{{1, 223}, {446, 15}}</string> + <reference key="NSSuperview" ref="979906343"/> + <int key="NSsFlags">513</int> + <reference key="NSTarget" ref="979906343"/> + <string key="NSAction">_doScroller:</string> + <double key="NSPercent">1.000000e+00</double> + </object> + </object> + <string key="NSFrame">{{20, 22}, {459, 236}}</string> + <reference key="NSSuperview" ref="552178720"/> + <reference key="NSNextKeyView" ref="228119952"/> + <int key="NSsFlags">562</int> + <reference key="NSVScroller" ref="708315878"/> + <reference key="NSHScroller" ref="634021446"/> + <reference key="NSContentView" ref="228119952"/> + <bytes key="NSScrollAmts">QSAAAEEgAABBiAAAQYgAAA</bytes> + </object> + </object> + <string key="NSFrame">{{0, 283}, {499, 283}}</string> + <reference key="NSSuperview" ref="1042467467"/> + <string key="NSClassName">NSView</string> + </object> + </object> + <string key="NSFrame">{{0, 33}, {499, 566}}</string> + <reference key="NSSuperview" ref="1006"/> + </object> + </object> + <string key="NSFrameSize">{499, 599}</string> + <reference key="NSSuperview"/> + </object> + <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string> + <string key="NSMinSize">{499, 535}</string> + <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + </object> + <object class="NSTreeController" id="317796902"> + <object class="NSMutableArray" key="NSDeclaredKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>title</string> + <string>name</string> + <string>databaseDescription</string> + <string>domain</string> + <string>path</string> + <string>sendFor</string> + <string>created</string> + <string>expires</string> + <string>count</string> + <string>fileSize</string> + <string>lastModified</string> + <string>modelKey</string> + </object> + <string key="NSObjectClassName">CocoaCookieTreeNode</string> + <object class="_NSManagedProxy" key="_NSManagedProxy"/> + <bool key="NSPreservesSelection">YES</bool> + <bool key="NSSelectsInsertedObjects">YES</bool> + <string key="NSTreeContentChildrenKey">children</string> + <string key="NSTreeContentLeafKey">isLeaf</string> + </object> + <object class="NSTreeController" id="502850313"> + <object class="NSMutableArray" key="NSDeclaredKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>title</string> + <string>name</string> + <string>databaseDescription</string> + <string>domain</string> + <string>path</string> + <string>sendFor</string> + <string>created</string> + <string>expires</string> + <string>count</string> + <string>fileSize</string> + <string>lastModified</string> + <string>modelKey</string> + </object> + <string key="NSObjectClassName">CocoaCookieTreeNode</string> + <object class="_NSManagedProxy" key="_NSManagedProxy"/> + <bool key="NSPreservesSelection">YES</bool> + <bool key="NSSelectsInsertedObjects">YES</bool> + <string key="NSTreeContentChildrenKey">children</string> + <string key="NSTreeContentLeafKey">isLeaf</string> + </object> + <object class="NSCustomObject" id="524486310"> + <string key="NSClassName">ChromeUILocalizer</string> + </object> + <object class="NSCustomObject" id="505547508"> + <string key="NSClassName">GTMUILocalizerAndLayoutTweaker</string> + </object> + </object> + <object class="IBObjectContainer" key="IBDocument.Objects"> + <object class="NSMutableArray" key="connectionRecords"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">window</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="1005"/> + </object> + <int key="connectionID">49</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">closeSheet:</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="877515252"/> + </object> + <int key="connectionID">50</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> + <string key="label">value: arrangedObjects.title</string> + <reference key="source" ref="936123567"/> + <reference key="destination" ref="317796902"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="936123567"/> + <reference key="NSDestination" ref="317796902"/> + <string key="NSLabel">value: arrangedObjects.title</string> + <string key="NSBinding">value</string> + <string key="NSKeyPath">arrangedObjects.title</string> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">57</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">delegate</string> + <reference key="source" ref="120560"/> + <reference key="destination" ref="1001"/> + </object> + <int key="connectionID">99</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">delegate</string> + <reference key="source" ref="1005"/> + <reference key="destination" ref="1001"/> + </object> + <int key="connectionID">106</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">localizer_</string> + <reference key="source" ref="505547508"/> + <reference key="destination" ref="524486310"/> + </object> + <int key="connectionID">138</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">uiObject_</string> + <reference key="source" ref="505547508"/> + <reference key="destination" ref="1005"/> + </object> + <int key="connectionID">139</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">allowedTreeController_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="317796902"/> + </object> + <int key="connectionID">358</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">blockedTreeController_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="502850313"/> + </object> + <int key="connectionID">359</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">allowedOutlineView_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="120560"/> + </object> + <int key="connectionID">360</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">blockedOutlineView_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="865839264"/> + </object> + <int key="connectionID">361</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">delegate</string> + <reference key="source" ref="865839264"/> + <reference key="destination" ref="1001"/> + </object> + <int key="connectionID">362</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> + <string key="label">value: arrangedObjects.title</string> + <reference key="source" ref="969301028"/> + <reference key="destination" ref="502850313"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="969301028"/> + <reference key="NSDestination" ref="502850313"/> + <string key="NSLabel">value: arrangedObjects.title</string> + <string key="NSBinding">value</string> + <string key="NSKeyPath">arrangedObjects.title</string> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">365</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> + <string key="label">contentArray: cocoaAllowedTreeModel.children</string> + <reference key="source" ref="317796902"/> + <reference key="destination" ref="1001"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="317796902"/> + <reference key="NSDestination" ref="1001"/> + <string key="NSLabel">contentArray: cocoaAllowedTreeModel.children</string> + <string key="NSBinding">contentArray</string> + <string key="NSKeyPath">cocoaAllowedTreeModel.children</string> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">372</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> + <string key="label">contentArray: cocoaBlockedTreeModel.children</string> + <reference key="source" ref="502850313"/> + <reference key="destination" ref="1001"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="502850313"/> + <reference key="NSDestination" ref="1001"/> + <string key="NSLabel">contentArray: cocoaBlockedTreeModel.children</string> + <string key="NSBinding">contentArray</string> + <string key="NSKeyPath">cocoaBlockedTreeModel.children</string> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">375</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="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> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-1</int> + <reference key="object" ref="1003"/> + <reference key="parent" ref="901467297"/> + <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"/> + <string key="objectName">Application</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1</int> + <reference key="object" ref="1005"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="1006"/> + </object> + <reference key="parent" ref="901467297"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">2</int> + <reference key="object" ref="1006"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="351729448"/> + <reference ref="1042467467"/> + </object> + <reference key="parent" ref="1005"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">51</int> + <reference key="object" ref="317796902"/> + <reference key="parent" ref="901467297"/> + <string key="objectName">Allowed Tree Controller</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">131</int> + <reference key="object" ref="351729448"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="877515252"/> + </object> + <reference key="parent" ref="1006"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">19</int> + <reference key="object" ref="877515252"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="899809726"/> + </object> + <reference key="parent" ref="351729448"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">20</int> + <reference key="object" ref="899809726"/> + <reference key="parent" ref="877515252"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">136</int> + <reference key="object" ref="524486310"/> + <reference key="parent" ref="901467297"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">137</int> + <reference key="object" ref="505547508"/> + <reference key="parent" ref="901467297"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">357</int> + <reference key="object" ref="502850313"/> + <reference key="parent" ref="901467297"/> + <string key="objectName">Blocked Tree Controller</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">380</int> + <reference key="object" ref="1042467467"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="394193544"/> + <reference ref="552178720"/> + </object> + <reference key="parent" ref="1006"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">379</int> + <reference key="object" ref="394193544"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="91932637"/> + <reference ref="1002552068"/> + </object> + <reference key="parent" ref="1042467467"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">3</int> + <reference key="object" ref="91932637"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="901192651"/> + </object> + <reference key="parent" ref="394193544"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">5</int> + <reference key="object" ref="1002552068"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="120560"/> + <reference ref="33257460"/> + <reference ref="342557255"/> + </object> + <reference key="parent" ref="394193544"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">8</int> + <reference key="object" ref="120560"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="936123567"/> + </object> + <reference key="parent" ref="1002552068"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">7</int> + <reference key="object" ref="33257460"/> + <reference key="parent" ref="1002552068"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">6</int> + <reference key="object" ref="342557255"/> + <reference key="parent" ref="1002552068"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">10</int> + <reference key="object" ref="936123567"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="363879356"/> + </object> + <reference key="parent" ref="120560"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">13</int> + <reference key="object" ref="363879356"/> + <reference key="parent" ref="936123567"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">4</int> + <reference key="object" ref="901192651"/> + <reference key="parent" ref="91932637"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">378</int> + <reference key="object" ref="552178720"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="979906343"/> + <reference ref="477810653"/> + </object> + <reference key="parent" ref="1042467467"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">350</int> + <reference key="object" ref="979906343"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="865839264"/> + <reference ref="634021446"/> + <reference ref="708315878"/> + </object> + <reference key="parent" ref="552178720"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">349</int> + <reference key="object" ref="477810653"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="156287056"/> + </object> + <reference key="parent" ref="552178720"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">356</int> + <reference key="object" ref="156287056"/> + <reference key="parent" ref="477810653"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">351</int> + <reference key="object" ref="865839264"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="969301028"/> + </object> + <reference key="parent" ref="979906343"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">352</int> + <reference key="object" ref="634021446"/> + <reference key="parent" ref="979906343"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">353</int> + <reference key="object" ref="708315878"/> + <reference key="parent" ref="979906343"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">354</int> + <reference key="object" ref="969301028"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="361039448"/> + </object> + <reference key="parent" ref="865839264"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">355</int> + <reference key="object" ref="361039448"/> + <reference key="parent" ref="969301028"/> + </object> + </object> + </object> + <object class="NSMutableDictionary" key="flattenedProperties"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>-1.IBPluginDependency</string> + <string>-2.IBPluginDependency</string> + <string>-3.IBPluginDependency</string> + <string>1.IBEditorWindowLastContentRect</string> + <string>1.IBPluginDependency</string> + <string>1.IBViewEditorWindowController.showingLayoutRectangles</string> + <string>1.IBWindowTemplateEditedContentRect</string> + <string>1.NSWindowTemplate.visibleAtLaunch</string> + <string>1.WindowOrigin</string> + <string>1.editorWindowContentRectSynchronizationRect</string> + <string>1.windowTemplate.hasMinSize</string> + <string>1.windowTemplate.minSize</string> + <string>10.IBPluginDependency</string> + <string>13.CustomClassName</string> + <string>13.IBPluginDependency</string> + <string>136.IBPluginDependency</string> + <string>137.IBPluginDependency</string> + <string>19.IBPluginDependency</string> + <string>2.IBPluginDependency</string> + <string>20.IBPluginDependency</string> + <string>3.IBPluginDependency</string> + <string>349.IBPluginDependency</string> + <string>350.IBPluginDependency</string> + <string>351.IBPluginDependency</string> + <string>352.IBPluginDependency</string> + <string>353.IBPluginDependency</string> + <string>354.IBPluginDependency</string> + <string>355.CustomClassName</string> + <string>355.IBPluginDependency</string> + <string>356.IBPluginDependency</string> + <string>357.IBPluginDependency</string> + <string>4.IBPluginDependency</string> + <string>5.IBPluginDependency</string> + <string>51.IBPluginDependency</string> + <string>6.IBPluginDependency</string> + <string>7.IBPluginDependency</string> + <string>8.IBPluginDependency</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>{{177, 1004}, {499, 599}}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <boolean value="YES" id="5"/> + <string>{{177, 1004}, {499, 599}}</string> + <boolean value="NO"/> + <string>{196, 240}</string> + <string>{{357, 418}, {480, 270}}</string> + <reference ref="5"/> + <string>{499, 513}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>ImageAndTextCell</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> + <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>ImageAndTextCell</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> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + </object> + </object> + <object class="NSMutableDictionary" key="unlocalizedProperties"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> + <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> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> + <nil key="sourceID"/> + <int key="maxID">380</int> + </object> + <object class="IBClassDescriber" key="IBDocument.Classes"> + <object class="NSMutableArray" key="referencedPartialClassDescriptions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBPartialClassDescription"> + <string key="className">ChromeUILocalizer</string> + <string key="superclassName">GTMUILocalizer</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/ui_localizer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">CollectedCookiesWindowController</string> + <string key="superclassName">NSWindowController</string> + <object class="NSMutableDictionary" key="actions"> + <string key="NS.key.0">closeSheet:</string> + <string key="NS.object.0">id</string> + </object> + <object class="NSMutableDictionary" key="outlets"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>allowedOutlineView_</string> + <string>allowedTreeController_</string> + <string>blockedOutlineView_</string> + <string>blockedTreeController_</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>NSOutlineView</string> + <string>NSTreeController</string> + <string>NSOutlineView</string> + <string>NSTreeController</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/collected_cookies_mac.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">GTMUILocalizer</string> + <string key="superclassName">NSObject</string> + <object class="NSMutableDictionary" key="outlets"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>otherObjectToLocalize_</string> + <string>owner_</string> + <string>yetAnotherObjectToLocalize_</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>id</string> + <string>id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">GTMUILocalizerAndLayoutTweaker</string> + <string key="superclassName">NSObject</string> + <object class="NSMutableDictionary" key="outlets"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>localizerOwner_</string> + <string>localizer_</string> + <string>uiObject_</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>GTMUILocalizer</string> + <string>id</string> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="41249318"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">GTMWidthBasedTweaker</string> + <string key="superclassName">NSView</string> + <object class="NSMutableDictionary" key="outlets"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMutableArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>viewToResize_</string> + <string>viewToSlideAndResize_</string> + <string>viewToSlide_</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>NSView</string> + <string>NSView</string> + </object> + </object> + <reference key="sourceIdentifier" ref="41249318"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">ImageAndTextCell</string> + <string key="superclassName">NSTextFieldCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">../third_party/apple/ImageAndTextCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">../third_party/GTM/Foundation/GTMNSObject+KeyValueObserving.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/objc_zombie.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/status_bubble_mac.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/tab_strip_model_observer_bridge.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/chrome_browser_window.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/themed_window.h</string> + </object> + </object> + </object> + </object> + <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.LastKnownRelativeProjectPath">../../chrome.xcodeproj</string> + <int key="IBDocument.defaultPropertyAccessControl">3</int> + </data> +</archive> diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 95b524f..08d58fc 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -326,6 +326,8 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(AutomationMsg_GetCookies, GetCookies) IPC_MESSAGE_HANDLER(AutomationMsg_SetCookie, SetCookie) IPC_MESSAGE_HANDLER(AutomationMsg_DeleteCookie, DeleteCookie) + IPC_MESSAGE_HANDLER(AutomationMsg_ShowCollectedCookiesDialog, + ShowCollectedCookiesDialog) IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_NavigateToURL, NavigateToURL) IPC_MESSAGE_HANDLER_DELAY_REPLY( AutomationMsg_NavigateToURLBlockUntilNavigationsComplete, @@ -1281,6 +1283,17 @@ void AutomationProvider::DeleteCookie(const GURL& url, } } +void AutomationProvider::ShowCollectedCookiesDialog( + int handle, bool* success) { + *success = false; + if (tab_tracker_->ContainsHandle(handle)) { + TabContents* tab_contents = + tab_tracker_->GetResource(handle)->tab_contents(); + tab_contents->delegate()->ShowCollectedCookiesDialog(tab_contents); + *success = true; + } +} + void AutomationProvider::GetTabURL(int handle, bool* success, GURL* url) { *success = false; if (tab_tracker_->ContainsHandle(handle)) { diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index b4782c3..737e7d5f 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -170,6 +170,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, int* response_value); void DeleteCookie(const GURL& url, const std::string& cookie_name, int handle, bool* success); + void ShowCollectedCookiesDialog(int handle, bool* success); void GetBrowserWindowCount(int* window_count); void GetBrowserLocale(string16* locale); void GetNormalBrowserWindowCount(int* window_count); diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index d04cb5d..390e7ef 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -2878,6 +2878,10 @@ void Browser::ShowContentSettingsWindow(ContentSettingsType content_type) { profile_->GetOriginalProfile()); } +void Browser::ShowCollectedCookiesDialog(TabContents *tab_contents) { + window()->ShowCollectedCookiesDialog(tab_contents); +} + bool Browser::ShouldAddNavigationsToHistory() const { // Don't update history if running as app. return !IsApplication(); diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index 67ba3dd..c407ffb 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -727,6 +727,7 @@ class Browser : public TabStripModelDelegate, virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); virtual void ShowRepostFormWarningDialog(TabContents* tab_contents); virtual void ShowContentSettingsWindow(ContentSettingsType content_type); + virtual void ShowCollectedCookiesDialog(TabContents* tab_contents); virtual bool ShouldAddNavigationsToHistory() const; virtual void OnDidGetApplicationInfo(TabContents* tab_contents, int32 page_id); diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h index d806e62..9c50dda 100644 --- a/chrome/browser/browser_window.h +++ b/chrome/browser/browser_window.h @@ -230,6 +230,9 @@ class BrowserWindow { virtual void ShowContentSettingsWindow(ContentSettingsType content_type, Profile* profile) = 0; + // Shows the collected cookies dialog box. + virtual void ShowCollectedCookiesDialog(TabContents* tab_contents) = 0; + // Shows a dialog to the user that something is wrong with the profile. // |message_id| is the ID for a string in the string table which will be // displayed in the dialog. diff --git a/chrome/browser/cocoa/browser_window_cocoa.h b/chrome/browser/cocoa/browser_window_cocoa.h index 56727ca..dad191e 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.h +++ b/chrome/browser/cocoa/browser_window_cocoa.h @@ -83,6 +83,7 @@ class BrowserWindowCocoa : public BrowserWindow, virtual void ShowRepostFormWarningDialog(TabContents* tab_contents); virtual void ShowContentSettingsWindow(ContentSettingsType content_type, Profile* profile); + virtual void ShowCollectedCookiesDialog(TabContents* tab_contents); virtual void ShowProfileErrorDialog(int message_id); virtual void ShowThemeInstallBubble(); virtual void ConfirmBrowserCloseWithPendingDownloads(); diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm index bd409a2..a0961e3 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/cocoa/browser_window_cocoa.mm @@ -17,6 +17,7 @@ #import "chrome/browser/cocoa/bug_report_window_controller.h" #import "chrome/browser/cocoa/chrome_browser_window.h" #import "chrome/browser/cocoa/clear_browsing_data_controller.h" +#import "chrome/browser/cocoa/collected_cookies_mac.h" #import "chrome/browser/cocoa/content_settings_dialog_controller.h" #import "chrome/browser/cocoa/download_shelf_controller.h" #import "chrome/browser/cocoa/edit_search_engine_cocoa_controller.h" @@ -343,6 +344,11 @@ void BrowserWindowCocoa::ShowContentSettingsWindow( profile:profile]; } +void BrowserWindowCocoa::ShowCollectedCookiesDialog(TabContents* tab_contents) { + // Deletes itself on close. + new CollectedCookiesMac(GetNativeHandle(), tab_contents); +} + void BrowserWindowCocoa::ShowProfileErrorDialog(int message_id) { scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); [alert addButtonWithTitle:l10n_util::GetNSStringWithFixup(IDS_OK)]; diff --git a/chrome/browser/cocoa/collected_cookies_mac.h b/chrome/browser/cocoa/collected_cookies_mac.h new file mode 100644 index 0000000..e47b15b --- /dev/null +++ b/chrome/browser/cocoa/collected_cookies_mac.h @@ -0,0 +1,97 @@ +// 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. + +#import <Cocoa/Cocoa.h> + +#include "app/tree_model.h" +#include "base/cocoa_protocols_mac.h" +#include "base/scoped_nsobject.h" +#include "base/scoped_ptr.h" +#include "chrome/browser/cocoa/constrained_window_mac.h" +#import "chrome/browser/cocoa/cookie_tree_node.h" +#include "chrome/browser/cookies_tree_model.h" +#include "chrome/common/notification_registrar.h" + +@class CollectedCookiesWindowController; +class TabContents; + +// The constrained window delegate reponsible for managing the collected +// cookies dialog. +class CollectedCookiesMac : public ConstrainedWindowMacDelegateCustomSheet, + public NotificationObserver { + public: + CollectedCookiesMac(NSWindow* parent, TabContents* tab_contents); + + void OnSheetDidEnd(NSWindow* sheet); + + // ConstrainedWindowMacDelegateCustomSheet implementation. + virtual void DeleteDelegate(); + + private: + virtual ~CollectedCookiesMac(); + + // NotificationObserver implementation. + void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + NotificationRegistrar registrar_; + + ConstrainedWindow* window_; + + TabContents* tab_contents_; + + CollectedCookiesWindowController* sheet_controller_; + + DISALLOW_COPY_AND_ASSIGN(CollectedCookiesMac); +}; + +// Controller for the collected cookies dialog. This class stores an internal +// copy of the CookiesTreeModel but with Cocoa-converted values (NSStrings and +// NSImages instead of std::strings and SkBitmaps). Doing this allows us to use +// bindings for the interface. Changes are pushed to this internal model via a +// very thin bridge (see cookies_window_controller.h). +@interface CollectedCookiesWindowController : NSWindowController + <NSOutlineViewDelegate, + NSWindowDelegate> { + @private + // Platform-independent model. + scoped_ptr<CookiesTreeModel> allowedTreeModel_; + scoped_ptr<CookiesTreeModel> blockedTreeModel_; + + // Cached array of icons. + scoped_nsobject<NSMutableArray> icons_; + + // Our Cocoa copy of the model. + scoped_nsobject<CocoaCookieTreeNode> cocoaAllowedTreeModel_; + scoped_nsobject<CocoaCookieTreeNode> cocoaBlockedTreeModel_; + + IBOutlet NSTreeController* allowedTreeController_; + IBOutlet NSTreeController* blockedTreeController_; + IBOutlet NSOutlineView* allowedOutlineView_; + IBOutlet NSOutlineView* blockedOutlineView_; + + TabContents* tabContents_; // weak +} +@property (readonly, nonatomic) NSTreeController* allowedTreeController; +@property (readonly, nonatomic) NSTreeController* blockedTreeController; + +// Designated initializer. TabContents cannot be NULL. +- (id)initWithTabContents:(TabContents*)tabContents; + +// Closes the sheet and ends the modal loop. This will also cleanup the memory. +- (IBAction)closeSheet:(id)sender; + +// Returns the cocoaAllowedTreeModel_ and cocoaBlockedTreeModel_. +- (CocoaCookieTreeNode*)cocoaAllowedTreeModel; +- (CocoaCookieTreeNode*)cocoaBlockedTreeModel; +- (void)setCocoaAllowedTreeModel:(CocoaCookieTreeNode*)model; +- (void)setCocoaBlockedTreeModel:(CocoaCookieTreeNode*)model; + +// Returns the allowedTreeModel_ and blockedTreeModel_. +- (CookiesTreeModel*)allowedTreeModel; +- (CookiesTreeModel*)blockedTreeModel; + +- (void)loadTreeModelFromTabContents; +@end diff --git a/chrome/browser/cocoa/collected_cookies_mac.mm b/chrome/browser/cocoa/collected_cookies_mac.mm new file mode 100644 index 0000000..25cc43c --- /dev/null +++ b/chrome/browser/cocoa/collected_cookies_mac.mm @@ -0,0 +1,203 @@ +// 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. + +#import "chrome/browser/cocoa/collected_cookies_mac.h" + +#include <vector> + +#include "app/l10n_util_mac.h" +#include "app/resource_bundle.h" +#import "base/mac_util.h" +#include "base/sys_string_conversions.h" +#include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/common/notification_service.h" +#include "grit/generated_resources.h" +#include "grit/theme_resources.h" +#include "skia/ext/skia_utils_mac.h" +#include "third_party/apple/ImageAndTextCell.h" +#include "third_party/skia/include/core/SkBitmap.h" + +#pragma mark Bridge between the constrained window delegate and the sheet + +// The delegate used to forward the events from the sheet to the constrained +// window delegate. +@interface CollectedCookiesSheetBridge : NSObject { + CollectedCookiesMac* collectedCookies_; // weak +} +- (id)initWithCollectedCookiesMac:(CollectedCookiesMac*)collectedCookies; +- (void)sheetDidEnd:(NSWindow*)sheet + returnCode:(int)returnCode + contextInfo:(void*)contextInfo; +@end + +@implementation CollectedCookiesSheetBridge +- (id)initWithCollectedCookiesMac:(CollectedCookiesMac*)collectedCookies { + if ((self = [super init])) { + collectedCookies_ = collectedCookies; + } + return self; +} + +- (void)sheetDidEnd:(NSWindow*)sheet + returnCode:(int)returnCode + contextInfo:(void*)contextInfo { + collectedCookies_->OnSheetDidEnd(sheet); +} +@end + +#pragma mark Constrained window delegate + +CollectedCookiesMac::CollectedCookiesMac(NSWindow* parent, + TabContents* tab_contents) + : ConstrainedWindowMacDelegateCustomSheet( + [[[CollectedCookiesSheetBridge alloc] + initWithCollectedCookiesMac:this] autorelease], + @selector(sheetDidEnd:returnCode:contextInfo:)), + tab_contents_(tab_contents) { + TabSpecificContentSettings* content_settings = + tab_contents->GetTabSpecificContentSettings(); + registrar_.Add(this, NotificationType::COLLECTED_COOKIES_SHOWN, + Source<TabSpecificContentSettings>(content_settings)); + + sheet_controller_ = [[CollectedCookiesWindowController alloc] + initWithTabContents:tab_contents]; + + set_sheet([sheet_controller_ window]); + + window_ = tab_contents->CreateConstrainedDialog(this); +} + +CollectedCookiesMac::~CollectedCookiesMac() { + NSWindow* window = [sheet_controller_ window]; + if (window_ && window && is_sheet_open()) { + window_ = NULL; + [NSApp endSheet:window]; + } +} + +void CollectedCookiesMac::DeleteDelegate() { + delete this; +} + +void CollectedCookiesMac::Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) { + DCHECK(type == NotificationType::COLLECTED_COOKIES_SHOWN); + DCHECK_EQ(Source<TabSpecificContentSettings>(source).ptr(), + tab_contents_->GetTabSpecificContentSettings()); + window_->CloseConstrainedWindow(); +} + +void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { + [sheet orderOut:sheet_controller_]; + if (window_) + window_->CloseConstrainedWindow(); +} + +#pragma mark Window Controller + +@implementation CollectedCookiesWindowController + +@synthesize allowedTreeController = allowedTreeController_; +@synthesize blockedTreeController = blockedTreeController_; + +- (id)initWithTabContents:(TabContents*)tabContents { + DCHECK(tabContents); + NSString* nibpath = + [mac_util::MainAppBundle() pathForResource:@"CollectedCookies" + ofType:@"nib"]; + if ((self = [super initWithWindowNibPath:nibpath owner:self])) { + tabContents_ = tabContents; + + [self loadTreeModelFromTabContents]; + } + return self; +} + +- (void)windowWillClose:(NSNotification*)notif { + [allowedOutlineView_ setDelegate:nil]; + [blockedOutlineView_ setDelegate:nil]; + [self autorelease]; +} + +- (IBAction)closeSheet:(id)sender { + [NSApp endSheet:[self window]]; +} + +- (CocoaCookieTreeNode*)cocoaAllowedTreeModel { + return cocoaAllowedTreeModel_.get(); +} +- (void)setCocoaAllowedTreeModel:(CocoaCookieTreeNode*)model { + cocoaAllowedTreeModel_.reset([model retain]); +} + +- (CookiesTreeModel*)allowedTreeModel { + return allowedTreeModel_.get(); +} + +- (CocoaCookieTreeNode*)cocoaBlockedTreeModel { + return cocoaBlockedTreeModel_.get(); +} +- (void)setCocoaBlockedTreeModel:(CocoaCookieTreeNode*)model { + cocoaBlockedTreeModel_.reset([model retain]); +} + +- (CookiesTreeModel*)blockedTreeModel { + return blockedTreeModel_.get(); +} + +- (void)outlineView:(NSOutlineView*)outlineView + willDisplayCell:(id)cell + forTableColumn:(NSTableColumn*)tableColumn + item:(id)item { + CocoaCookieTreeNode* node = [item representedObject]; + int index; + if (outlineView == allowedOutlineView_) + index = allowedTreeModel_->GetIconIndex([node treeNode]); + else + index = blockedTreeModel_->GetIconIndex([node treeNode]); + NSImage* icon = nil; + if (index >= 0) + icon = [icons_ objectAtIndex:index]; + else + icon = [icons_ lastObject]; + DCHECK([cell isKindOfClass:[ImageAndTextCell class]]); + [static_cast<ImageAndTextCell*>(cell) setImage:icon]; +} + +// Initializes the |allowedTreeModel_| and |blockedTreeModel_|, and builds +// the |cocoaAllowedTreeModel_| and |cocoaBlockedTreeModel_|. +- (void)loadTreeModelFromTabContents { + TabSpecificContentSettings* content_settings = + tabContents_->GetTabSpecificContentSettings(); + allowedTreeModel_.reset(content_settings->GetAllowedCookiesTreeModel()); + blockedTreeModel_.reset(content_settings->GetBlockedCookiesTreeModel()); + + // Convert the model's icons from Skia to Cocoa. + std::vector<SkBitmap> skiaIcons; + allowedTreeModel_->GetIcons(&skiaIcons); + icons_.reset([[NSMutableArray alloc] init]); + for (std::vector<SkBitmap>::iterator it = skiaIcons.begin(); + it != skiaIcons.end(); ++it) { + [icons_ addObject:gfx::SkBitmapToNSImage(*it)]; + } + + // Default icon will be the last item in the array. + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + // TODO(rsesek): Rename this resource now that it's in multiple places. + [icons_ addObject:rb.GetNSImageNamed(IDR_BOOKMARK_BAR_FOLDER)]; + + // Create the Cocoa model. + CookieTreeNode* root = + static_cast<CookieTreeNode*>(allowedTreeModel_->GetRoot()); + scoped_nsobject<CocoaCookieTreeNode> model( + [[CocoaCookieTreeNode alloc] initWithNode:root]); + [self setCocoaAllowedTreeModel:model.get()]; // Takes ownership. + root = static_cast<CookieTreeNode*>(blockedTreeModel_->GetRoot()); + model.reset( + [[CocoaCookieTreeNode alloc] initWithNode:root]); + [self setCocoaBlockedTreeModel:model.get()]; // Takes ownership. +} + +@end diff --git a/chrome/browser/cocoa/collected_cookies_mac_unittest.mm b/chrome/browser/cocoa/collected_cookies_mac_unittest.mm new file mode 100644 index 0000000..ff6f3c5 --- /dev/null +++ b/chrome/browser/cocoa/collected_cookies_mac_unittest.mm @@ -0,0 +1,38 @@ +// Copyright (c) 2009 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. + +#import <Cocoa/Cocoa.h> + +#import "chrome/browser/cocoa/collected_cookies_mac.h" + +#include "base/ref_counted.h" +#include "chrome/browser/renderer_host/site_instance.h" +#include "chrome/browser/renderer_host/test/test_render_view_host.h" +#include "chrome/browser/tab_contents/test_tab_contents.h" +#include "chrome/browser/profile.h" + +namespace { + +class CollectedCookiesWindowControllerTest : public RenderViewHostTestHarness { +}; + +TEST_F(CollectedCookiesWindowControllerTest, Construction) { + ChromeThread ui_thread(ChromeThread::UI, MessageLoop::current()); + // Create a test tab. SiteInstance will be deleted when tabContents is + // deleted. + SiteInstance* instance = + SiteInstance::CreateSiteInstance(profile_.get()); + TestTabContents* tabContents = new TestTabContents(profile_.get(), + instance); + CollectedCookiesWindowController* controller = + [[CollectedCookiesWindowController alloc] + initWithTabContents:tabContents]; + + [controller release]; + + delete tabContents; +} + +} // namespace + diff --git a/chrome/browser/collected_cookies_uitest.cc b/chrome/browser/collected_cookies_uitest.cc new file mode 100644 index 0000000..1f263b2 --- /dev/null +++ b/chrome/browser/collected_cookies_uitest.cc @@ -0,0 +1,68 @@ +// 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. + +#include <string> + +#include "chrome/app/chrome_dll_resource.h" +#include "chrome/browser/net/url_fixer_upper.h" +#include "chrome/common/chrome_switches.h" +#include "chrome/common/url_constants.h" +#include "chrome/test/automation/tab_proxy.h" +#include "chrome/test/automation/browser_proxy.h" +#include "chrome/test/ui/ui_test.h" +#include "net/url_request/url_request_unittest.h" + +namespace { + +const wchar_t kDocRoot[] = L"chrome/test/data"; + +} // namespace + +typedef UITest CollectedCookiesTest; + +TEST_F(CollectedCookiesTest, TestDoubleDisplay) { + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(kDocRoot, NULL); + ASSERT_TRUE(NULL != server.get()); + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(browser.get()); + + scoped_refptr<TabProxy> tab(browser->GetTab(0)); + ASSERT_TRUE(tab.get()); + + // Disable cookies. + ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, + CONTENT_SETTING_BLOCK)); + + // Load a page with cookies. + ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/cookie1.html"))); + + // Click on the info link twice. + ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); + ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); +} + +TEST_F(CollectedCookiesTest, NavigateAway) { + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(kDocRoot, NULL); + ASSERT_TRUE(NULL != server.get()); + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(browser.get()); + + scoped_refptr<TabProxy> tab(browser->GetTab(0)); + ASSERT_TRUE(tab.get()); + + // Disable cookies. + ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, + CONTENT_SETTING_BLOCK)); + + // Load a page with cookies. + ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/cookie1.html"))); + + // Click on the info link. + ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); + + // Navigate to another page. + ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/cookie2.html"))); +} diff --git a/chrome/browser/content_setting_bubble_model.cc b/chrome/browser/content_setting_bubble_model.cc index 19587a5..6fc78e1 100644 --- a/chrome/browser/content_setting_bubble_model.cc +++ b/chrome/browser/content_setting_bubble_model.cc @@ -95,7 +95,14 @@ class ContentSettingTitleLinkAndInfoModel virtual void OnInfoLinkClicked() { DCHECK(content_type() == CONTENT_SETTINGS_TYPE_COOKIES); - // FIXME(jochen): show cookie info dialog. + if (tab_contents()) { + NotificationService::current()->Notify( + NotificationType::COLLECTED_COOKIES_SHOWN, + Source<TabSpecificContentSettings>( + tab_contents()->GetTabSpecificContentSettings()), + NotificationService::NoDetails()); + tab_contents()->delegate()->ShowCollectedCookiesDialog(tab_contents()); + } } }; diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index fe4148b..d5a1691 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -41,6 +41,7 @@ #include "chrome/browser/gtk/browser_toolbar_gtk.h" #include "chrome/browser/gtk/cairo_cached_surface.h" #include "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h" +#include "chrome/browser/gtk/collected_cookies_gtk.h" #include "chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h" #include "chrome/browser/gtk/download_in_progress_dialog_gtk.h" #include "chrome/browser/gtk/download_shelf_gtk.h" @@ -952,6 +953,11 @@ void BrowserWindowGtk::ShowContentSettingsWindow( ContentSettingsWindowGtk::Show(GetNativeHandle(), content_type, profile); } +void BrowserWindowGtk::ShowCollectedCookiesDialog(TabContents* tab_contents) { + // Deletes itself on close. + new CollectedCookiesGtk(GetNativeHandle(), tab_contents); +} + void BrowserWindowGtk::ShowProfileErrorDialog(int message_id) { std::string title = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); std::string message = l10n_util::GetStringUTF8(message_id); diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index 08b815f..b672c89 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -101,6 +101,7 @@ class BrowserWindowGtk : public BrowserWindow, virtual void ShowRepostFormWarningDialog(TabContents* tab_contents); virtual void ShowContentSettingsWindow(ContentSettingsType content_type, Profile* profile); + virtual void ShowCollectedCookiesDialog(TabContents* tab_contents); virtual void ShowProfileErrorDialog(int message_id); virtual void ShowThemeInstallBubble(); virtual void ConfirmBrowserCloseWithPendingDownloads(); diff --git a/chrome/browser/gtk/collected_cookies_gtk.cc b/chrome/browser/gtk/collected_cookies_gtk.cc new file mode 100644 index 0000000..a1bd94a --- /dev/null +++ b/chrome/browser/gtk/collected_cookies_gtk.cc @@ -0,0 +1,183 @@ +// 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. + +#include "chrome/browser/gtk/collected_cookies_gtk.h" + +#include "app/gtk_util.h" +#include "app/l10n_util.h" +#include "chrome/browser/cookies_tree_model.h" +#include "chrome/browser/gtk/gtk_util.h" +#include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/common/notification_service.h" +#include "grit/generated_resources.h" + +namespace { +// Height of the cookie tree view. +const int kTreeViewHeight = 150; +} // namespace + +CollectedCookiesGtk::CollectedCookiesGtk(GtkWindow* parent, + TabContents* tab_contents) + : tab_contents_(tab_contents) { + TabSpecificContentSettings* content_settings = + tab_contents->GetTabSpecificContentSettings(); + registrar_.Add(this, NotificationType::COLLECTED_COOKIES_SHOWN, + Source<TabSpecificContentSettings>(content_settings)); + + Init(); +} + +void CollectedCookiesGtk::Init() { + dialog_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); + gtk_box_set_spacing(GTK_BOX(dialog_), gtk_util::kContentAreaSpacing); + + GtkWidget* label = gtk_label_new( + l10n_util::GetStringUTF8(IDS_COLLECTED_COOKIES_DIALOG_TITLE).c_str()); + gtk_box_pack_start(GTK_BOX(dialog_), label, TRUE, TRUE, 0); + + // Allowed Cookie list. + GtkWidget* 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_ALLOWED_COOKIES_LABEL). + c_str()); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(cookie_list_vbox), label, FALSE, FALSE, 0); + + GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll_window), + GTK_SHADOW_ETCHED_IN); + gtk_box_pack_start(GTK_BOX(cookie_list_vbox), scroll_window, TRUE, TRUE, 0); + + TabSpecificContentSettings* content_settings = + tab_contents_->GetTabSpecificContentSettings(); + + allowed_cookies_tree_model_.reset( + content_settings->GetAllowedCookiesTreeModel()); + allowed_cookies_tree_adapter_.reset( + 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_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_); + + GtkTreeViewColumn* title_column = gtk_tree_view_column_new(); + GtkCellRenderer* pixbuf_renderer = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(title_column, pixbuf_renderer, FALSE); + gtk_tree_view_column_add_attribute(title_column, pixbuf_renderer, "pixbuf", + gtk_tree::TreeAdapter::COL_ICON); + GtkCellRenderer* title_renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(title_column, title_renderer, TRUE); + gtk_tree_view_column_add_attribute(title_column, title_renderer, "text", + gtk_tree::TreeAdapter::COL_TITLE); + gtk_tree_view_column_set_title( + title_column, l10n_util::GetStringUTF8( + IDS_COOKIES_DOMAIN_COLUMN_HEADER).c_str()); + gtk_tree_view_append_column(GTK_TREE_VIEW(allowed_tree_), title_column); + g_signal_connect(allowed_tree_, "row-expanded", + G_CALLBACK(OnTreeViewRowExpandedThunk), this); + + // 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()); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_box_pack_start(GTK_BOX(cookie_list_vbox), label, FALSE, FALSE, 0); + + scroll_window = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll_window), + GTK_SHADOW_ETCHED_IN); + gtk_box_pack_start(GTK_BOX(cookie_list_vbox), scroll_window, TRUE, TRUE, 0); + + blocked_cookies_tree_model_.reset( + content_settings->GetBlockedCookiesTreeModel()); + blocked_cookies_tree_adapter_.reset( + 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_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_); + + title_column = gtk_tree_view_column_new(); + pixbuf_renderer = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(title_column, pixbuf_renderer, FALSE); + gtk_tree_view_column_add_attribute(title_column, pixbuf_renderer, "pixbuf", + gtk_tree::TreeAdapter::COL_ICON); + title_renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(title_column, title_renderer, TRUE); + gtk_tree_view_column_add_attribute(title_column, title_renderer, "text", + gtk_tree::TreeAdapter::COL_TITLE); + gtk_tree_view_column_set_title( + title_column, l10n_util::GetStringUTF8( + IDS_COOKIES_DOMAIN_COLUMN_HEADER).c_str()); + gtk_tree_view_append_column(GTK_TREE_VIEW(blocked_tree_), title_column); + g_signal_connect(blocked_tree_, "row-expanded", + G_CALLBACK(OnTreeViewRowExpandedThunk), this); + + // Close button. + GtkWidget* button_box = gtk_hbutton_box_new(); + gtk_button_box_set_layout(GTK_BUTTON_BOX(button_box), GTK_BUTTONBOX_END); + gtk_box_set_spacing(GTK_BOX(button_box), gtk_util::kControlSpacing); + gtk_box_pack_end(GTK_BOX(dialog_), button_box, FALSE, TRUE, 0); + GtkWidget* close = gtk_button_new_from_stock(GTK_STOCK_CLOSE); + gtk_button_set_label(GTK_BUTTON(close), + l10n_util::GetStringUTF8(IDS_CLOSE).c_str()); + g_signal_connect(close, "clicked", G_CALLBACK(OnCloseThunk), this); + gtk_box_pack_end(GTK_BOX(button_box), close, FALSE, TRUE, 0); + + // Show the dialog. + allowed_cookies_tree_adapter_->Init(); + blocked_cookies_tree_adapter_->Init(); + window_ = tab_contents_->CreateConstrainedDialog(this); +} + +CollectedCookiesGtk::~CollectedCookiesGtk() { + gtk_widget_destroy(dialog_); +} + +GtkWidget* CollectedCookiesGtk::GetWidgetRoot() { + return dialog_; +} + +void CollectedCookiesGtk::DeleteDelegate() { + delete this; +} + +void CollectedCookiesGtk::Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) { + DCHECK(type == NotificationType::COLLECTED_COOKIES_SHOWN); + DCHECK_EQ(Source<TabSpecificContentSettings>(source).ptr(), + tab_contents_->GetTabSpecificContentSettings()); + window_->CloseConstrainedWindow(); +} + +void CollectedCookiesGtk::OnClose(GtkWidget* close_button) { + window_->CloseConstrainedWindow(); +} + +void CollectedCookiesGtk::OnTreeViewRowExpanded(GtkWidget* tree_view, + GtkTreeIter* iter, + GtkTreePath* path) { + // When a row in the tree is expanded, expand all the children too. + g_signal_handlers_block_by_func( + tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); + gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); + g_signal_handlers_unblock_by_func( + tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); +} diff --git a/chrome/browser/gtk/collected_cookies_gtk.h b/chrome/browser/gtk/collected_cookies_gtk.h new file mode 100644 index 0000000..0691d06 --- /dev/null +++ b/chrome/browser/gtk/collected_cookies_gtk.h @@ -0,0 +1,78 @@ +// 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. + +// This is the Gtk implementation of the collected Cookies dialog. + +#ifndef CHROME_BROWSER_GTK_COLLECTED_COOKIES_GTK_H_ +#define CHROME_BROWSER_GTK_COLLECTED_COOKIES_GTK_H_ + +#include <gtk/gtk.h> + +#include "app/gtk_signal.h" +#include "base/scoped_ptr.h" +#include "chrome/browser/gtk/constrained_window_gtk.h" +#include "chrome/browser/gtk/gtk_tree.h" +#include "chrome/common/notification_registrar.h" + +class CookiesTreeModel; + +// CollectedCookiesGtk is a dialog that displays the allowed and blocked +// cookies of the current tab contents. To display the dialog, invoke +// ShowCollectedCookiesDialog() on the delegate of the tab contents. + +class CollectedCookiesGtk : public ConstrainedDialogDelegate, + gtk_tree::TreeAdapter::Delegate, + NotificationObserver { + public: + CollectedCookiesGtk(GtkWindow* parent, TabContents* tab_contents); + + // ConstrainedDialogDelegate methods. + virtual GtkWidget* GetWidgetRoot(); + virtual void DeleteDelegate(); + + private: + virtual ~CollectedCookiesGtk(); + + void Init(); + + // Notification Observer implementation. + void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + // Callbacks. + CHROMEGTK_CALLBACK_2(CollectedCookiesGtk, void, OnTreeViewRowExpanded, + GtkTreeIter*, GtkTreePath*); + CHROMEGTK_CALLBACK_0(CollectedCookiesGtk, void, OnClose); + + NotificationRegistrar registrar_; + + ConstrainedWindow* window_; + + // Widgets of the dialog. + GtkWidget* dialog_; + + GtkWidget* allowed_description_label_; + GtkWidget* blocked_description_label_; + + // The table listing the cookies. + GtkWidget* allowed_tree_; + GtkWidget* blocked_tree_; + + GtkWidget* allowed_cookie_display_; + GtkWidget* blocked_cookie_display_; + + // The tab contents. + TabContents* tab_contents_; + + // The Cookies Table model. + scoped_ptr<CookiesTreeModel> allowed_cookies_tree_model_; + scoped_ptr<CookiesTreeModel> blocked_cookies_tree_model_; + scoped_ptr<gtk_tree::TreeAdapter> allowed_cookies_tree_adapter_; + scoped_ptr<gtk_tree::TreeAdapter> blocked_cookies_tree_adapter_; + + DISALLOW_COPY_AND_ASSIGN(CollectedCookiesGtk); +}; + +#endif // CHROME_BROWSER_GTK_COLLECTED_COOKIES_GTK_H_ diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h index 9f80870..fb6fcc63 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -259,6 +259,9 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate { // Shows the Content Settings dialog for a given content type. virtual void ShowContentSettingsWindow(ContentSettingsType content_type) {} + // Shows the cookies collected in the tab contents. + virtual void ShowCollectedCookiesDialog(TabContents* tab_contents) {} + // Allows delegate to override navigation to the history entries. // Returns true to allow TabContents to continue with the default processing. virtual bool OnGoToEntryOffset(int offset) { diff --git a/chrome/browser/tab_contents/tab_specific_content_settings.cc b/chrome/browser/tab_contents/tab_specific_content_settings.cc index fe175f5..57b9a2b 100644 --- a/chrome/browser/tab_contents/tab_specific_content_settings.cc +++ b/chrome/browser/tab_contents/tab_specific_content_settings.cc @@ -8,6 +8,7 @@ #include "chrome/browser/browsing_data_appcache_helper.h" #include "chrome/browser/browsing_data_database_helper.h" #include "chrome/browser/browsing_data_local_storage_helper.h" +#include "chrome/browser/cookies_tree_model.h" #include "net/base/cookie_monster.h" bool TabSpecificContentSettings::IsContentBlocked( @@ -126,6 +127,14 @@ void TabSpecificContentSettings::GeolocationDidNavigate( geolocation_settings_state_.DidNavigate(details); } +CookiesTreeModel* TabSpecificContentSettings::GetAllowedCookiesTreeModel() { + return allowed_local_shared_objects_.GetCookiesTreeModel(); +} + +CookiesTreeModel* TabSpecificContentSettings::GetBlockedCookiesTreeModel() { + return blocked_local_shared_objects_.GetCookiesTreeModel(); +} + TabSpecificContentSettings::LocalSharedObjectsContainer:: LocalSharedObjectsContainer(Profile* profile) : cookies_(new net::CookieMonster(NULL, NULL)), @@ -144,3 +153,9 @@ void TabSpecificContentSettings::LocalSharedObjectsContainer::Reset() { databases_->Reset(); local_storages_->Reset(); } + +CookiesTreeModel* +TabSpecificContentSettings::LocalSharedObjectsContainer::GetCookiesTreeModel() { + return new CookiesTreeModel( + cookies_, databases_, local_storages_, appcaches_); +} diff --git a/chrome/browser/tab_contents/tab_specific_content_settings.h b/chrome/browser/tab_contents/tab_specific_content_settings.h index 18f78d8..12b557f 100644 --- a/chrome/browser/tab_contents/tab_specific_content_settings.h +++ b/chrome/browser/tab_contents/tab_specific_content_settings.h @@ -15,6 +15,7 @@ class CannedBrowsingDataAppCacheHelper; class CannedBrowsingDataDatabaseHelper; class CannedBrowsingDataLocalStorageHelper; +class CookiesTreeModel; class Profile; namespace net { @@ -57,6 +58,12 @@ class TabSpecificContentSettings return geolocation_settings_state_; } + // Returns a CookiesTreeModel object for the recoreded allowed cookies. + CookiesTreeModel* GetAllowedCookiesTreeModel(); + + // Returns a CookiesTreeModel object for the recoreded blocked cookies. + CookiesTreeModel* GetBlockedCookiesTreeModel(); + // RenderViewHostDelegate::ContentSettings implementation. virtual void OnContentBlocked(ContentSettingsType type); virtual void OnCookieAccessed(const GURL& url, @@ -93,6 +100,8 @@ class TabSpecificContentSettings return local_storages_; } + CookiesTreeModel* GetCookiesTreeModel(); + private: DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer); diff --git a/chrome/browser/views/browser_dialogs.h b/chrome/browser/views/browser_dialogs.h index 1697f13..2adac51 100644 --- a/chrome/browser/views/browser_dialogs.h +++ b/chrome/browser/views/browser_dialogs.h @@ -113,6 +113,10 @@ void ShowContentSettingsWindow(gfx::NativeWindow parent_window, ContentSettingsType content_type, Profile* profile); +// Shows the collected cookies dialog box. +void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, + TabContents* tab_contents); + // Shows the create web app shortcut dialog box. void ShowCreateShortcutsDialog(gfx::NativeWindow parent_window, TabContents* tab_contents); diff --git a/chrome/browser/views/collected_cookies_win.cc b/chrome/browser/views/collected_cookies_win.cc new file mode 100644 index 0000000..b5e5c3c --- /dev/null +++ b/chrome/browser/views/collected_cookies_win.cc @@ -0,0 +1,157 @@ +// 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. + +#include "chrome/browser/views/collected_cookies_win.h" + +#include "app/l10n_util.h" +#include "chrome/browser/cookies_tree_model.h" +#include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/common/notification_service.h" +#include "grit/generated_resources.h" +#include "grit/locale_settings.h" +#include "views/controls/label.h" +#include "views/controls/tree/tree_view.h" +#include "views/standard_layout.h" +#include "views/window/window.h" + +namespace browser { + +// Declared in browser_dialogs.h so others don't have to depend on our header. +void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, + TabContents* tab_contents) { + // Deletes itself on close. + new CollectedCookiesWin(parent_window, tab_contents); +} + +} // namespace browser + + +/////////////////////////////////////////////////////////////////////////////// +// CollectedCookiesWin, constructor and destructor: + +CollectedCookiesWin::CollectedCookiesWin(gfx::NativeWindow parent_window, + TabContents* tab_contents) + : tab_contents_(tab_contents) { + TabSpecificContentSettings* content_settings = + tab_contents->GetTabSpecificContentSettings(); + registrar_.Add(this, NotificationType::COLLECTED_COOKIES_SHOWN, + Source<TabSpecificContentSettings>(content_settings)); + + Init(); + + window_ = tab_contents_->CreateConstrainedDialog(this); +} + +CollectedCookiesWin::~CollectedCookiesWin() { + allowed_cookies_tree_->SetModel(NULL); + blocked_cookies_tree_->SetModel(NULL); +} + +void CollectedCookiesWin::Init() { + TabSpecificContentSettings* content_settings = + tab_contents_->GetTabSpecificContentSettings(); + + // Allowed Cookie list. + allowed_label_ = new views::Label( + l10n_util::GetString(IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL)); + allowed_cookies_tree_model_.reset( + content_settings->GetAllowedCookiesTreeModel()); + allowed_cookies_tree_ = new views::TreeView(); + allowed_cookies_tree_->SetModel(allowed_cookies_tree_model_.get()); + allowed_cookies_tree_->SetRootShown(false); + allowed_cookies_tree_->SetEditable(false); + allowed_cookies_tree_->set_lines_at_root(true); + allowed_cookies_tree_->set_auto_expand_children(true); + + // Blocked Cookie list. + blocked_label_ = new views::Label( + l10n_util::GetString(IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL)); + blocked_cookies_tree_model_.reset( + content_settings->GetBlockedCookiesTreeModel()); + blocked_cookies_tree_ = new views::TreeView(); + blocked_cookies_tree_->SetModel(blocked_cookies_tree_model_.get()); + blocked_cookies_tree_->SetRootShown(false); + blocked_cookies_tree_->SetEditable(false); + blocked_cookies_tree_->set_lines_at_root(true); + blocked_cookies_tree_->set_auto_expand_children(true); + + using views::GridLayout; + + GridLayout* layout = CreatePanelGridLayout(this); + SetLayoutManager(layout); + + const int single_column_layout_id = 0; + views::ColumnSet* column_set = layout->AddColumnSet(single_column_layout_id); + column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, + GridLayout::USE_PREF, 0, 0); + + layout->StartRow(0, single_column_layout_id); + layout->AddView(allowed_label_); + + layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); + layout->StartRow(1, single_column_layout_id); + layout->AddView( + allowed_cookies_tree_, 1, 1, GridLayout::FILL, GridLayout::FILL); + layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); + + layout->StartRow(0, single_column_layout_id); + layout->AddView(blocked_label_); + + layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); + layout->StartRow(1, single_column_layout_id); + layout->AddView( + blocked_cookies_tree_, 1, 1, GridLayout::FILL, GridLayout::FILL); +} + +/////////////////////////////////////////////////////////////////////////////// +// views::DialogDelegate implementation. + +std::wstring CollectedCookiesWin::GetWindowTitle() const { + return l10n_util::GetString(IDS_COLLECTED_COOKIES_DIALOG_TITLE); +} + +int CollectedCookiesWin::GetDialogButtons() const { + return MessageBoxFlags::DIALOGBUTTON_CANCEL; +} + +std::wstring CollectedCookiesWin::GetDialogButtonLabel( + MessageBoxFlags::DialogButton button) const { + return l10n_util::GetString(IDS_CLOSE); +} + +void CollectedCookiesWin::DeleteDelegate() { + delete this; +} + +bool CollectedCookiesWin::Cancel() { + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// views::WindowDelegate implementation. + +views::View* CollectedCookiesWin::GetContentsView() { + return this; +} + +/////////////////////////////////////////////////////////////////////////////// +// views::View implementation. + +gfx::Size CollectedCookiesWin::GetPreferredSize() { + return gfx::Size(views::Window::GetLocalizedContentsSize( + IDS_COOKIES_DIALOG_WIDTH_CHARS, + IDS_COOKIES_DIALOG_HEIGHT_LINES)); +} + +/////////////////////////////////////////////////////////////////////////////// +// NotificationObserver implementation. + +void CollectedCookiesWin::Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) { + DCHECK(type == NotificationType::COLLECTED_COOKIES_SHOWN); + DCHECK_EQ(Source<TabSpecificContentSettings>(source).ptr(), + tab_contents_->GetTabSpecificContentSettings()); + window_->CloseConstrainedWindow(); +} diff --git a/chrome/browser/views/collected_cookies_win.h b/chrome/browser/views/collected_cookies_win.h new file mode 100644 index 0000000..16b5f89 --- /dev/null +++ b/chrome/browser/views/collected_cookies_win.h @@ -0,0 +1,79 @@ +// 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. + +// This is the Views implementation of the collected Cookies dialog. + +#ifndef CHROME_BROWSER_VIEWS_COLLECTED_COOKIES_WIN_H_ +#define CHROME_BROWSER_VIEWS_COLLECTED_COOKIES_WIN_H_ + +#include "chrome/browser/tab_contents/constrained_window.h" +#include "chrome/common/notification_registrar.h" +#include "views/window/dialog_delegate.h" + +class ConstrainedWindow; +class CookiesTreeModel; +class TabContents; +namespace views { +class Label; +class TreeView; +} + +// CollectedCookiesWin is a dialog that displays the allowed and blocked +// cookies of the current tab contents. To display the dialog, invoke +// ShowCollectedCookiesDialog() on the delegate of the tab contents. + +class CollectedCookiesWin : public ConstrainedDialogDelegate, + NotificationObserver, + views::View { + public: + // Use BrowserWindow::ShowCollectedCookiesDialog to show. + CollectedCookiesWin(gfx::NativeWindow parent_window, + TabContents* tab_contents); + + // views::DialogDelegate implementation. + virtual std::wstring GetWindowTitle() const; + virtual int GetDialogButtons() const; + virtual std::wstring GetDialogButtonLabel( + MessageBoxFlags::DialogButton button) const; + virtual void DeleteDelegate(); + + virtual bool Cancel(); + + // views::WindowDelegate implementation. + virtual views::View* GetContentsView(); + + // views::View implementation. + gfx::Size GetPreferredSize(); + + private: + virtual ~CollectedCookiesWin(); + + void Init(); + + // Notification Observer implementation. + void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + NotificationRegistrar registrar_; + + ConstrainedWindow* window_; + + // The tab contents. + TabContents* tab_contents_; + + // Assorted views. + views::Label* allowed_label_; + views::Label* blocked_label_; + + views::TreeView* allowed_cookies_tree_; + views::TreeView* blocked_cookies_tree_; + + scoped_ptr<CookiesTreeModel> allowed_cookies_tree_model_; + scoped_ptr<CookiesTreeModel> blocked_cookies_tree_model_; + + DISALLOW_COPY_AND_ASSIGN(CollectedCookiesWin); +}; + +#endif // CHROME_BROWSER_VIEWS_COLLECTED_COOKIES_WIN_H_ diff --git a/chrome/browser/views/dialog_stubs_gtk.cc b/chrome/browser/views/dialog_stubs_gtk.cc index 7e06c23..a8e4535 100644 --- a/chrome/browser/views/dialog_stubs_gtk.cc +++ b/chrome/browser/views/dialog_stubs_gtk.cc @@ -11,6 +11,7 @@ #include "chrome/browser/gtk/about_chrome_dialog.h" #include "chrome/browser/fonts_languages_window.h" #include "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h" +#include "chrome/browser/gtk/collected_cookies_gtk.h" #include "chrome/browser/gtk/edit_search_engine_dialog.h" #include "chrome/browser/gtk/keyword_editor_view.h" #include "chrome/browser/gtk/options/content_settings_window_gtk.h" @@ -70,4 +71,9 @@ void ShowContentSettingsWindow(gfx::NativeWindow parent_window, ContentSettingsWindowGtk::Show(parent_window, content_type, profile); } +void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, + TabContents* tab_contents) { + new CollectedCookiesGtk(GTK_WINDOW(parent_window), tab_contents); +} + } // namespace browser diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 7b019bb..304f6fc 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -1089,6 +1089,10 @@ void BrowserView::ShowContentSettingsWindow(ContentSettingsType content_type, browser::ShowContentSettingsWindow(GetNativeHandle(), content_type, profile); } +void BrowserView::ShowCollectedCookiesDialog(TabContents* tab_contents) { + browser::ShowCollectedCookiesDialog(GetNativeHandle(), tab_contents); +} + void BrowserView::ShowProfileErrorDialog(int message_id) { #if defined(OS_WIN) std::wstring title = l10n_util::GetString(IDS_PRODUCT_NAME); diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index ab89256..1300bc4 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -311,6 +311,7 @@ class BrowserView : public BrowserBubbleHost, virtual void ShowRepostFormWarningDialog(TabContents* tab_contents); virtual void ShowContentSettingsWindow(ContentSettingsType content_type, Profile* profile); + virtual void ShowCollectedCookiesDialog(TabContents* tab_contents); virtual void ShowProfileErrorDialog(int message_id); virtual void ShowThemeInstallBubble(); virtual void ConfirmBrowserCloseWithPendingDownloads(); diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index e20589b..ed32143 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -705,6 +705,8 @@ 'browser/cocoa/clear_browsing_data_controller.mm', 'browser/cocoa/clickhold_button_cell.h', 'browser/cocoa/clickhold_button_cell.mm', + 'browser/cocoa/collected_cookies_mac.h', + 'browser/cocoa/collected_cookies_mac.mm', 'browser/cocoa/command_observer_bridge.h', 'browser/cocoa/command_observer_bridge.mm', 'browser/cocoa/constrained_window_mac.h', @@ -1424,6 +1426,8 @@ 'browser/gtk/certificate_viewer.h', 'browser/gtk/clear_browsing_data_dialog_gtk.cc', 'browser/gtk/clear_browsing_data_dialog_gtk.h', + 'browser/gtk/collected_cookies_gtk.cc', + 'browser/gtk/collected_cookies_gtk.h', 'browser/gtk/constrained_window_gtk.cc', 'browser/gtk/constrained_window_gtk.h', 'browser/gtk/content_setting_bubble_gtk.cc', @@ -2468,6 +2472,8 @@ 'browser/views/chrome_views_delegate.h', 'browser/views/clear_browsing_data.cc', 'browser/views/clear_browsing_data.h', + 'browser/views/collected_cookies_win.cc', + 'browser/views/collected_cookies_win.h', 'browser/views/confirm_message_box_dialog.cc', 'browser/views/confirm_message_box_dialog.h', 'browser/views/constrained_window_win.cc', @@ -3004,6 +3010,7 @@ 'app/nibs/BookmarkEditor.xib', 'app/nibs/BookmarkNameFolder.xib', 'app/nibs/ClearBrowsingData.xib', + 'app/nibs/CollectedCookies.xib', 'app/nibs/Cookies.xib', 'app/nibs/CookieDetailsView.xib', 'app/nibs/CookiePrompt.xib', @@ -3365,6 +3372,8 @@ ['include', '^browser/gtk/certificate_dialogs.h'], ['include', '^browser/gtk/certificate_viewer.cc'], ['include', '^browser/gtk/certificate_viewer.h'], + ['include', '^browser/gtk/collected_cookies_gtk.cc'], + ['include', '^browser/gtk/collected_cookies_gtk.h'], ['include', '^browser/gtk/constrained_window_gtk.cc'], ['include', '^browser/gtk/constrained_window_gtk.h'], ['include', '^browser/gtk/gtk_chrome_cookie_view.cc'], diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi index ec225ce..4233517 100644 --- a/chrome/chrome_dll.gypi +++ b/chrome/chrome_dll.gypi @@ -204,6 +204,7 @@ 'app/nibs/BookmarkNameFolder.xib', 'app/nibs/BrowserWindow.xib', 'app/nibs/ClearBrowsingData.xib', + 'app/nibs/CollectedCookies.xib', 'app/nibs/Cookies.xib', 'app/nibs/CookieDetailsView.xib', 'app/nibs/CookiePrompt.xib', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 630b1d1..3b21a6d 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -283,6 +283,7 @@ 'browser/appcache/appcache_ui_test.cc', 'browser/browser_encoding_uitest.cc', 'browser/browser_uitest.cc', + 'browser/collected_cookies_uitest.cc', 'browser/cookie_modal_dialog_uitest.cc', 'browser/dom_ui/bookmarks_ui_uitest.cc', 'browser/dom_ui/new_tab_ui_uitest.cc', @@ -670,6 +671,7 @@ 'browser/cocoa/clickhold_button_cell_unittest.mm', 'browser/cocoa/cocoa_test_helper.h', 'browser/cocoa/cocoa_test_helper.mm', + 'browser/cocoa/collected_cookies_mac_unittest.mm', 'browser/cocoa/command_observer_bridge_unittest.mm', 'browser/cocoa/content_blocked_bubble_controller_unittest.mm', 'browser/cocoa/content_exceptions_window_controller_unittest.mm', diff --git a/chrome/common/notification_type.h b/chrome/common/notification_type.h index 032febc..19b0465 100644 --- a/chrome/common/notification_type.h +++ b/chrome/common/notification_type.h @@ -975,6 +975,10 @@ class NotificationType { // object, the details are ContentSettingsNotificationsDetails. CONTENT_SETTINGS_CHANGED, + // Sent when the collect cookies dialog is shown. The source is a + // TabSpecificContentSettings object, there are no details. + COLLECTED_COOKIES_SHOWN, + // Sync -------------------------------------------------------------------- // Sent when the sync backend has been paused. diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index bdb0d07..7e5282c 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -1394,7 +1394,13 @@ IPC_BEGIN_MESSAGES(Automation) // profile of the tab identified by the first parameter. The second // parameter is the cookie name. IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_DeleteCookie, GURL, std::string, - int, bool) + int /* tab handle */, + bool /* result */) + + // This message triggers the collected cookies dialog for a specific tab. + IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ShowCollectedCookiesDialog, + int /* tab handle */, + bool /* result */) // This message requests the external tab identified by the tab handle // passed in be closed. diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index a4711ca..15d00d0 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -459,6 +459,12 @@ bool TabProxy::DeleteCookie(const GURL& url, const std::string& name) { return succeeded; } +bool TabProxy::ShowCollectedCookiesDialog() { + bool succeeded = false; + return sender_->Send(new AutomationMsg_ShowCollectedCookiesDialog( + 0, handle_, &succeeded)) && succeeded; +} + int TabProxy::InspectElement(int x, int y) { if (!is_valid()) return -1; diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index 3c33318..f2dcb33 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -247,6 +247,10 @@ class TabProxy : public AutomationResourceProxy, bool DeleteCookie(const GURL& url, const std::string& name) WARN_UNUSED_RESULT; + // Opens the collected cookies dialog for the current tab. This function can + // be invoked on any valid tab. + bool ShowCollectedCookiesDialog() WARN_UNUSED_RESULT; + // Sends a InspectElement message for the current tab. |x| and |y| are the // coordinates that we want to simulate that the user is trying to inspect. int InspectElement(int x, int y); diff --git a/chrome/test/test_browser_window.h b/chrome/test/test_browser_window.h index 1039a81..7e801c1 100644 --- a/chrome/test/test_browser_window.h +++ b/chrome/test/test_browser_window.h @@ -86,6 +86,7 @@ class TestBrowserWindow : public BrowserWindow { virtual void ShowRepostFormWarningDialog(TabContents* tab_contents) {} virtual void ShowContentSettingsWindow(ContentSettingsType content_type, Profile* profile) {} + virtual void ShowCollectedCookiesDialog(TabContents* tab_contents) {} virtual void ShowProfileErrorDialog(int message_id) {} virtual void ShowThemeInstallBubble() {} virtual void ConfirmBrowserCloseWithPendingDownloads() {} |