summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 21:57:57 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 21:57:57 +0000
commitc0d33cd059a742b2daf283965392700328b80a81 (patch)
treee28615904b0e6496c55802016f8c7c2e27d9ff52 /chrome
parentfad9ef5cb3f55eba164ff4e63db803c5a7fa17a5 (diff)
downloadchromium_src-c0d33cd059a742b2daf283965392700328b80a81.zip
chromium_src-c0d33cd059a742b2daf283965392700328b80a81.tar.gz
chromium_src-c0d33cd059a742b2daf283965392700328b80a81.tar.bz2
Initial download shelf on OS X.
This has lots of missing stuff (e.g. a custom download item view that shows download progress, the popup is the same for in-progress and completed downloads, no animation, everything looks ugly, the info bubble overlaps the shelf when it's visible, no "open download manager page" link, etc), but the basic functionality is hooked up: The shelf appears when files are downloaded, and something ugly is added to the shelf for each download. The popup's "Reveral in Finder" even works. The shelf is per-window as it should be. BUG=12500 TEST=Download something and check the shelf appears. Click the close button and make sure it disappears again. Review URL: http://codereview.chromium.org/93129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18757 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/nibs/en.lproj/DownloadShelf.xib1240
-rw-r--r--chrome/browser/browser.cc2
-rw-r--r--chrome/browser/cocoa/browser_window_cocoa.mm10
-rw-r--r--chrome/browser/cocoa/browser_window_controller.h7
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm21
-rw-r--r--chrome/browser/cocoa/download_item_mac.h47
-rw-r--r--chrome/browser/cocoa/download_item_mac.mm164
-rw-r--r--chrome/browser/cocoa/download_shelf_controller.h45
-rw-r--r--chrome/browser/cocoa/download_shelf_controller.mm114
-rw-r--r--chrome/browser/cocoa/download_shelf_mac.h44
-rw-r--r--chrome/browser/cocoa/download_shelf_mac.mm69
-rw-r--r--chrome/browser/cocoa/download_shelf_mac_unittest.mm91
-rw-r--r--chrome/browser/cocoa/download_shelf_view.h17
-rw-r--r--chrome/browser/cocoa/download_shelf_view.mm61
-rw-r--r--chrome/browser/download/download_manager.cc5
-rw-r--r--chrome/browser/download/save_package.cc5
-rw-r--r--chrome/chrome.gyp13
-rw-r--r--chrome/common/temp_scaffolding_stubs.cc14
-rw-r--r--chrome/common/temp_scaffolding_stubs.h25
19 files changed, 1948 insertions, 46 deletions
diff --git a/chrome/app/nibs/en.lproj/DownloadShelf.xib b/chrome/app/nibs/en.lproj/DownloadShelf.xib
new file mode 100644
index 0000000..1bfa275
--- /dev/null
+++ b/chrome/app/nibs/en.lproj/DownloadShelf.xib
@@ -0,0 +1,1240 @@
+<?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">9J61</string>
+ <string key="IBDocument.InterfaceBuilderVersion">677</string>
+ <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.HIToolboxVersion">353.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </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">DownloadShelfController</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="NSCustomView" id="1005">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">290</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="538957441">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{456, 12}, {15, 15}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="104399124">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="538957441"/>
+ <int key="NSButtonFlags">142360831</int>
+ <int key="NSButtonFlags2">6</int>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar</string>
+ </object>
+ <object class="NSCustomResource" key="NSAlternateImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar_p</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 40}</string>
+ <reference key="NSSuperview"/>
+ <string key="NSClassName">DownloadShelfView</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="538957441"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">9</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="1002">
+ <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="1002"/>
+ <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="1002"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="1002"/>
+ <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="538957441"/>
+ </object>
+ <reference key="parent" ref="1002"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="538957441"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="104399124"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="104399124"/>
+ <reference key="parent" ref="538957441"/>
+ </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.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>3.IBPluginDependency</string>
+ <string>4.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>{{509, 905}, {480, 40}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{628, 654}</string>
+ <string>{{357, 416}, {480, 272}}</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">9</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfController</string>
+ <string key="superclassName">NSViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>hide:</string>
+ <string>show:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_controller.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_view.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>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../../../chrome.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
+<?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">9J61</string>
+ <string key="IBDocument.InterfaceBuilderVersion">677</string>
+ <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.HIToolboxVersion">353.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </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">DownloadShelfController</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="NSCustomView" id="1005">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">290</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="538957441">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{456, 12}, {15, 15}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="104399124">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="538957441"/>
+ <int key="NSButtonFlags">142360831</int>
+ <int key="NSButtonFlags2">6</int>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar</string>
+ </object>
+ <object class="NSCustomResource" key="NSAlternateImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar_p</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 40}</string>
+ <reference key="NSSuperview"/>
+ <string key="NSClassName">DownloadShelfView</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="538957441"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">9</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="1002">
+ <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="1002"/>
+ <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="1002"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="1002"/>
+ <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="538957441"/>
+ </object>
+ <reference key="parent" ref="1002"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="538957441"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="104399124"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="104399124"/>
+ <reference key="parent" ref="538957441"/>
+ </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.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>3.IBPluginDependency</string>
+ <string>4.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>{{509, 905}, {480, 40}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{628, 654}</string>
+ <string>{{357, 416}, {480, 272}}</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">9</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfController</string>
+ <string key="superclassName">NSViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>hide:</string>
+ <string>show:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_controller.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_view.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>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../../../chrome.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
+<?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">9J61</string>
+ <string key="IBDocument.InterfaceBuilderVersion">677</string>
+ <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.HIToolboxVersion">353.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </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">DownloadShelfController</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="NSCustomView" id="1005">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">290</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="538957441">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{456, 12}, {15, 15}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="104399124">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="538957441"/>
+ <int key="NSButtonFlags">142360831</int>
+ <int key="NSButtonFlags2">6</int>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar</string>
+ </object>
+ <object class="NSCustomResource" key="NSAlternateImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar_p</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 40}</string>
+ <reference key="NSSuperview"/>
+ <string key="NSClassName">DownloadShelfView</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="538957441"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">9</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="1002">
+ <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="1002"/>
+ <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="1002"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="1002"/>
+ <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="538957441"/>
+ </object>
+ <reference key="parent" ref="1002"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="538957441"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="104399124"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="104399124"/>
+ <reference key="parent" ref="538957441"/>
+ </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.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>3.IBPluginDependency</string>
+ <string>4.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>{{509, 905}, {480, 40}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{628, 654}</string>
+ <string>{{357, 416}, {480, 272}}</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">9</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfController</string>
+ <string key="superclassName">NSViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>hide:</string>
+ <string>show:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_controller.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_view.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>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../../../chrome.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
+<?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">9J61</string>
+ <string key="IBDocument.InterfaceBuilderVersion">677</string>
+ <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.HIToolboxVersion">353.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </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">DownloadShelfController</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="NSCustomView" id="1005">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">290</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="538957441">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{456, 12}, {15, 15}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="104399124">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="538957441"/>
+ <int key="NSButtonFlags">142360831</int>
+ <int key="NSButtonFlags2">6</int>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar</string>
+ </object>
+ <object class="NSCustomResource" key="NSAlternateImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar_p</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 40}</string>
+ <reference key="NSSuperview"/>
+ <string key="NSClassName">DownloadShelfView</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="538957441"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">9</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="1002">
+ <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="1002"/>
+ <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="1002"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="1002"/>
+ <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="538957441"/>
+ </object>
+ <reference key="parent" ref="1002"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="538957441"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="104399124"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="104399124"/>
+ <reference key="parent" ref="538957441"/>
+ </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.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>3.IBPluginDependency</string>
+ <string>4.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>{{509, 905}, {480, 40}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{628, 654}</string>
+ <string>{{357, 416}, {480, 272}}</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">9</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfController</string>
+ <string key="superclassName">NSViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>hide:</string>
+ <string>show:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_controller.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_view.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>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../../../chrome.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
+<?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">9J61</string>
+ <string key="IBDocument.InterfaceBuilderVersion">677</string>
+ <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.HIToolboxVersion">353.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </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">DownloadShelfController</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="NSCustomView" id="1005">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">290</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="538957441">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{456, 12}, {15, 15}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="104399124">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="538957441"/>
+ <int key="NSButtonFlags">142360831</int>
+ <int key="NSButtonFlags2">6</int>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar</string>
+ </object>
+ <object class="NSCustomResource" key="NSAlternateImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">close_bar_p</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 40}</string>
+ <reference key="NSSuperview"/>
+ <string key="NSClassName">DownloadShelfView</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="538957441"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">9</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="1002">
+ <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="1002"/>
+ <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="1002"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="1002"/>
+ <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="538957441"/>
+ </object>
+ <reference key="parent" ref="1002"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="538957441"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="104399124"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="104399124"/>
+ <reference key="parent" ref="538957441"/>
+ </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.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>3.IBPluginDependency</string>
+ <string>4.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>{{509, 905}, {480, 40}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{628, 654}</string>
+ <string>{{357, 416}, {480, 272}}</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">9</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfController</string>
+ <string key="superclassName">NSViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>hide:</string>
+ <string>show:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_controller.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">DownloadShelfView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/download_shelf_view.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>
+ </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/browser.cc b/chrome/browser/browser.cc
index 38f5818..5bba572 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1277,9 +1277,7 @@ void Browser::ExecuteCommandWithDisposition(
case IDC_NEW_WINDOW_PROFILE_7:
case IDC_NEW_WINDOW_PROFILE_8:
NewProfileWindowByIndex(id - IDC_NEW_WINDOW_PROFILE_0); break;
-#if defined(OS_WIN) || defined(OS_LINUX)
case IDC_CLOSE_WINDOW: CloseWindow(); break;
-#endif
case IDC_NEW_TAB: NewTab(); break;
case IDC_CLOSE_TAB: CloseTab(); break;
case IDC_SELECT_NEXT_TAB: SelectNextTab(); break;
diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm
index f295167..28f87ae9 100644
--- a/chrome/browser/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/cocoa/browser_window_cocoa.mm
@@ -9,6 +9,7 @@
#include "chrome/browser/cocoa/browser_window_cocoa.h"
#import "chrome/browser/cocoa/browser_window_controller.h"
#import "chrome/browser/cocoa/clear_browsing_data_controller.h"
+#import "chrome/browser/cocoa/download_shelf_controller.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/download/download_shelf.h"
#include "chrome/common/notification_service.h"
@@ -188,15 +189,12 @@ void BrowserWindowCocoa::ShowBookmarkBubble(const GURL& url,
}
bool BrowserWindowCocoa::IsDownloadShelfVisible() const {
- return download_shelf_ != NULL && download_shelf_->IsShowing();
+ return [controller_ isDownloadShelfVisible] != NO;
}
DownloadShelf* BrowserWindowCocoa::GetDownloadShelf() {
- NOTIMPLEMENTED();
- if (!download_shelf_.get()) {
- download_shelf_.reset(new DownloadShelfMac(browser_));
- }
- return download_shelf_.get();
+ DownloadShelfController* shelfController = [controller_ downloadShelf];
+ return [shelfController bridge];
}
void BrowserWindowCocoa::ShowReportBugDialog() {
diff --git a/chrome/browser/cocoa/browser_window_controller.h b/chrome/browser/cocoa/browser_window_controller.h
index e567db7..ab90f2e 100644
--- a/chrome/browser/cocoa/browser_window_controller.h
+++ b/chrome/browser/cocoa/browser_window_controller.h
@@ -20,6 +20,7 @@
class Browser;
class BrowserWindow;
class BrowserWindowCocoa;
+@class DownloadShelfController;
@class FindBarCocoaController;
class LocationBar;
class StatusBubble;
@@ -50,6 +51,7 @@ class TabStripModelObserverBridge;
scoped_nsobject<TabStripController> tabStripController_;
scoped_nsobject<FindBarCocoaController> findBarCocoaController_;
scoped_ptr<StatusBubble> statusBubble_;
+ scoped_nsobject<DownloadShelfController> downloadShelfController_;
BOOL ownsBrowser_; // Only ever NO when testing
}
@@ -97,6 +99,11 @@ class TabStripModelObserverBridge;
- (void)toggleBookmarkBar;
+- (BOOL)isDownloadShelfVisible;
+
+// Lazily creates the download shelf in visible state if it doesn't exist yet.
+- (DownloadShelfController*)downloadShelf;
+
// Retains the given FindBarCocoaController and adds its view to this
// browser window. Must only be called once per
// BrowserWindowController.
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index 994694f..d814c36 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -17,6 +17,7 @@
#import "chrome/browser/cocoa/bookmark_bar_controller.h"
#import "chrome/browser/cocoa/browser_window_cocoa.h"
#import "chrome/browser/cocoa/browser_window_controller.h"
+#import "chrome/browser/cocoa/download_shelf_controller.h"
#import "chrome/browser/cocoa/find_bar_cocoa_controller.h"
#include "chrome/browser/cocoa/find_bar_bridge.h"
#import "chrome/browser/cocoa/status_bubble_mac.h"
@@ -520,7 +521,6 @@ willPositionSheet:(NSWindow *)sheet
// And make sure we use the correct frame in the new view.
[[controller tabStripController] setFrameOfSelectedTab:tabRect];
-
return controller;
}
@@ -548,6 +548,19 @@ willPositionSheet:(NSWindow *)sheet
[bookmarkBarController_ toggleBookmarkBar];
}
+- (BOOL)isDownloadShelfVisible {
+ return downloadShelfController_ != nil &&
+ [downloadShelfController_ isVisible];
+}
+
+- (DownloadShelfController*)downloadShelf {
+ if (!downloadShelfController_.get()) {
+ downloadShelfController_.reset([[DownloadShelfController alloc]
+ initWithBrowser:browser_.get() contentArea:[self tabContentArea]]);
+ }
+ return downloadShelfController_;
+}
+
- (void)addFindBar:(FindBarCocoaController*)findBarCocoaController {
// Shouldn't call addFindBar twice.
DCHECK(!findBarCocoaController_.get());
@@ -685,9 +698,9 @@ willPositionSheet:(NSWindow *)sheet
// sure we aren't doing anything wasteful in those cases.
[bookmarkBarController_ resizeBookmarkBar];
- if (findBarCocoaController_.get()) {
- [findBarCocoaController_ positionFindBarView:[self tabContentArea]];
- }
+ [downloadShelfController_ resizeDownloadShelf];
+
+ [findBarCocoaController_ positionFindBarView:[self tabContentArea]];
}
- (void)saveWindowPositionIfNeeded {
diff --git a/chrome/browser/cocoa/download_item_mac.h b/chrome/browser/cocoa/download_item_mac.h
new file mode 100644
index 0000000..4af3d53
--- /dev/null
+++ b/chrome/browser/cocoa/download_item_mac.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_
+#define CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/scoped_nsobject.h"
+#include "base/scoped_ptr.h"
+#include "chrome/browser/download/download_manager.h"
+
+class BaseDownloadItemModel;
+@class DownloadShelfController;
+@class DownloadShelfContextMenuBridge;
+
+
+// A class that bridges the visible mac download items to chromium's
+// download model.
+
+class DownloadItemMac : DownloadItem::Observer {
+ public:
+ // DownloadItemMac takes ownership of |download_item_model|.
+ DownloadItemMac(BaseDownloadItemModel* download_item_model,
+ NSRect frame,
+ DownloadShelfController* parent);
+
+ // Destructor.
+ ~DownloadItemMac();
+
+ // DownloadItem::Observer implementation
+ virtual void OnDownloadUpdated(DownloadItem* download);
+ virtual void OnDownloadOpened(DownloadItem* download) { }
+
+ private:
+ // The download item model we represent.
+ scoped_ptr<BaseDownloadItemModel> download_model_;
+
+ // Our parent view
+ DownloadShelfController* parent_; // weak
+
+ // Context menu
+ scoped_nsobject<DownloadShelfContextMenuBridge> menu_;
+};
+
+#endif // CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_
diff --git a/chrome/browser/cocoa/download_item_mac.mm b/chrome/browser/cocoa/download_item_mac.mm
new file mode 100644
index 0000000..eca5316
--- /dev/null
+++ b/chrome/browser/cocoa/download_item_mac.mm
@@ -0,0 +1,164 @@
+// 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.
+
+#include "chrome/browser/cocoa/download_item_mac.h"
+
+#include "base/basictypes.h"
+#include "base/string_util.h"
+#include "base/sys_string_conversions.h"
+#import "chrome/browser/cocoa/download_shelf_controller.h"
+#import "chrome/browser/cocoa/download_shelf_mac.h"
+#import "chrome/browser/cocoa/download_shelf_view.h"
+#include "chrome/browser/download/download_item_model.h"
+#include "chrome/browser/download/download_manager.h"
+#include "chrome/browser/download/download_shelf.h"
+
+// A class for the chromium-side part of the download shelf context menu.
+
+class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
+ public:
+ DownloadShelfContextMenuMac(BaseDownloadItemModel* model,
+ DownloadShelfContextMenuBridge* bridge)
+ : DownloadShelfContextMenu(model), bridge_(bridge) {
+ }
+
+ NSMenu* GetCocoaMenu();
+
+ using DownloadShelfContextMenu::ExecuteItemCommand;
+
+ private:
+ DownloadShelfContextMenuBridge* bridge_; // weak, owns us
+};
+
+NSMenu* DownloadShelfContextMenuMac::GetCocoaMenu() {
+ // TODO(thakis): win/gtk show slightly different menus when the download is
+ // in progress/done (mainly the first item)
+ // TODO(thakis): this probably wants to be in a xib file or at least use
+ // localized strings
+
+ NSMenuItem* item;
+ NSMenu* menu =
+ [[[NSMenu alloc] initWithTitle:@"DownloadItemPopup"] autorelease];
+ SEL action = @selector(performAction:);
+
+ item = [menu addItemWithTitle:@"Open" action:action keyEquivalent:@""];
+ // [item addItemWithTitle:@"Open when complete" ...]; // In-progress text.
+ [item setTag:OPEN_WHEN_COMPLETE];
+ [item setTarget:bridge_];
+
+ // TODO(thakis): Set correct checkbox state, make this a checkbox item
+ item = [menu addItemWithTitle:@"Always open type"
+ action:action
+ keyEquivalent:@""];
+ [item setTag:ALWAYS_OPEN_TYPE];
+ [item setTarget:bridge_];
+
+ [menu addItem:[NSMenuItem separatorItem]];
+
+ item = [menu addItemWithTitle:@"Reveal in Finder"
+ action:action
+ keyEquivalent:@""];
+ [item setTag:SHOW_IN_FOLDER];
+ [item setTarget:bridge_];
+
+ [menu addItem:[NSMenuItem separatorItem]];
+
+ item = [menu addItemWithTitle:@"Cancel" action:action keyEquivalent:@""];
+ [item setTag:CANCEL];
+ [item setTarget:bridge_];
+
+ return menu;
+}
+
+
+// A class for the cocoa side of the download shelf context menu.
+
+@interface DownloadShelfContextMenuBridge : NSObject {
+ @private
+ scoped_ptr<DownloadShelfContextMenuMac> contextMenu_;
+}
+
+- (DownloadShelfContextMenuBridge*)initWithModel:(BaseDownloadItemModel*)model;
+@end
+
+@interface DownloadShelfContextMenuBridge(Private)
+- (void)performAction:(id)sender;
+- (NSMenu*)menu;
+@end
+
+@implementation DownloadShelfContextMenuBridge
+
+- (DownloadShelfContextMenuBridge*)initWithModel:(BaseDownloadItemModel*)model {
+ if ((self = [super init]) == nil) {
+ return nil;
+ }
+ contextMenu_.reset(new DownloadShelfContextMenuMac(model, self));
+ return self;
+}
+
+@end
+
+@implementation DownloadShelfContextMenuBridge(Private)
+
+- (void)performAction:(id)sender {
+ contextMenu_->ExecuteItemCommand([sender tag]);
+}
+
+- (NSMenu*)menu {
+ return contextMenu_->GetCocoaMenu();
+}
+
+@end
+
+
+// DownloadItemMac -------------------------------------------------------------
+
+DownloadItemMac::DownloadItemMac(BaseDownloadItemModel* download_model,
+ NSRect frame,
+ DownloadShelfController* parent)
+ : download_model_(download_model), parent_(parent) {
+ download_model_->download()->AddObserver(this);
+
+ // TODO(thakis): The windows version of this does all kinds of things
+ // (gratituous use of animation, special handling of dangerous downloads)
+ // that we don't currently do.
+
+ scoped_nsobject<NSPopUpButton> view(
+ [[NSPopUpButton alloc] initWithFrame:frame pullsDown:YES]);
+ [parent_ addDownloadItem:view.get()];
+
+ // TODO(thakis): use filename eliding like gtk/windows versions
+ std::wstring tmpname =
+ download_model->download()->GetFileName().ToWStringHack();
+
+ NSString* titleString = base::SysWideToNSString(tmpname);
+
+ menu_.reset([[DownloadShelfContextMenuBridge alloc]
+ initWithModel:download_model_.get()]);
+ [view.get() setMenu:[menu_.get() menu]];
+
+ [view.get() insertItemWithTitle:titleString atIndex:0];
+
+ // TODO(thakis): Use file extension and iconForFileType. Currently, this
+ // complains "<filename> is not a full path."
+ [[view.get() itemAtIndex:0] setImage:
+ [[NSWorkspace sharedWorkspace] iconForFile:titleString]];
+}
+
+DownloadItemMac::~DownloadItemMac() {
+ download_model_->download()->RemoveObserver(this);
+}
+
+void DownloadItemMac::OnDownloadUpdated(DownloadItem* download) {
+ DCHECK_EQ(download, download_model_->download());
+
+ std::wstring status_text = download_model_->GetStatusText();
+ // Remove the status text label.
+ if (status_text.empty()) {
+ // TODO(thakis): Once there is a status label, hide it here
+ return;
+ }
+
+ // TODO(thakis): Set status_text as status label
+}
diff --git a/chrome/browser/cocoa/download_shelf_controller.h b/chrome/browser/cocoa/download_shelf_controller.h
new file mode 100644
index 0000000..86c5535
--- /dev/null
+++ b/chrome/browser/cocoa/download_shelf_controller.h
@@ -0,0 +1,45 @@
+// 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>
+
+#include "base/scoped_ptr.h"
+
+class Browser;
+@class BrowserWindowController;
+class DownloadShelf;
+@class DownloadShelfView;
+
+// A controller class that manages the download shelf for one window.
+
+@interface DownloadShelfController : NSViewController {
+ @private
+ // Currently these two are always the same, but they mean slightly
+ // different things. contentAreaHasOffset_ is an implementation
+ // detail of download shelf visibility.
+ BOOL contentAreaHasOffset_;
+ BOOL barIsVisible_;
+
+ scoped_ptr<DownloadShelf> bridge_;
+ NSView* contentArea_;
+ int shelfHeight_;
+};
+
+- (id)initWithBrowser:(Browser*)browser
+ contentArea:(NSView*)content;
+
+- (DownloadShelf*)bridge;
+- (BOOL)isVisible;
+
+- (IBAction)show:(id)sender;
+- (IBAction)hide:(id)sender;
+
+// TODO(thakis): this should internally build an item and get only
+// the model as parameter.
+- (void)addDownloadItem:(NSView*)view;
+
+// Resizes the download shelf based on the state of the content area.
+- (void)resizeDownloadShelf;
+
+@end
diff --git a/chrome/browser/cocoa/download_shelf_controller.mm b/chrome/browser/cocoa/download_shelf_controller.mm
new file mode 100644
index 0000000..b82f67f
--- /dev/null
+++ b/chrome/browser/cocoa/download_shelf_controller.mm
@@ -0,0 +1,114 @@
+// 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 "download_shelf_controller.h"
+
+#include "base/mac_util.h"
+#import "chrome/browser/cocoa/browser_window_controller.h"
+#include "chrome/browser/cocoa/browser_window_cocoa.h"
+#include "chrome/browser/cocoa/download_shelf_mac.h"
+#import "chrome/browser/cocoa/download_shelf_view.h"
+
+
+@interface DownloadShelfController(Private)
+- (void)applyContentAreaOffset:(BOOL)apply;
+- (void)positionBar;
+- (void)showDownloadShelf:(BOOL)enable;
+@end
+
+
+@implementation DownloadShelfController
+
+- (id)initWithBrowser:(Browser*)browser
+ contentArea:(NSView*)content {
+ if ((self = [super initWithNibName:@"DownloadShelf"
+ bundle:mac_util::MainAppBundle()])) {
+ contentArea_ = content;
+ shelfHeight_ = [[self view] bounds].size.height;
+
+ [self positionBar];
+ [[[contentArea_ window] contentView] addSubview:[self view]];
+
+ // This calls show:, so it needs to be last.
+ bridge_.reset(new DownloadShelfMac(browser, self));
+ }
+ return self;
+}
+
+// Initializes the download shelf at the bottom edge of |contentArea_|.
+- (void)positionBar {
+ // Set the bar's height to zero and position it at the bottom of the
+ // content area, within the window's content view (as opposed to the
+ // tab strip, which is a sibling). We'll enlarge it and slide the
+ // content area up when we need to show this strip.
+ NSRect contentFrame = [contentArea_ frame];
+ NSRect barFrame = NSMakeRect(0, 0,
+ contentFrame.size.width, shelfHeight_);
+ [[self view] setFrame:barFrame];
+}
+
+// Called when the contentArea's frame changes. Enlarge the view to
+// stay with the bottom of the contentArea.
+- (void)resizeDownloadShelf {
+ NSRect barFrame = [[self view] frame];
+ barFrame.origin.y = 0;
+ barFrame.size.height = NSMinY([contentArea_ frame]);
+ [[self view] setFrame:barFrame];
+}
+
+// Show or hide the bar based on the value of |enable|. Handles animating the
+// resize of the content view.
+- (void)showDownloadShelf:(BOOL)enable {
+ contentAreaHasOffset_ = enable;
+ [[self view] setHidden:enable ? NO : YES];
+ [self applyContentAreaOffset:enable];
+
+ barIsVisible_ = enable;
+}
+
+// Apply a contents box offset to make (or remove) room for the
+// download shelf. If apply==YES, always make room (the contentView_ is
+// "full size"). If apply==NO we are trying to undo an offset. If no
+// offset there is nothing to undo.
+- (void)applyContentAreaOffset:(BOOL)apply {
+ if (!contentAreaHasOffset_ && apply) {
+ // There is no offset to unconditionally apply.
+ return;
+ }
+
+ NSRect frame = [contentArea_ frame];
+ if (apply) {
+ frame.origin.y += shelfHeight_;
+ frame.size.height -= shelfHeight_;
+ } else {
+ frame.origin.y -= shelfHeight_;
+ frame.size.height += shelfHeight_;
+ }
+
+ [[contentArea_ animator] setFrame:frame];
+ [[self view] setNeedsDisplay:YES];
+ [contentArea_ setNeedsDisplay:YES];
+}
+
+- (DownloadShelf*)bridge {
+ return bridge_.get();
+}
+
+- (BOOL)isVisible {
+ return barIsVisible_;
+}
+
+- (void)show:(id)sender {
+ [self showDownloadShelf:YES];
+}
+
+- (void)hide:(id)sender {
+ [self showDownloadShelf:NO];
+}
+
+- (void)addDownloadItem:(NSView*)view {
+ [[self view] addSubview:view];
+}
+
+@end
diff --git a/chrome/browser/cocoa/download_shelf_mac.h b/chrome/browser/cocoa/download_shelf_mac.h
new file mode 100644
index 0000000..2959fe5
--- /dev/null
+++ b/chrome/browser/cocoa/download_shelf_mac.h
@@ -0,0 +1,44 @@
+// 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.
+
+#ifndef CHROME_BROWSER_COCOA_DOWNLOAD_SHELF_MAC_H_
+#define CHROME_BROWSER_COCOA_DOWNLOAD_SHELF_MAC_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include <vector>
+
+#include "base/scoped_ptr.h"
+#include "chrome/browser/download/download_shelf.h"
+
+class BaseDownloadItemModel;
+class CustomDrawButton;
+class DownloadItemMac;
+
+@class ShelfView;
+@class DownloadShelfController;
+
+// A class to bridge the chromium download shelf to mac gui. This is just a
+// wrapper class that forward everything to DownloadShelfController.
+
+class DownloadShelfMac : public DownloadShelf {
+ public:
+ explicit DownloadShelfMac(Browser* browser,
+ DownloadShelfController* controller);
+
+ // DownloadShelf implementation.
+ virtual void AddDownload(BaseDownloadItemModel* download_model);
+ virtual bool IsShowing() const;
+ virtual bool IsClosing() const;
+ virtual void Show();
+ virtual void Close();
+
+ private:
+ // The download items we have added to our shelf.
+ std::vector<DownloadItemMac*> download_items_;
+
+ DownloadShelfController* shelf_controller_; // weak, owns us
+};
+
+#endif // CHROME_BROWSER_COCOA_DOWNLOAD_SHELF_MAC_H_
diff --git a/chrome/browser/cocoa/download_shelf_mac.mm b/chrome/browser/cocoa/download_shelf_mac.mm
new file mode 100644
index 0000000..18fca59
--- /dev/null
+++ b/chrome/browser/cocoa/download_shelf_mac.mm
@@ -0,0 +1,69 @@
+// 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.
+
+#include "chrome/browser/cocoa/download_shelf_mac.h"
+
+#import "chrome/browser/cocoa/download_shelf_controller.h"
+#include "chrome/browser/cocoa/download_item_mac.h"
+#include "chrome/browser/download/download_item_model.h"
+
+namespace {
+
+// TODO(thakis): These are all temporary until there's a download item view
+
+// Border padding of a download item
+const int kDownloadItemBorderPadding = 4;
+
+// Width of a download item
+const int kDownloadItemWidth = 200;
+
+// Height of a download item
+const int kDownloadItemHeight = 32;
+
+// Horizontal padding between two download items
+const int kDownloadItemPadding = 10;
+
+} // namespace
+
+DownloadShelfMac::DownloadShelfMac(Browser* browser,
+ DownloadShelfController* controller)
+ : DownloadShelf(browser),
+ shelf_controller_(controller) {
+ Show();
+}
+
+void DownloadShelfMac::AddDownload(BaseDownloadItemModel* download_model) {
+
+ // TODO(thakis): we need to delete these at some point. There's no explicit
+ // mass delete on windows, figure out where they do it.
+
+ // TODO(thakis): This should just forward to the controller.
+
+ // TODO(thakis): RTL support?
+ int startX = kDownloadItemBorderPadding +
+ (kDownloadItemWidth + kDownloadItemPadding) * download_items_.size();
+ download_items_.push_back(new DownloadItemMac(download_model,
+ NSMakeRect(startX, kDownloadItemBorderPadding,
+ kDownloadItemWidth, kDownloadItemHeight),
+ shelf_controller_));
+
+ Show();
+}
+
+bool DownloadShelfMac::IsShowing() const {
+ return [shelf_controller_ isVisible] == YES;
+}
+
+bool DownloadShelfMac::IsClosing() const {
+ // TODO(estade): This is never called. For now just return false.
+ return false;
+}
+
+void DownloadShelfMac::Show() {
+ [shelf_controller_ show:nil];
+}
+
+void DownloadShelfMac::Close() {
+ [shelf_controller_ hide:nil];
+}
diff --git a/chrome/browser/cocoa/download_shelf_mac_unittest.mm b/chrome/browser/cocoa/download_shelf_mac_unittest.mm
new file mode 100644
index 0000000..78ff52d
--- /dev/null
+++ b/chrome/browser/cocoa/download_shelf_mac_unittest.mm
@@ -0,0 +1,91 @@
+// 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.
+
+#include "chrome/browser/cocoa/browser_test_helper.h"
+#include "chrome/browser/cocoa/cocoa_test_helper.h"
+#include "chrome/browser/cocoa/download_shelf_mac.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+
+// A fake implementation of DownloadShelfController. It implements only the
+// methods that DownloadShelfMac call during the tests in this file. We get this
+// class into the DownloadShelfMac constructor by some questionable casting --
+// Objective C is a dynamic language, so we pretend that's ok.
+
+@interface FakeDownloadShelfController : NSObject {
+ @public
+ int callCountIsVisible;
+ int callCountShow;
+ int callCountHide;
+}
+
+- (BOOL)isVisible;
+- (IBAction)show:(id)sender;
+- (IBAction)hide:(id)sender;
+@end
+
+@implementation FakeDownloadShelfController
+
+- (BOOL)isVisible {
+ ++callCountIsVisible;
+ return YES;
+}
+
+- (IBAction)show:(id)sender {
+ ++callCountShow;
+}
+
+- (IBAction)hide:(id)sender {
+ ++callCountHide;
+}
+
+@end
+
+
+namespace {
+
+class DownloadShelfMacTest : public testing::Test {
+
+ virtual void SetUp() {
+ shelf_controller_.reset([[FakeDownloadShelfController alloc] init]);
+ }
+
+ protected:
+ scoped_nsobject<FakeDownloadShelfController> shelf_controller_;
+ CocoaTestHelper helper_;
+ BrowserTestHelper browser_helper_;
+};
+
+TEST_F(DownloadShelfMacTest, CreationCallsShow) {
+ // Also make sure the DownloadShelfMacTest constructor doesn't crash.
+ DownloadShelfMac shelf(browser_helper_.browser(),
+ (DownloadShelfController*)shelf_controller_.get());
+ EXPECT_EQ(1, shelf_controller_.get()->callCountShow);
+}
+
+TEST_F(DownloadShelfMacTest, ForwardsShow) {
+ DownloadShelfMac shelf(browser_helper_.browser(),
+ (DownloadShelfController*)shelf_controller_.get());
+ EXPECT_EQ(1, shelf_controller_.get()->callCountShow);
+ shelf.Show();
+ EXPECT_EQ(2, shelf_controller_.get()->callCountShow);
+}
+
+TEST_F(DownloadShelfMacTest, ForwardsHide) {
+ DownloadShelfMac shelf(browser_helper_.browser(),
+ (DownloadShelfController*)shelf_controller_.get());
+ EXPECT_EQ(0, shelf_controller_.get()->callCountHide);
+ shelf.Close();
+ EXPECT_EQ(1, shelf_controller_.get()->callCountHide);
+}
+
+TEST_F(DownloadShelfMacTest, ForwardsIsShowing) {
+ DownloadShelfMac shelf(browser_helper_.browser(),
+ (DownloadShelfController*)shelf_controller_.get());
+ EXPECT_EQ(0, shelf_controller_.get()->callCountIsVisible);
+ shelf.IsShowing();
+ EXPECT_EQ(1, shelf_controller_.get()->callCountIsVisible);
+}
+
+} // namespace
diff --git a/chrome/browser/cocoa/download_shelf_view.h b/chrome/browser/cocoa/download_shelf_view.h
new file mode 100644
index 0000000..d69b139
--- /dev/null
+++ b/chrome/browser/cocoa/download_shelf_view.h
@@ -0,0 +1,17 @@
+// 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.
+
+#ifndef CHROME_BROWSER_COCOA_SHELF_VIEW_H_
+#define CHROME_BROWSER_COCOA_SHELF_VIEW_H_
+
+#import <Cocoa/Cocoa.h>
+
+// A view that handles any special rendering for the download shelf, painting
+// a gradient and managing a set of DownloadItemViews.
+
+@interface DownloadShelfView : NSView {
+}
+@end
+
+#endif // CHROME_BROWSER_COCOA_SHELF_VIEW_H_
diff --git a/chrome/browser/cocoa/download_shelf_view.mm b/chrome/browser/cocoa/download_shelf_view.mm
new file mode 100644
index 0000000..f1c9fb1
--- /dev/null
+++ b/chrome/browser/cocoa/download_shelf_view.mm
@@ -0,0 +1,61 @@
+// 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 "chrome/browser/cocoa/download_shelf_view.h"
+
+#include "base/scoped_nsobject.h"
+
+@implementation DownloadShelfView
+
+- (void)drawRect:(NSRect)rect {
+ rect = [self bounds];
+
+ // TODO(thakis): Once this has its final look, it also needs an
+ // "inactive" state.
+
+#if 0
+ // Grey Finder/iCal-like bottom bar with dark gradient, dark/light lines
+ NSColor* start =
+ [NSColor colorWithCalibratedWhite: 0.75 alpha:1.0];
+ NSColor* end = [NSColor colorWithCalibratedWhite:0.59 alpha:1.0];
+ scoped_nsobject<NSGradient> gradient(
+ [[NSGradient alloc] initWithStartingColor:start endingColor:end]);
+ [gradient drawInRect:[self bounds] angle:270.0];
+
+ NSRect borderRect, contentRect;
+ NSDivideRect(rect, &borderRect, &contentRect, 1, NSMaxYEdge);
+ [[NSColor colorWithDeviceWhite:0.25 alpha:1.0] set];
+ NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
+
+ NSDivideRect(contentRect, &borderRect, &contentRect, 1, NSMaxYEdge);
+ [[NSColor colorWithDeviceWhite:0.85 alpha:1.0] set];
+ NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
+#else
+ // Glossy two-color bar with only light line at top (Mail.app/HitList-style)
+ // Doesn't mesh with the matte look of the toolbar.
+
+ NSRect topRect, bottomRect;
+ NSDivideRect(rect, &topRect, &bottomRect, rect.size.height/2, NSMaxYEdge);
+
+ // 1px line at top
+ NSRect borderRect, contentRect;
+ NSDivideRect(topRect, &borderRect, &contentRect, 1, NSMaxYEdge);
+ [[NSColor colorWithDeviceWhite:0.69 alpha:1.0] set];
+ NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
+
+ // Gradient for upper half
+ NSColor* start =
+ [NSColor colorWithCalibratedWhite: 1.0 alpha:1.0];
+ NSColor* end = [NSColor colorWithCalibratedWhite:0.94 alpha:1.0];
+ scoped_nsobject<NSGradient> gradient(
+ [[NSGradient alloc] initWithStartingColor:start endingColor:end]);
+ [gradient drawInRect:contentRect angle:270.0];
+
+ // Fill lower half with solid color
+ [[NSColor colorWithDeviceWhite:0.9 alpha:1.0] set];
+ NSRectFillUsingOperation(bottomRect, NSCompositeSourceOver);
+#endif
+}
+
+@end
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index de48b90..7ed4ad0 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -636,6 +636,7 @@ void DownloadManager::OnPathExistenceAvailable(DownloadCreateInfo* info) {
DCHECK(info);
if (info->save_as) {
+#if defined(OS_WIN) || defined(OS_LINUX)
// We must ask the user for the place to put the download.
if (!select_file_dialog_.get())
select_file_dialog_ = SelectFileDialog::Create(this);
@@ -655,6 +656,10 @@ void DownloadManager::OnPathExistenceAvailable(DownloadCreateInfo* info) {
info->suggested_path,
&file_type_info, 0, FILE_PATH_LITERAL(""),
owning_window, info);
+#elif defined(OS_MACOSX)
+ // TODO(port): port this file -- need dialogs.
+ NOTIMPLEMENTED();
+#endif
} else {
// No prompting for download, just continue with the suggested name.
ContinueStartDownload(info, info->suggested_path);
diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc
index 7e90cbb..beca753 100644
--- a/chrome/browser/download/save_package.cc
+++ b/chrome/browser/download/save_package.cc
@@ -252,12 +252,7 @@ bool SavePackage::Init() {
download_ = new DownloadItem(1, saved_main_file_path_, 0, page_url_,
FilePath(), Time::Now(), 0, -1, -1, false);
download_->set_manager(tab_contents_->profile()->GetDownloadManager());
-#if !defined(OS_MACOSX)
tab_contents_->OnStartDownload(download_);
-#else
- // TODO(port): Create a download shelf for mac.
- NOTIMPLEMENTED();
-#endif
// Check save type and process the save page job.
if (save_type_ == SAVE_AS_COMPLETE_HTML) {
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index ad0d097..fd46400 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -724,6 +724,14 @@
'browser/cocoa/command_observer_bridge.mm',
'browser/cocoa/custom_home_pages_model.h',
'browser/cocoa/custom_home_pages_model.mm',
+ 'browser/cocoa/download_item_mac.h',
+ 'browser/cocoa/download_item_mac.mm',
+ 'browser/cocoa/download_shelf_controller.h',
+ 'browser/cocoa/download_shelf_controller.mm',
+ 'browser/cocoa/download_shelf_mac.h',
+ 'browser/cocoa/download_shelf_mac.mm',
+ 'browser/cocoa/download_shelf_view.h',
+ 'browser/cocoa/download_shelf_view.mm',
'browser/cocoa/encoding_menu_controller_delegate_mac.h',
'browser/cocoa/encoding_menu_controller_delegate_mac.mm',
'browser/cocoa/find_bar_bridge.h',
@@ -2355,6 +2363,7 @@
'app/nibs/en.lproj/About.xib',
'app/nibs/en.lproj/BrowserWindow.xib',
'app/nibs/en.lproj/ClearBrowsingData.xib',
+ 'app/nibs/en.lproj/DownloadShelf.xib',
'app/nibs/en.lproj/FindBar.xib',
'app/nibs/en.lproj/FirstRunDialog.xib',
'app/nibs/en.lproj/MainMenu.xib',
@@ -3219,9 +3228,6 @@
# TODO(port)
'app/chrome_main_uitest.cc',
'browser/crash_recovery_uitest.cc',
- 'browser/download/download_uitest.cc',
- # blocked on download shelf
- 'browser/download/save_page_uitest.cc',
'browser/login_prompt_uitest.cc',
'browser/metrics/metrics_service_uitest.cc',
# leaves an extra window on screen after test completes.
@@ -3364,6 +3370,7 @@
'browser/cocoa/cocoa_utils_unittest.mm',
'browser/cocoa/command_observer_bridge_unittest.mm',
'browser/cocoa/custom_home_pages_model_unittest.mm',
+ 'browser/cocoa/download_shelf_mac_unittest.mm',
'browser/cocoa/find_bar_bridge_unittest.mm',
'browser/cocoa/find_bar_cocoa_controller_unittest.mm',
'browser/cocoa/find_bar_view_unittest.mm',
diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc
index 74f5d4d..5aa41e5 100644
--- a/chrome/common/temp_scaffolding_stubs.cc
+++ b/chrome/common/temp_scaffolding_stubs.cc
@@ -258,11 +258,23 @@ InfoBar* LinkInfoBarDelegate::CreateInfoBar() {
}
#endif
+// This should prompt the user if she wants to allow more than one concurrent
+// download per tab. Until this is in place, always allow multiple downloads.
+class DownloadRequestDialogDelegateStub
+ : public DownloadRequestDialogDelegate {
+ public:
+ explicit DownloadRequestDialogDelegateStub(
+ DownloadRequestManager::TabDownloadState* host)
+ : DownloadRequestDialogDelegate(host) { DoAccept(); }
+
+ virtual void CloseWindow() {}
+};
+
DownloadRequestDialogDelegate* DownloadRequestDialogDelegate::Create(
TabContents* tab,
DownloadRequestManager::TabDownloadState* host) {
NOTIMPLEMENTED();
- return NULL;
+ return new DownloadRequestDialogDelegateStub(host);
}
#if !defined(TOOLKIT_VIEWS)
diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h
index 07f1e1e..78a42a1 100644
--- a/chrome/common/temp_scaffolding_stubs.h
+++ b/chrome/common/temp_scaffolding_stubs.h
@@ -23,11 +23,6 @@
#include "googleurl/src/gurl.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#if defined(OS_MACOSX)
-#include "chrome/browser/download/download_item_model.h"
-#include "chrome/browser/download/download_shelf.h"
-#endif
-
class BookmarkContextMenu;
class BookmarkNode;
@@ -393,26 +388,6 @@ class OSExchangeData {
class BaseDragSource {
};
-//--------------------------------------------------------------------------
-
-#if defined(OS_MACOSX)
-
-class DownloadShelfMac : public DownloadShelf {
- public:
- explicit DownloadShelfMac(Browser* browser)
- : DownloadShelf(browser), visible_(false) { }
- virtual void AddDownload(BaseDownloadItemModel* download_model)
- { NOTIMPLEMENTED(); visible_ = true; }
- virtual bool IsShowing() const { NOTIMPLEMENTED(); return visible_; }
- virtual bool IsClosing() const { NOTIMPLEMENTED(); return visible_; }
- virtual void Show() { NOTIMPLEMENTED(); visible_ = true; }
- virtual void Close() { NOTIMPLEMENTED(); visible_ = false; }
- private:
- bool visible_;
-};
-
-#endif
-
//---------------------------------------------------------------------------
// These stubs are for extensions