diff options
-rw-r--r-- | chrome/app/nibs/BookmarkBarFolderWindow.xib | 852 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_controller.mm | 5 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_folder_controller.h | 12 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_folder_controller.mm | 170 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm | 125 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_folder_view.mm | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_folder_window.h | 6 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_folder_window.mm | 63 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_folder_window_unittest.mm | 12 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_button.h | 3 |
10 files changed, 1113 insertions, 137 deletions
diff --git a/chrome/app/nibs/BookmarkBarFolderWindow.xib b/chrome/app/nibs/BookmarkBarFolderWindow.xib index e8cb5f0..a86eeae 100644 --- a/chrome/app/nibs/BookmarkBarFolderWindow.xib +++ b/chrome/app/nibs/BookmarkBarFolderWindow.xib @@ -1,16 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> -<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03"> +<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">9L31a</string> - <string key="IBDocument.InterfaceBuilderVersion">680</string> - <string key="IBDocument.AppKitVersion">949.54</string> - <string key="IBDocument.HIToolboxVersion">353.00</string> + <string key="IBDocument.SystemVersion">10B504</string> + <string key="IBDocument.InterfaceBuilderVersion">732</string> + <string key="IBDocument.AppKitVersion">1038.2</string> + <string key="IBDocument.HIToolboxVersion">437.00</string> + <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="NS.object.0">732</string> + </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="2"/> - <integer value="10"/> + <integer value="1"/> <integer value="12"/> + <integer value="10"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -18,7 +22,7 @@ </object> <object class="NSMutableDictionary" key="IBDocument.Metadata"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys" id="0"> <bool key="EncodedWithXMLCoder">YES</bool> </object> <object class="NSMutableArray" key="dict.values"> @@ -44,25 +48,83 @@ <string key="NSWindowTitle">BmbPopUpWindow</string> <string key="NSWindowClass">BookmarkBarFolderWindow</string> <nil key="NSViewClass"/> - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> <object class="NSView" key="NSWindowView" id="1006"> <reference key="NSNextResponder"/> - <int key="NSvFlags">256</int> + <int key="NSvFlags">274</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSCustomView" id="762431297"> + <object class="NSScrollView" id="7382480"> <reference key="NSNextResponder" ref="1006"/> <int key="NSvFlags">274</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSClipView" id="795270038"> + <reference key="NSNextResponder" ref="7382480"/> + <int key="NSvFlags">2304</int> + <object class="NSMutableArray" key="NSSubviews"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSCustomView" id="762431297"> + <reference key="NSNextResponder" ref="795270038"/> + <int key="NSvFlags">296</int> + <string key="NSFrame">{{0, -17}, {480, 270}}</string> + <reference key="NSSuperview" ref="795270038"/> + <string key="NSClassName">BookmarkBarFolderView</string> + </object> + </object> + <string key="NSFrame">{{1, 1}, {478, 268}}</string> + <string key="NSBounds">{{0, -15}, {478, 268}}</string> + <reference key="NSSuperview" ref="7382480"/> + <reference key="NSNextKeyView" ref="762431297"/> + <reference key="NSDocView" ref="762431297"/> + <object class="NSColor" key="NSBGColor"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">controlColor</string> + <object class="NSColor" key="NSColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes> + </object> + </object> + <int key="NScvFlags">2</int> + </object> + <object class="NSScroller" id="563841282"> + <reference key="NSNextResponder" ref="7382480"/> + <int key="NSvFlags">-2147483392</int> + <string key="NSFrame">{{-100, -100}, {15, 285}}</string> + <reference key="NSSuperview" ref="7382480"/> + <bool key="NSEnabled">YES</bool> + <reference key="NSTarget" ref="7382480"/> + <string key="NSAction">_doScroller:</string> + <double key="NSCurValue">1</double> + <double key="NSPercent">0.96363627910614014</double> + </object> + <object class="NSScroller" id="673728740"> + <reference key="NSNextResponder" ref="7382480"/> + <int key="NSvFlags">-2147483392</int> + <string key="NSFrame">{{-100, -100}, {480, 15}}</string> + <reference key="NSSuperview" ref="7382480"/> + <bool key="NSEnabled">YES</bool> + <int key="NSsFlags">1</int> + <reference key="NSTarget" ref="7382480"/> + <string key="NSAction">_doScroller:</string> + <double key="NSPercent">0.50602412223815918</double> + </object> + </object> <string key="NSFrameSize">{480, 270}</string> <reference key="NSSuperview" ref="1006"/> - <string key="NSClassName">BookmarkBarFolderView</string> + <reference key="NSNextKeyView" ref="795270038"/> + <int key="NSsFlags">194</int> + <reference key="NSVScroller" ref="563841282"/> + <reference key="NSHScroller" ref="673728740"/> + <reference key="NSContentView" ref="795270038"/> </object> </object> <string key="NSFrameSize">{480, 270}</string> <reference key="NSSuperview"/> </object> <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> <object class="NSMenu" id="447628937"> <string key="NSTitle"/> @@ -668,34 +730,40 @@ </object> <int key="connectionID">89</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">scrollView_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="7382480"/> + </object> + <int key="connectionID">94</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="648438133"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> + <reference key="object" ref="0"/> <reference key="children" ref="1000"/> <nil key="parent"/> </object> <object class="IBObjectRecord"> <int key="objectID">-2</int> <reference key="object" ref="1001"/> - <reference key="parent" ref="648438133"/> - <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string> + <reference key="parent" ref="0"/> + <string key="objectName">File's Owner</string> </object> <object class="IBObjectRecord"> <int key="objectID">-1</int> <reference key="object" ref="1003"/> - <reference key="parent" ref="648438133"/> + <reference key="parent" ref="0"/> <string key="objectName">First Responder</string> </object> <object class="IBObjectRecord"> <int key="objectID">-3</int> <reference key="object" ref="1004"/> - <reference key="parent" ref="648438133"/> + <reference key="parent" ref="0"/> <string key="objectName">Application</string> </object> <object class="IBObjectRecord"> @@ -705,23 +773,18 @@ <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="1006"/> </object> - <reference key="parent" ref="648438133"/> + <reference key="parent" ref="0"/> </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="762431297"/> + <reference ref="7382480"/> </object> <reference key="parent" ref="1005"/> </object> <object class="IBObjectRecord"> - <int key="objectID">4</int> - <reference key="object" ref="762431297"/> - <reference key="parent" ref="1006"/> - </object> - <object class="IBObjectRecord"> <int key="objectID">10</int> <reference key="object" ref="243908609"/> <object class="NSMutableArray" key="children"> @@ -744,13 +807,13 @@ <reference ref="432629396"/> <reference ref="147047106"/> </object> - <reference key="parent" ref="648438133"/> + <reference key="parent" ref="0"/> <string key="objectName">Folder Menu</string> </object> <object class="IBObjectRecord"> <int key="objectID">11</int> <reference key="object" ref="297726234"/> - <reference key="parent" ref="648438133"/> + <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">12</int> @@ -775,13 +838,13 @@ <reference ref="202140151"/> <reference ref="416998881"/> </object> - <reference key="parent" ref="648438133"/> + <reference key="parent" ref="0"/> <string key="objectName">Button Menu</string> </object> <object class="IBObjectRecord"> <int key="objectID">13</int> <reference key="object" ref="493003890"/> - <reference key="parent" ref="648438133"/> + <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">16</int> @@ -953,11 +1016,37 @@ <reference key="object" ref="147047106"/> <reference key="parent" ref="243908609"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">90</int> + <reference key="object" ref="7382480"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="563841282"/> + <reference ref="673728740"/> + <reference ref="762431297"/> + </object> + <reference key="parent" ref="1006"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">91</int> + <reference key="object" ref="563841282"/> + <reference key="parent" ref="7382480"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">92</int> + <reference key="object" ref="673728740"/> + <reference key="parent" ref="7382480"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">4</int> + <reference key="object" ref="762431297"/> + <reference key="parent" ref="7382480"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>-1.IBPluginDependency</string> <string>-2.IBPluginDependency</string> @@ -980,6 +1069,7 @@ <string>17.IBPluginDependency</string> <string>18.IBPluginDependency</string> <string>19.IBPluginDependency</string> + <string>2.CustomClassName</string> <string>2.IBPluginDependency</string> <string>20.IBPluginDependency</string> <string>21.IBPluginDependency</string> @@ -1018,24 +1108,25 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{9, 882}, {480, 270}}</string> + <string>{{727, 430}, {480, 270}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{9, 882}, {480, 270}}</string> + <string>{{727, 430}, {480, 270}}</string> <boolean value="NO"/> <string>{196, 240}</string> <string>{{357, 418}, {480, 270}}</string> <string>BookmarkMenu</string> - <string>{{222, 479}, {375, 293}}</string> + <string>{{222, 452}, {372, 293}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>BookmarkMenu</string> - <string>{{230, 131}, {365, 293}}</string> + <string>{{230, 131}, {362, 293}}</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>BookmarkBarFolderWindowContentView</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -1072,9 +1163,7 @@ </object> <object class="NSMutableDictionary" key="unlocalizedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> + <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> @@ -1082,15 +1171,13 @@ <nil key="activeLocalization"/> <object class="NSMutableDictionary" key="localizations"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> + <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <nil key="sourceID"/> - <int key="maxID">89</int> + <int key="maxID">94</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -1100,7 +1187,7 @@ <string key="superclassName">NSWindowController</string> <object class="NSMutableDictionary" key="actions"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>addFolder:</string> <string>addPage:</string> @@ -1135,17 +1222,19 @@ </object> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>buttonMenu_</string> <string>folderMenu_</string> <string>mainView_</string> + <string>scrollView_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>NSMenu</string> <string>NSMenu</string> <string>BookmarkBarFolderView</string> + <string>NSScrollView</string> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> @@ -1164,12 +1253,17 @@ <object class="IBPartialClassDescription"> <string key="className">BookmarkBarFolderWindow</string> <string key="superclassName">NSWindow</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="882611964"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">browser/cocoa/bookmark_bar_folder_window.h</string> </object> </object> <object class="IBPartialClassDescription"> + <string key="className">BookmarkBarFolderWindowContentView</string> + <string key="superclassName">NSView</string> + <reference key="sourceIdentifier" ref="882611964"/> + </object> + <object class="IBPartialClassDescription"> <string key="className">BookmarkMenu</string> <string key="superclassName">NSMenu</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> @@ -1202,7 +1296,7 @@ <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>otherObjectToLocalize_</string> <string>owner_</string> @@ -1225,7 +1319,7 @@ <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>localizerOwner_</string> <string>localizer_</string> @@ -1286,8 +1380,670 @@ </object> </object> </object> + <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <string key="superclassName">NSResponder</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="142476140"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="523367666"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="566275335"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSControl</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1015112038"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSControl.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSFormatter</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSMenu</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="372828214"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSMenuItem</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="138001703"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AddressBook.framework/Headers/ABActions.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSAlert.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSAnimation.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="142476140"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="523367666"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSBrowser.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="566275335"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSComboBox.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSComboBoxCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="1015112038"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSDatePickerCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="532209659"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSImage.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="372828214"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSRuleEditor.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSound.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSpeechRecognizer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSpeechSynthesizer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSSplitView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTabView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSText.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTextStorage.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTextView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTokenField.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTokenFieldCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSToolbar.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="503320393"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="254852090"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSWindow.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSConnection.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSError.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSMetadata.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSObject.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSPort.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSSpellServer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSStream.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSURL.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">Print.framework/Headers/PDEPluginInterface.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">SecurityInterface.framework/Headers/SFAuthorizationView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">SecurityInterface.framework/Headers/SFCertificatePanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">SecurityInterface.framework/Headers/SFChooseIdentityPanel.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSResponder</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSResponder</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSScrollView</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSScrollView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSScroller</string> + <string key="superclassName">NSControl</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSScroller.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <reference key="sourceIdentifier" ref="138001703"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <string key="superclassName">NSResponder</string> + <reference key="sourceIdentifier" ref="503320393"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <reference key="sourceIdentifier" ref="532209659"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <string key="superclassName">NSResponder</string> + <reference key="sourceIdentifier" ref="254852090"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindowController</string> + <string key="superclassName">NSResponder</string> + <object class="NSMutableDictionary" key="actions"> + <string key="NS.key.0">showWindow:</string> + <string key="NS.object.0">id</string> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string> + </object> + </object> + </object> </object> <int key="IBDocument.localizationMode">0</int> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> + <integer value="1050" key="NS.object.0"/> + </object> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> + <integer value="1050" key="NS.object.0"/> + </object> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> + <integer value="3000" key="NS.object.0"/> + </object> + <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <string key="IBDocument.LastKnownRelativeProjectPath">../../chrome.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> </data> diff --git a/chrome/browser/cocoa/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmark_bar_controller.mm index f71b65b..19025d6 100644 --- a/chrome/browser/cocoa/bookmark_bar_controller.mm +++ b/chrome/browser/cocoa/bookmark_bar_controller.mm @@ -950,11 +950,6 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { return x; } -// Return the parent window for all BookmarkBarFolderController windows. -- (NSWindow*)parentWindow { - return [[self view] window]; -} - - (int)currentTabContentsHeight { return browser_->GetSelectedTabContents() ? browser_->GetSelectedTabContents()->view()->GetContainerSize().height() : diff --git a/chrome/browser/cocoa/bookmark_bar_folder_controller.h b/chrome/browser/cocoa/bookmark_bar_folder_controller.h index d13d51d..24d81f5 100644 --- a/chrome/browser/cocoa/bookmark_bar_folder_controller.h +++ b/chrome/browser/cocoa/bookmark_bar_folder_controller.h @@ -56,9 +56,20 @@ // Our buttons. We do not have buttons for nested folders. scoped_nsobject<NSMutableArray> buttons_; + // The scroll view that contains our main button view (below). + IBOutlet NSScrollView* scrollView_; + + // Are we scrollable? If no, the full contents of the folder are + // always visible. + BOOL scrollable_; + // The main view of this window (where the buttons go). IBOutlet BookmarkBarFolderView* mainView_; + // Weak; we keep track to work around a + // setShowsBorderOnlyWhileMouseInside bug. + BookmarkButton* buttonThatMouseIsIn_; + // The context menu for a bookmark button which represents an URL. IBOutlet NSMenu* buttonMenu_; @@ -129,5 +140,6 @@ - (BookmarkBarFolderController*)folderController; - (id)folderTarget; - (void)configureWindowLevel; +- (void)performOneScroll:(CGFloat)delta; @end diff --git a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm index ac2be62..9ae9a5b 100644 --- a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm +++ b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm @@ -27,11 +27,18 @@ const NSTimeInterval kBookmarkBarFolderScrollInterval = 0.2; const CGFloat kBookmarkBarFolderScrollAmount = 2 * (bookmarks::kBookmarkButtonHeight + bookmarks::kBookmarkVerticalPadding); + +// When constraining a scrolling bookmark bar folder window to the +// screen, shrink the "constrain" by this much vertically. Currently +// this is 0.0 to avoid a problem with tracking areas leaving the +// window, but should probably be 8.0 or something. +// TODO(jrg): http://crbug.com/36225 +const CGFloat kScrollWindowVerticalMargin = 0.0; } @interface BookmarkBarFolderController(Private) - (void)configureWindow; -- (void)addScrollTracking; +- (void)addOrUpdateScrollTracking; - (void)removeScrollTracking; - (void)endScroll; - (void)addScrollTimerWithDelta:(CGFloat)delta; @@ -53,7 +60,8 @@ const CGFloat kBookmarkBarFolderScrollAmount = buttons_.reset([[NSMutableArray alloc] init]); folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]); [self configureWindow]; - [self addScrollTracking]; + if (scrollable_) + [self addOrUpdateScrollTracking]; } return self; } @@ -210,19 +218,10 @@ const CGFloat kBookmarkBarFolderScrollAmount = // Must have at least 1 button (for "empty") int buttons = std::max(node->GetChildCount() - startingIndex, 1); + // Prelim height of the window. We'll trim later as needed. int height = buttons * bookmarks::kBookmarkButtonHeight; - - // Note: this will be replaced once we make buttons; for now, use a - // reasonable value. Button creation needs a valid (x,y,h) in a - // frame to position them properly. - int windowWidth = (bookmarks::kBookmarkMenuButtonMinimumWidth + - 2 * bookmarks::kBookmarkVerticalPadding); - - NSRect windowFrame = NSMakeRect(newWindowTopLeft.x, - newWindowTopLeft.y - height, - windowWidth, - height); - [[self window] setFrame:windowFrame display:YES]; + // We'll need this soon... + [self window]; // TODO(jrg): combine with frame code in bookmark_bar_controller.mm // http://crbug.com/35966 @@ -271,23 +270,47 @@ const CGFloat kBookmarkBarFolderScrollAmount = buttonFrame.size.width = width; [button setFrame:buttonFrame]; } + width += (2 * bookmarks::kBookmarkVerticalPadding); // Finally, set our window size (make sure it fits on screen). - width += (2 * bookmarks::kBookmarkVerticalPadding); - windowFrame.size.width = width; + NSRect windowFrame = NSMakeRect(newWindowTopLeft.x, + newWindowTopLeft.y - height, + width, + height); // Make the window fit on screen, with a distance of at least |padding| from // the sides. - if ([[self window] screen]) { // nil in unit tests - const CGFloat padding = 8; - NSRect screen = [[[self window] screen] frame]; - if (NSMaxX(windowFrame) + padding > NSMaxX(screen)) - windowFrame.origin.x -= NSMaxX(windowFrame) + padding - NSMaxX(screen); - else if (NSMinX(windowFrame) - padding < NSMinX(screen)) - windowFrame.origin.x += NSMinX(screen) - NSMinX(windowFrame) + padding; + DCHECK([[self window] screen]); + NSRect screenFrame = [[[self window] screen] frame]; + const CGFloat padding = 8; + if (NSMaxX(windowFrame) + padding > NSMaxX(screenFrame)) + windowFrame.origin.x -= NSMaxX(windowFrame) + padding - NSMaxX(screenFrame); + // No 'else' to provide preference for the left side of the menu + // being visible if neither one fits. Wish I had an "bool isL2R()" + // function right here. + if (NSMinX(windowFrame) - padding < NSMinX(screenFrame)) + windowFrame.origin.x += NSMinX(screenFrame) - NSMinX(windowFrame) + padding; + + // Make the scrolled content be the right size (full size). + NSRect mainViewFrame = NSMakeRect(0, 0, + NSWidth(windowFrame), + NSHeight(windowFrame)); + [mainView_ setFrame:mainViewFrame]; + + // Make sure the window fits on the screen. If not, constrain. + // We'll scroll to allow the user to see all the content. + screenFrame = NSInsetRect(screenFrame, 0, kScrollWindowVerticalMargin); + if (!NSContainsRect(screenFrame, windowFrame)) { + scrollable_ = YES; + windowFrame = NSIntersectionRect(screenFrame, windowFrame); } - [[self window] setFrame:windowFrame display:YES]; + if (scrollable_) { + [mainView_ scrollPoint:NSMakePoint(0, (NSHeight(mainViewFrame) - + NSHeight(windowFrame)))]; + } + + // Finally pop me up. [self configureWindowLevel]; } @@ -310,25 +333,73 @@ const CGFloat kBookmarkBarFolderScrollAmount = } } +// Perform a single scroll of the specified amount. +// Scroll up: +// Scroll the documentView by the growth amount. +// If we cannot grow the window, simply scroll the documentView. +// If we can grow the window up without falling off the screen, do it. +// Scroll down: +// Never change the window size; only scroll the documentView. +- (void)performOneScroll:(CGFloat)delta { + NSRect windowFrame = [[self window] frame]; + NSRect screenFrame = [[[self window] screen] frame]; + + // First scroll the "document" area. + NSPoint scrollPosition = [scrollView_ documentVisibleRect].origin; + scrollPosition.y -= delta; + [[scrollView_ documentView] scrollPoint:scrollPosition]; + + // On 10.6 event dispatch for an NSButtonCell's + // showsBorderOnlyWhileMouseInside seems broken if scrolling the + // view that contains the button. It appears that a mouseExited: + // gets lost, so the button stays highlit forever. We accomodate + // here. + if (buttonThatMouseIsIn_) { + [[buttonThatMouseIsIn_ cell] setShowsBorderOnlyWhileMouseInside:NO]; + [[buttonThatMouseIsIn_ cell] setShowsBorderOnlyWhileMouseInside:YES]; + } + + // We update the window size after shifting the scroll to avoid a race. + CGFloat screenHeightMinusMargin = (NSHeight(screenFrame) - + (2 * kScrollWindowVerticalMargin)); + if (delta) { + // If we can, grow the window (up). + if (NSHeight(windowFrame) < screenHeightMinusMargin) { + CGFloat growAmount = delta; + // Don't scroll more than enough to "finish". + if (scrollPosition.y < 0) + growAmount += scrollPosition.y; + windowFrame.size.height += growAmount; + windowFrame.size.height = std::min(NSHeight(windowFrame), + screenHeightMinusMargin); + [[self window] setFrame:windowFrame display:YES]; + [self addOrUpdateScrollTracking]; + } + } + + // If we're at either end, happiness. + if ((scrollPosition.y <= 0) || + ((scrollPosition.y + NSHeight(windowFrame) >= + NSHeight([mainView_ frame])) && + (windowFrame.size.height == screenHeightMinusMargin))) { + [self endScroll]; + + // If the entire view is now visible the window is no longer scrollable. + if (NSHeight([mainView_ visibleRect]) == NSHeight([mainView_ bounds])) { + scrollable_ = NO; + [self removeScrollTracking]; + } + } +} + // Perform a scroll of the window on the screen. // Called by a timer when scrolling. - (void)performScroll:(NSTimer*)timer { - NSRect frame = [[self window] frame]; - NSRect newFrame = frame; - newFrame.origin.y += verticalScrollDelta_; - [[self window] setFrameOrigin:newFrame.origin]; - - // If we've just move a border of the window from offscreen to - // onscreen, stop scrolling. - NSRect screenRect = [[[self window] screen] frame]; - if ((!NSPointInRect(frame.origin, screenRect) && - NSPointInRect(newFrame.origin, screenRect)) || - ((NSMaxY(frame) >= NSMaxY(screenRect)) && - (NSMaxY(newFrame) < NSMaxY(screenRect)))) { - [self endScroll]; - } + DCHECK(verticalScrollDelta_); + [self performOneScroll:verticalScrollDelta_]; } + // Add a timer to fire at a regular interveral which scrolls the // window vertically |delta|. - (void)addScrollTimerWithDelta:(CGFloat)delta { @@ -360,6 +431,7 @@ const CGFloat kBookmarkBarFolderScrollAmount = kBookmarkBarFolderScrollAmount; CGFloat closeToBottomOfScreen = NSMinY(visibleRect) + kBookmarkBarFolderScrollAmount; + if (eventScreenLocation.y <= closeToBottomOfScreen) { [self beginScrollWindowUp]; } else if (eventScreenLocation.y > closeToTopOfScreen) { @@ -369,16 +441,20 @@ const CGFloat kBookmarkBarFolderScrollAmount = } } +- (void)mouseExited:(NSEvent*)theEvent { + [self endScroll]; +} + // Add a tracking area so we know when the mouse is pinned to the top // or bottom of the screen. If that happens, and if the mouse -// position overlaps the window, scroll it. To be clear, "scroll it" -// means "move the window vertically", not scroll it's contents with -// an NSScrollView. -- (void)addScrollTracking { +// position overlaps the window, scroll it. +- (void)addOrUpdateScrollTracking { + [self removeScrollTracking]; NSView* view = [[self window] contentView]; scrollTrackingArea_.reset([[NSTrackingArea alloc] initWithRect:[view bounds] options:(NSTrackingMouseMoved | + NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways) owner:self userInfo:nil]); @@ -712,11 +788,6 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { return y; } -- (NSWindow*)parentWindow { - return parentController_ ? [parentController_ parentWindow] : - [barController_ parentWindow]; -} - // Close the old hover-open bookmark folder, and open a new one. We // do both in one step to allow for a delay in closing the old one. // See comments above kDragHoverCloseDelay (bookmark_bar_controller.h) @@ -733,6 +804,8 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { // Called from BookmarkButton. // Unlike bookmark_bar_controller's version, we DO default to being enabled. - (void)mouseEnteredButton:(id)sender event:(NSEvent*)event { + buttonThatMouseIsIn_ = sender; + // Cancel a previous hover if needed. [NSObject cancelPreviousPerformRequestsWithTarget:self]; @@ -748,6 +821,9 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { // Called from the BookmarkButton - (void)mouseExitedButton:(id)sender event:(NSEvent*)event { + if (buttonThatMouseIsIn_ == sender) + buttonThatMouseIsIn_ = nil; + // Stop any timer about opening a new hover-open folder. // Since a performSelector:withDelay: on self retains self, it is diff --git a/chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm index 28e27ad..27b8d24 100644 --- a/chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm +++ b/chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm @@ -27,17 +27,29 @@ // Don't use a high window level when running unit tests -- it'll // interfere with anything else you are working on. -@interface BookmarkBarFolderControllerLow : BookmarkBarFolderController +@interface BookmarkBarFolderControllerLow : BookmarkBarFolderController { + BOOL realTopLeft_; // Use the real windowTopLeft call? +} +@property BOOL realTopLeft; @end + @implementation BookmarkBarFolderControllerLow + +@synthesize realTopLeft = realTopLeft_; + - (void)configureWindowLevel { // Intentionally empty. } + +- (NSPoint)windowTopLeft { + return realTopLeft_ ? [super windowTopLeft] : NSMakePoint(200,200); +} + @end -@interface BookmarkBarFolderControllerPong : BookmarkBarFolderController { +@interface BookmarkBarFolderControllerPong : BookmarkBarFolderControllerLow { BOOL childFolderWillShow_; BOOL childFolderWillClose_; } @@ -69,6 +81,7 @@ class BookmarkBarFolderControllerTest : public CocoaTest { public: BrowserTestHelper helper_; scoped_nsobject<BookmarkBarController> parentBarController_; + const BookmarkNode* folderA_; // owned by model const BookmarkNode* longTitleNode_; // owned by model BookmarkBarFolderControllerTest() { @@ -77,6 +90,7 @@ class BookmarkBarFolderControllerTest : public CocoaTest { const BookmarkNode* folderA = model->AddGroup(parent, parent->GetChildCount(), L"group"); + folderA_ = folderA; model->AddGroup(parent, parent->GetChildCount(), L"sibbling group"); const BookmarkNode* folderB = model->AddGroup(folderA, @@ -101,6 +115,7 @@ class BookmarkBarFolderControllerTest : public CocoaTest { delegate:nil resizeDelegate:nil]); [parentBarController_ loaded:model]; + [[test_window() contentView] addSubview:[parentBarController_ view]]; } // Remove the bookmark with the long title. @@ -110,14 +125,27 @@ class BookmarkBarFolderControllerTest : public CocoaTest { longTitleNode_->GetParent()->IndexOfChild(longTitleNode_)); } + // Add LOTS of nodes to our model if needed (e.g. scrolling). + void AddLotsOfNodes() { + BookmarkModel* model = helper_.profile()->GetBookmarkModel(); + for (int i = 0; i < 150; i++) { + model->AddURL(folderA_, folderA_->GetChildCount(), L"repeated title", + GURL("http://www.google.com/repeated/url")); + } + } + + // Return a simple BookmarkBarFolderController. BookmarkBarFolderController* SimpleBookmarkBarFolderController() { BookmarkButton* parentButton = [[parentBarController_ buttons] objectAtIndex:0]; - return [[BookmarkBarFolderControllerPong alloc] + BookmarkBarFolderController* c = + [[BookmarkBarFolderControllerPong alloc] initWithParentButton:parentButton parentController:nil barController:parentBarController_]; + [c window]; // Force nib load. + return c; } }; @@ -169,22 +197,32 @@ TEST_F(BookmarkBarFolderControllerTest, Position) { EXPECT_TRUE(parentButton); // If parent is a BookmarkBarController, grow down. - scoped_nsobject<BookmarkBarFolderController> bbfc; + scoped_nsobject<BookmarkBarFolderControllerLow> bbfc; bbfc.reset([[BookmarkBarFolderControllerLow alloc] initWithParentButton:parentButton parentController:nil barController:parentBarController_]); - NSPoint pt = [bbfc windowTopLeft]; - EXPECT_EQ(pt.y, NSMinY([[parentBarController_ view] frame])); + [bbfc window]; + [bbfc setRealTopLeft:YES]; + NSPoint pt = [bbfc windowTopLeft]; // screen coords + NSPoint buttonOriginInScreen = + [[parentButton window] + convertBaseToScreen:[parentButton + convertRectToBase:[parentButton frame]].origin]; + // Within margin + EXPECT_LE(abs(pt.x - buttonOriginInScreen.x), 2); + EXPECT_LE(abs(pt.y - buttonOriginInScreen.y), 2); // If parent is a BookmarkBarFolderController, grow right. - scoped_nsobject<BookmarkBarFolderController> bbfc2; + scoped_nsobject<BookmarkBarFolderControllerLow> bbfc2; bbfc2.reset([[BookmarkBarFolderControllerLow alloc] initWithParentButton:[[bbfc buttons] objectAtIndex:0] parentController:bbfc.get() barController:parentBarController_]); + [bbfc2 window]; + [bbfc2 setRealTopLeft:YES]; pt = [bbfc2 windowTopLeft]; - EXPECT_EQ(pt.x, NSMaxX([[[bbfc.get() window] contentView] frame])); + EXPECT_EQ(pt.x, NSMaxX([[bbfc.get() window] frame])); } TEST_F(BookmarkBarFolderControllerTest, DropDestination) { @@ -202,7 +240,8 @@ TEST_F(BookmarkBarFolderControllerTest, DropDestination) { // Confirm "right in the center" (give or take a pixel) is a match, // and confirm "just barely in the button" is not. Anything more - // specific seems likely to be tweaked. + // specific seems likely to be tweaked. We don't loop over all + // buttons because the scroll view makes them not visible. for (BookmarkButton* button in [bbfc buttons]) { CGFloat x = NSMidX([button frame]); CGFloat y = NSMidY([button frame]); @@ -219,26 +258,6 @@ TEST_F(BookmarkBarFolderControllerTest, DropDestination) { EXPECT_FALSE([bbfc buttonForDroppingOnAtPoint:NSMakePoint(x+1, y-1)]); EXPECT_TRUE([bbfc shouldShowIndicatorShownForPoint:NSMakePoint(x, y)]);; } - - - // On some corners: NOT a match. Confirm that the indicator - // position for these two points is NOT the same. - BookmarkButton* dragButton = [[bbfc buttons] lastObject]; - x = NSMinX([button frame]); - y = NSMinY([button frame]); - CGFloat pos1 = [bbfc indicatorPosForDragOfButton:dragButton - toPoint:NSMakePoint(x, y)]; - EXPECT_NE(button, - [bbfc buttonForDroppingOnAtPoint:NSMakePoint(x, y)]); - x = NSMaxX([button frame]); - y = NSMaxY([button frame]); - CGFloat pos2 = [bbfc indicatorPosForDragOfButton:dragButton - toPoint:NSMakePoint(x, y)]; - EXPECT_NE(button, - [bbfc buttonForDroppingOnAtPoint:NSMakePoint(x, y)]); - if (dragButton != button) { - EXPECT_NE(pos1, pos2); - } } } @@ -288,6 +307,7 @@ TEST_F(BookmarkBarFolderControllerTest, ChildFolderWidth) { bbfc.reset(SimpleBookmarkBarFolderController()); EXPECT_TRUE(bbfc.get()); + [bbfc showWindow:bbfc.get()]; CGFloat wideWidth = NSWidth([[bbfc window] frame]); RemoveLongTitleNode(); @@ -300,6 +320,53 @@ TEST_F(BookmarkBarFolderControllerTest, ChildFolderWidth) { } +// Simple scrolling tests. +TEST_F(BookmarkBarFolderControllerTest, SimpleScroll) { + scoped_nsobject<BookmarkBarFolderController> bbfc; + + AddLotsOfNodes(); + bbfc.reset(SimpleBookmarkBarFolderController()); + EXPECT_TRUE(bbfc.get()); + [bbfc showWindow:bbfc.get()]; + + // Make sure the window fits on the screen. + EXPECT_LT(NSHeight([[bbfc window] frame]), + NSHeight([[NSScreen mainScreen] frame])); + + // Scroll it up. Make sure the window has gotten bigger each time. + // Also, for each scroll, make sure our hit test finds a new button + // (to confirm the content area changed). + NSView* savedHit = nil; + for (int i=0; i<3; i++) { + CGFloat height = NSHeight([[bbfc window] frame]); + [bbfc performOneScroll:60]; + EXPECT_GT(NSHeight([[bbfc window] frame]), height); + NSView* hit = [[[bbfc window] contentView] hitTest:NSMakePoint(10, 10)]; + EXPECT_NE(hit, savedHit); + savedHit = hit; + } + + // Keep scrolling up; make sure we never get bigger than the screen. + // Also confirm we never scroll the window off the screen. + NSRect screenFrame = [[NSScreen mainScreen] frame]; + for (int i=0; i<100; i++) { + [bbfc performOneScroll:60]; + EXPECT_TRUE(NSContainsRect(screenFrame, + [[bbfc window] frame])); + } + + // Now scroll down and make sure the window size does not change. + // Also confirm we never scroll the window off the screen the other + // way. + for (int i=0; i<200; i++) { + CGFloat height = NSHeight([[bbfc window] frame]); + [bbfc performOneScroll:-60]; + EXPECT_EQ(height, NSHeight([[bbfc window] frame])); + EXPECT_TRUE(NSContainsRect(screenFrame, + [[bbfc window] frame])); + } +} + // TODO(jrg): draggingEntered: and draggingExited: trigger timers so // they are hard to test. Factor out "fire timers" into routines diff --git a/chrome/browser/cocoa/bookmark_bar_folder_view.mm b/chrome/browser/cocoa/bookmark_bar_folder_view.mm index cbbd5a2..d712944 100644 --- a/chrome/browser/cocoa/bookmark_bar_folder_view.mm +++ b/chrome/browser/cocoa/bookmark_bar_folder_view.mm @@ -3,7 +3,6 @@ // found in the LICENSE file. #import "chrome/browser/cocoa/bookmark_bar_folder_view.h" - #import "chrome/browser/cocoa/bookmark_bar_controller.h" @implementation BookmarkBarFolderView @@ -23,6 +22,7 @@ } - (void)drawRect:(NSRect)rect { + // TODO(jrg): copied from bookmark_bar_view but orientation changed. // Code dup sucks but I'm not sure I can take 16 lines and make it // generic for horiz vs vertical while keeping things simple. diff --git a/chrome/browser/cocoa/bookmark_bar_folder_window.h b/chrome/browser/cocoa/bookmark_bar_folder_window.h index 41019b7..8f96d27 100644 --- a/chrome/browser/cocoa/bookmark_bar_folder_window.h +++ b/chrome/browser/cocoa/bookmark_bar_folder_window.h @@ -13,4 +13,10 @@ @interface BookmarkBarFolderWindow : NSWindow @end + +// Content view for the above window. "Stock" other than the drawing +// of rounded corners. Only used in the nib. +@interface BookmarkBarFolderWindowContentView : NSView +@end + #endif // CHROME_BROWSER_COCOA_BOOKMARK_BAR_FOLDER_WINDOW_H_ diff --git a/chrome/browser/cocoa/bookmark_bar_folder_window.mm b/chrome/browser/cocoa/bookmark_bar_folder_window.mm index f911777..6cae7c5 100644 --- a/chrome/browser/cocoa/bookmark_bar_folder_window.mm +++ b/chrome/browser/cocoa/bookmark_bar_folder_window.mm @@ -4,16 +4,71 @@ #import "chrome/browser/cocoa/bookmark_bar_folder_window.h" +#import "base/scoped_nsobject.h" +#import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" +#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" + + @implementation BookmarkBarFolderWindow - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation { - return [super initWithContentRect:contentRect - styleMask:NSBorderlessWindowMask // override - backing:bufferingType - defer:deferCreation]; + if ((self = [super initWithContentRect:contentRect + styleMask:NSBorderlessWindowMask // override + backing:bufferingType + defer:deferCreation])) { + [self setBackgroundColor:[NSColor clearColor]]; + [self setOpaque:NO]; + } + return self; +} + +@end + + +namespace { +// Corner radius for our bookmark bar folder window. +// Copied from bubble_view.mm. +const CGFloat kViewCornerRadius = 4.0; +} + +@implementation BookmarkBarFolderWindowContentView + +- (void)drawRect:(NSRect)rect { + NSRect bounds = [self bounds]; + // Like NSMenus, only the bottom corners are rounded. + NSBezierPath* bezier = + [NSBezierPath gtm_bezierPathWithRoundRect:bounds + topLeftCornerRadius:0 + topRightCornerRadius:0 + bottomLeftCornerRadius:kViewCornerRadius + bottomRightCornerRadius:kViewCornerRadius]; + [bezier closePath]; + + // TODO(jrg): share code with info_bubble_view.mm? Or bubble_view.mm? + NSColor* base_color = [NSColor colorWithCalibratedWhite:0.5 alpha:1.0]; + NSColor* startColor = + [base_color gtm_colorAdjustedFor:GTMColorationLightHighlight + faded:YES]; + NSColor* midColor = + [base_color gtm_colorAdjustedFor:GTMColorationLightMidtone + faded:YES]; + NSColor* endColor = + [base_color gtm_colorAdjustedFor:GTMColorationLightShadow + faded:YES]; + NSColor* glowColor = + [base_color gtm_colorAdjustedFor:GTMColorationLightPenumbra + faded:YES]; + + scoped_nsobject<NSGradient> gradient( + [[NSGradient alloc] initWithColorsAndLocations:startColor, 0.0, + midColor, 0.25, + endColor, 0.5, + glowColor, 0.75, + nil]); + [gradient drawInBezierPath:bezier angle:0.0]; } @end diff --git a/chrome/browser/cocoa/bookmark_bar_folder_window_unittest.mm b/chrome/browser/cocoa/bookmark_bar_folder_window_unittest.mm index f86d6d4..586417e 100644 --- a/chrome/browser/cocoa/bookmark_bar_folder_window_unittest.mm +++ b/chrome/browser/cocoa/bookmark_bar_folder_window_unittest.mm @@ -20,3 +20,15 @@ TEST_F(BookmarkBarFolderWindowTest, Borderless) { defer:NO]); EXPECT_EQ(NSBorderlessWindowMask, [window_ styleMask]); } + +class BookmarkBarFolderWindowContentViewTest : public CocoaTest { + public: + BookmarkBarFolderWindowContentViewTest() { + view_.reset([[BookmarkBarFolderWindowContentView alloc] + initWithFrame:NSMakeRect(0, 0, 100, 100)]); + [[test_window() contentView] addSubview:view_.get()]; + } + scoped_nsobject<BookmarkBarFolderWindowContentView> view_; +}; + +TEST_VIEW(BookmarkBarFolderWindowContentViewTest, view_); diff --git a/chrome/browser/cocoa/bookmark_button.h b/chrome/browser/cocoa/bookmark_button.h index 39970ff..cb62053 100644 --- a/chrome/browser/cocoa/bookmark_button.h +++ b/chrome/browser/cocoa/bookmark_button.h @@ -96,9 +96,6 @@ class ThemeProvider; - (CGFloat)indicatorPosForDragOfButton:(BookmarkButton*)sourceButton toPoint:(NSPoint)point; -// Return the parent window for all BookmarkBarFolderController windows. -- (NSWindow*)parentWindow; - // Return the theme provider associated with this browser window. - (ThemeProvider*)themeProvider; |