diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 21:49:29 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 21:49:29 +0000 |
commit | 5db4f3daccd90723fedb244945b90600f332154e (patch) | |
tree | 71a970bd73276d559e884bd24e2130da4485a88b | |
parent | 816633af02b2e7e2c5be5f760db60dee502f326b (diff) | |
download | chromium_src-5db4f3daccd90723fedb244945b90600f332154e.zip chromium_src-5db4f3daccd90723fedb244945b90600f332154e.tar.gz chromium_src-5db4f3daccd90723fedb244945b90600f332154e.tar.bz2 |
BookmarkBubble.xib - Change control from combobox to popup button. The massive changes due to the xib are due to editing the xib on SnowLeopard.
Changes internals of bookmark bubble controller so that it will work correctly
with items with the same name.
BUG=27330
TEST=Create several bookmark folders and items using the bookmark bubble and
verify that it is still working correctly.
Review URL: http://codereview.chromium.org/384025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31719 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/nibs/BookmarkBubble.xib | 1006 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bubble_controller.h | 19 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bubble_controller.mm | 191 | ||||
-rw-r--r-- | chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm | 112 |
4 files changed, 1036 insertions, 292 deletions
diff --git a/chrome/app/nibs/BookmarkBubble.xib b/chrome/app/nibs/BookmarkBubble.xib index 4188850..fab9030 100644 --- a/chrome/app/nibs/BookmarkBubble.xib +++ b/chrome/app/nibs/BookmarkBubble.xib @@ -1,14 +1,18 @@ <?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">677</string> - <string key="IBDocument.AppKitVersion">949.54</string> - <string key="IBDocument.HIToolboxVersion">353.00</string> + <string key="IBDocument.SystemVersion">10C540</string> + <string key="IBDocument.InterfaceBuilderVersion">732</string> + <string key="IBDocument.AppKitVersion">1038.25</string> + <string key="IBDocument.HIToolboxVersion">458.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="34"/> + <integer value="39"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -16,7 +20,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"> @@ -48,7 +52,7 @@ <string key="NSWindowTitle">Window</string> <string key="NSWindowClass">BookmarkBubbleWindow</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="45997296"> <reference key="NSNextResponder"/> <int key="NSvFlags">256</int> @@ -69,9 +73,9 @@ <int key="NSCellFlags">68288064</int> <int key="NSCellFlags2">272630784</int> <string key="NSContents">^IDS_BOOMARK_BUBBLE_PAGE_BOOKMARK</string> - <object class="NSFont" key="NSSupport"> + <object class="NSFont" key="NSSupport" id="616776753"> <string key="NSName">LucidaGrande</string> - <double key="NSSize">1.300000e+01</double> + <double key="NSSize">13</double> <int key="NSfFlags">1044</int> </object> <reference key="NSControlView" ref="559397096"/> @@ -79,9 +83,9 @@ <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">controlColor</string> - <object class="NSColor" key="NSColor" id="748407352"> + <object class="NSColor" key="NSColor"> <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MC42NjY2NjY2OQA</bytes> + <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes> </object> </object> <object class="NSColor" key="NSTextColor" id="1000275559"> @@ -112,7 +116,7 @@ <string key="NSContents">^IDS_CLOSE</string> <object class="NSFont" key="NSSupport" id="26"> <string key="NSName">LucidaGrande</string> - <double key="NSSize">1.100000e+01</double> + <double key="NSSize">11</double> <int key="NSfFlags">3100</int> </object> <reference key="NSControlView" ref="82356437"/> @@ -170,7 +174,7 @@ <int key="NSButtonFlags2">129</int> <object class="NSFont" key="NSAlternateImage"> <string key="NSName">LucidaGrande</string> - <double key="NSSize">1.100000e+01</double> + <double key="NSSize">11</double> <int key="NSfFlags">16</int> </object> <string key="NSAlternateContents"/> @@ -253,7 +257,7 @@ <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">textBackgroundColor</string> - <object class="NSColor" key="NSColor" id="660986653"> + <object class="NSColor" key="NSColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MQA</bytes> </object> @@ -266,95 +270,53 @@ </object> </object> </object> - <object class="NSComboBox" id="977232728"> + <object class="NSPopUpButton" id="989815551"> <reference key="NSNextResponder" ref="583964310"/> - <int key="NSvFlags">266</int> - <string key="NSFrame">{{8, 5}, {270, 22}}</string> + <int key="NSvFlags">268</int> + <string key="NSFrame">{{5, 5}, {273, 22}}</string> <reference key="NSSuperview" ref="583964310"/> <bool key="NSEnabled">YES</bool> - <object class="NSComboBoxCell" key="NSCell" id="1003570867"> - <int key="NSCellFlags">74579521</int> - <int key="NSCellFlags2">272761856</int> - <string key="NSContents"/> + <object class="NSPopUpButtonCell" key="NSCell" id="770689768"> + <int key="NSCellFlags">-2076049856</int> + <int key="NSCellFlags2">133120</int> <reference key="NSSupport" ref="26"/> - <reference key="NSControlView" ref="977232728"/> - <bool key="NSDrawsBackground">YES</bool> - <reference key="NSBackgroundColor" ref="1033293763"/> - <reference key="NSTextColor" ref="1000275559"/> - <int key="NSVisibleItemCount">5</int> - <bool key="NSHasVerticalScroller">YES</bool> - <reference key="NSDelegate" ref="977232728"/> - <object class="NSComboTableView" key="NSTableView" id="1071628594"> - <reference key="NSNextResponder"/> - <int key="NSvFlags">274</int> - <string key="NSFrameSize">{15, 0}</string> - <reference key="NSSuperview"/> - <reference key="NSWindow"/> - <bool key="NSEnabled">YES</bool> - <object class="NSMutableArray" key="NSTableColumns"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSTableColumn"> - <integer value="0" key="NSIdentifier"/> - <double key="NSWidth">1.200000e+01</double> - <double key="NSMinWidth">1.000000e+01</double> - <double key="NSMaxWidth">1.000000e+03</double> - <object class="NSTableHeaderCell" key="NSHeaderCell"> - <int key="NSCellFlags">75628032</int> - <int key="NSCellFlags2">0</int> - <string key="NSContents"/> - <object class="NSFont" key="NSSupport"> - <string key="NSName">LucidaGrande</string> - <double key="NSSize">1.200000e+01</double> - <int key="NSfFlags">16</int> - </object> - <object class="NSColor" key="NSBackgroundColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes> - </object> - <reference key="NSTextColor" ref="660986653"/> - </object> - <object class="NSTextFieldCell" key="NSDataCell"> - <int key="NSCellFlags">338820672</int> - <int key="NSCellFlags2">1024</int> - <reference key="NSSupport" ref="26"/> - <reference key="NSControlView" ref="1071628594"/> - <bool key="NSDrawsBackground">YES</bool> - <object class="NSColor" key="NSBackgroundColor" id="744868739"> - <int key="NSColorSpace">6</int> - <string key="NSCatalogName">System</string> - <string key="NSColorName">controlBackgroundColor</string> - <reference key="NSColor" ref="748407352"/> - </object> - <reference key="NSTextColor" ref="1000275559"/> - </object> - <int key="NSResizingMask">3</int> - <bool key="NSIsResizeable">YES</bool> - <reference key="NSTableView" ref="1071628594"/> - </object> + <reference key="NSControlView" ref="989815551"/> + <int key="NSButtonFlags">109199615</int> + <int key="NSButtonFlags2">1</int> + <string key="NSAlternateContents"/> + <string key="NSKeyEquivalent"/> + <int key="NSPeriodicDelay">400</int> + <int key="NSPeriodicInterval">75</int> + <object class="NSMenuItem" key="NSMenuItem"> + <bool key="NSIsHidden">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <object class="NSCustomResource" key="NSOnImage"> + <string key="NSClassName">NSImage</string> + <string key="NSResourceName">NSMenuCheckmark</string> + </object> + <object class="NSCustomResource" key="NSMixedImage"> + <string key="NSClassName">NSImage</string> + <string key="NSResourceName">NSMenuMixedState</string> </object> - <double key="NSIntercellSpacingWidth">3.000000e+00</double> - <double key="NSIntercellSpacingHeight">2.000000e+00</double> - <reference key="NSBackgroundColor" ref="744868739"/> - <object class="NSColor" key="NSGridColor"> - <int key="NSColorSpace">6</int> - <string key="NSCatalogName">System</string> - <string key="NSColorName">gridColor</string> - <object class="NSColor" key="NSColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MC41AA</bytes> - </object> + <string key="NSAction">_popUpItemAction:</string> + <reference key="NSTarget" ref="770689768"/> + </object> + <bool key="NSMenuItemRespectAlignment">YES</bool> + <object class="NSMenu" key="NSMenu" id="95484770"> + <string key="NSTitle">OtherViews</string> + <object class="NSMutableArray" key="NSMenuItems"> + <bool key="EncodedWithXMLCoder">YES</bool> </object> - <double key="NSRowHeight">1.600000e+01</double> - <string key="NSAction">tableViewAction:</string> - <int key="NSTvFlags">-767524864</int> - <reference key="NSDelegate" ref="1003570867"/> - <reference key="NSDataSource" ref="1003570867"/> - <reference key="NSTarget" ref="1003570867"/> - <int key="NSColumnAutoresizingStyle">1</int> - <int key="NSDraggingSourceMaskForLocal">15</int> - <int key="NSDraggingSourceMaskForNonLocal">0</int> - <bool key="NSAllowsTypeSelect">YES</bool> + <reference key="NSMenuFont" ref="616776753"/> </object> + <int key="NSSelectedIndex">-1</int> + <int key="NSPreferredEdge">1</int> + <bool key="NSUsesItemFromMenu">YES</bool> + <bool key="NSAltersState">YES</bool> + <int key="NSArrowPosition">2</int> </object> </object> </object> @@ -392,21 +354,13 @@ <reference key="NSSuperview"/> </object> <string key="NSScreenRect">{{0, 0}, {2560, 1578}}</string> - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string> + <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> </object> </object> <object class="IBObjectContainer" key="IBDocument.Objects"> <object class="NSMutableArray" key="connectionRecords"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">delegate</string> - <reference key="source" ref="977232728"/> - <reference key="destination" ref="1001"/> - </object> - <int key="connectionID">23</int> - </object> - <object class="IBConnectionRecord"> <object class="IBActionConnection" key="connection"> <string key="label">remove:</string> <reference key="source" ref="1001"/> @@ -440,14 +394,6 @@ </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> - <string key="label">folderComboBox_</string> - <reference key="source" ref="1001"/> - <reference key="destination" ref="977232728"/> - </object> - <int key="connectionID">33</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> <string key="label">viewToResize_</string> <reference key="source" ref="900754038"/> <reference key="destination" ref="1005"/> @@ -510,45 +456,59 @@ </object> <int key="connectionID">56</int> </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">folderChanged:</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="989815551"/> + </object> + <int key="connectionID">63</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">folderPopUpButton_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="989815551"/> + </object> + <int key="connectionID">64</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="376579351"> - <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="376579351"/> - <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="376579351"/> + <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="376579351"/> + <reference key="parent" ref="0"/> <string key="objectName">Application</string> </object> <object class="IBObjectRecord"> <int key="objectID">31</int> <reference key="object" ref="704223344"/> - <reference key="parent" ref="376579351"/> + <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">42</int> <reference key="object" ref="279326944"/> - <reference key="parent" ref="376579351"/> + <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">50</int> @@ -557,7 +517,7 @@ <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="45997296"/> </object> - <reference key="parent" ref="376579351"/> + <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> <int key="objectID">51</int> @@ -625,7 +585,7 @@ <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="39428350"/> - <reference ref="977232728"/> + <reference ref="989815551"/> </object> <reference key="parent" ref="1005"/> </object> @@ -639,20 +599,6 @@ <reference key="parent" ref="899552678"/> </object> <object class="IBObjectRecord"> - <int key="objectID">14</int> - <reference key="object" ref="977232728"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="1003570867"/> - </object> - <reference key="parent" ref="899552678"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">15</int> - <reference key="object" ref="1003570867"/> - <reference key="parent" ref="977232728"/> - </object> - <object class="IBObjectRecord"> <int key="objectID">13</int> <reference key="object" ref="905670292"/> <reference key="parent" ref="39428350"/> @@ -732,11 +678,37 @@ <reference key="object" ref="368795405"/> <reference key="parent" ref="559397096"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">57</int> + <reference key="object" ref="989815551"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="770689768"/> + </object> + <reference key="parent" ref="899552678"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">58</int> + <reference key="object" ref="770689768"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="95484770"/> + </object> + <reference key="parent" ref="989815551"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">59</int> + <reference key="object" ref="95484770"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + <reference key="parent" ref="770689768"/> + </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> @@ -750,8 +722,6 @@ <string>11.IBPluginDependency</string> <string>12.IBPluginDependency</string> <string>13.IBPluginDependency</string> - <string>14.IBPluginDependency</string> - <string>15.IBPluginDependency</string> <string>16.IBPluginDependency</string> <string>17.IBPluginDependency</string> <string>18.IBPluginDependency</string> @@ -767,6 +737,10 @@ <string>50.IBWindowTemplateEditedContentRect</string> <string>50.NSWindowTemplate.visibleAtLaunch</string> <string>51.IBPluginDependency</string> + <string>57.IBPluginDependency</string> + <string>58.IBPluginDependency</string> + <string>59.IBEditorWindowLastContentRect</string> + <string>59.IBPluginDependency</string> <string>8.IBPluginDependency</string> <string>9.IBPluginDependency</string> </object> @@ -781,7 +755,7 @@ <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBUserGuide"> <reference key="view" ref="1005"/> - <float key="location">8.000000e+00</float> + <double key="location">8</double> <int key="affinity">3</int> </object> </object> @@ -801,8 +775,6 @@ <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>{{241, 633}, {374, 145}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{241, 633}, {374, 145}}</string> @@ -810,13 +782,15 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>{{314, 702}, {273, 4}}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> </object> </object> <object class="NSMutableDictionary" key="unlocalizedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> + <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> @@ -824,15 +798,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">56</int> + <int key="maxID">64</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -842,10 +814,11 @@ <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>cancel:</string> <string>edit:</string> + <string>folderChanged:</string> <string>ok:</string> <string>remove:</string> </object> @@ -855,22 +828,23 @@ <string>id</string> <string>id</string> <string>id</string> + <string>id</string> </object> </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>bigTitle_</string> <string>delegate_</string> - <string>folderComboBox_</string> + <string>folderPopUpButton_</string> <string>nameTextField_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>NSTextField</string> <string>id</string> - <string>NSComboBox</string> + <string>NSPopUpButton</string> <string>NSTextField</string> </object> </object> @@ -908,7 +882,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> @@ -931,7 +905,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> @@ -954,7 +928,7 @@ <string key="superclassName">NSView</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSMutableArray" key="dict.sortedKeys"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>viewToResize_</string> <string>viewToSlideAndResize_</string> @@ -991,8 +965,722 @@ </object> </object> </object> + <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBPartialClassDescription"> + <string key="className">NSActionCell</string> + <string key="superclassName">NSCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSApplication</string> + <string key="superclassName">NSResponder</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="766177532"> + <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="112130294"> + <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="90119806"> + <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">NSBox</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSBox.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSButton</string> + <string key="superclassName">NSControl</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSButton.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSButtonCell</string> + <string key="superclassName">NSActionCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSCell</string> + <string key="superclassName">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSControl</string> + <string key="superclassName">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier" id="421770315"> + <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="22859185"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSMenuItemCell</string> + <string key="superclassName">NSButtonCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSMenuItemCell.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="766177532"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <reference key="sourceIdentifier" ref="112130294"/> + </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="90119806"/> + </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="421770315"/> + </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="360841413"> + <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="22859185"/> + </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="539511914"> + <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="133988484"> + <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">NSPopUpButton</string> + <string key="superclassName">NSButton</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSPopUpButton.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSPopUpButtonCell</string> + <string key="superclassName">NSMenuItemCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSPopUpButtonCell.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">NSTextField</string> + <string key="superclassName">NSControl</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSTextFieldCell</string> + <string key="superclassName">NSActionCell</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <string key="superclassName">NSResponder</string> + <reference key="sourceIdentifier" ref="539511914"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <reference key="sourceIdentifier" ref="360841413"/> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <string key="superclassName">NSResponder</string> + <reference key="sourceIdentifier" ref="133988484"/> + </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_bubble_controller.h b/chrome/browser/cocoa/bookmark_bubble_controller.h index 9aba12f..506af6b 100644 --- a/chrome/browser/cocoa/bookmark_bubble_controller.h +++ b/chrome/browser/cocoa/bookmark_bubble_controller.h @@ -32,15 +32,11 @@ class BookmarkNode; BookmarkModel* model_; // weak const BookmarkNode* node_; // weak - // A mapping from NSComboBox index to parent nodes. - scoped_nsobject<NSMutableArray> parentMapping_; - BOOL alreadyBookmarked_; - scoped_nsobject<NSString> chooseAnotherFolder_; IBOutlet NSTextField* bigTitle_; // "Bookmark" or "Bookmark Added!" IBOutlet NSTextField* nameTextField_; - IBOutlet NSComboBox* folderComboBox_; + IBOutlet NSPopUpButton* folderPopUpButton_; } // |node| is the bookmark node we edit in this bubble. @@ -61,19 +57,18 @@ class BookmarkNode; - (IBAction)ok:(id)sender; - (IBAction)remove:(id)sender; - (IBAction)cancel:(id)sender; - +- (IBAction)folderChanged:(id)sender; @end // Exposed only for unit testing. @interface BookmarkBubbleController(ExposedForUnitTesting) -- (void)fillInFolderList; -- (void)addFolderNodes:(const BookmarkNode*)parent toComboBox:(NSComboBox*)box; -- (void)updateBookmarkNode; -- (void)setTitle:(NSString*)title parentFolder:(NSString*)folder; +- (void)addFolderNodes:(const BookmarkNode*)parent + toPopUpButton:(NSPopUpButton*)button; +- (void)setTitle:(NSString*)title parentFolder:(const BookmarkNode*)parent; - (void)setParentFolderSelection:(const BookmarkNode*)parent; -- (NSString*)chooseAnotherFolderString; -- (NSComboBox*)folderComboBox; ++ (NSString*)chooseAnotherFolderString; +- (NSPopUpButton*)folderPopUpButton; @end diff --git a/chrome/browser/cocoa/bookmark_bubble_controller.mm b/chrome/browser/cocoa/bookmark_bubble_controller.mm index 5e1d7f1..887d580 100644 --- a/chrome/browser/cocoa/bookmark_bubble_controller.mm +++ b/chrome/browser/cocoa/bookmark_bubble_controller.mm @@ -11,8 +11,30 @@ #include "chrome/browser/metrics/user_metrics.h" #include "grit/generated_resources.h" +// An object to represent the ChooseAnotherFolder item in the pop up. +@interface ChooseAnotherFolder : NSObject +@end + +@implementation ChooseAnotherFolder +@end + +@interface BookmarkBubbleController () +- (void)updateBookmarkNode; +- (void)fillInFolderList; +@end + @implementation BookmarkBubbleController ++ (id)chooseAnotherFolderObject { + // Singleton object to act as a representedObject for the "choose another + // folder" item in the pop up. + static ChooseAnotherFolder* object = nil; + if (!object) { + object = [[ChooseAnotherFolder alloc] init]; + } + return object; +} + - (id)initWithDelegate:(id<BookmarkBubbleControllerDelegate>)delegate parentWindow:(NSWindow*)parentWindow topLeftForBubble:(NSPoint)topLeftForBubble @@ -29,8 +51,6 @@ model_ = model; node_ = node; alreadyBookmarked_ = alreadyBookmarked; - // But this is strong. - parentMapping_.reset([[NSMutableArray alloc] init]); } return self; } @@ -83,7 +103,7 @@ // remove the bookmark. - (IBAction)cancel:(id)sender { if (!alreadyBookmarked_) { - // |-remove:| calls |-close| so we don't have to bother. + // |-remove:| calls |-close| so don't do it. [self remove:sender]; } else { [self ok:sender]; @@ -97,69 +117,30 @@ [self ok:sender]; } -// We are the delegate of the combo box so we can tell when "choose -// another folder" was picked. -- (void)comboBoxSelectionDidChange:(NSNotification*)notification { - NSString* selected = [folderComboBox_ objectValueOfSelectedItem]; - if ([selected isEqual:chooseAnotherFolder_.get()]) { +// The controller is the target of the pop up button box action so it can +// handle when "choose another folder" was picked. +- (IBAction)folderChanged:(id)sender { + DCHECK([sender isEqual:folderPopUpButton_]); + NSMenuItem* selected = [folderPopUpButton_ selectedItem]; + ChooseAnotherFolder* chooseItem = [[self class] chooseAnotherFolderObject]; + if ([[selected representedObject] isEqual:chooseItem]) { UserMetrics::RecordAction(L"BookmarkBubble_EditFromCombobox", model_->profile()); [self showEditor]; } } -// We are the delegate of our own window so we know when we lose key. -// When we lose key status we close, mirroring Windows behavior. +// The controller is the delegate of the window so it receives did resign key +// notifications. When key is resigned mirror Windows behavior and close the +// window. - (void)windowDidResignKey:(NSNotification*)notification { DCHECK_EQ([notification object], [self window]); - // Can't call close from within a window delegate method. We can call - // close after it's finished though. So this will call close for us next - // time through the event loop. + // Can't call close from within a window delegate method. Call close for the + // next time through the event loop. [self performSelector:@selector(ok:) withObject:self afterDelay:0]; } -@end // BookmarkBubbleController - - -@implementation BookmarkBubbleController(ExposedForUnitTesting) - - -// Fill in all information related to the folder combo box. -- (void)fillInFolderList { - [nameTextField_ setStringValue:base::SysWideToNSString(node_->GetTitle())]; - DCHECK([parentMapping_ count] == 0); - DCHECK([folderComboBox_ numberOfItems] == 0); - [self addFolderNodes:model_->root_node() toComboBox:folderComboBox_]; - - // Add "Choose another folder...". Remember it for later to compare against. - chooseAnotherFolder_.reset( - [l10n_util::GetNSStringWithFixup(IDS_BOOMARK_BUBBLE_CHOOSER_ANOTHER_FOLDER) - retain]); - [folderComboBox_ addItemWithObjectValue:chooseAnotherFolder_.get()]; - - // Finally, select the current parent. - NSString* parentTitle = base::SysWideToNSString( - node_->GetParent()->GetTitle()); - [folderComboBox_ selectItemWithObjectValue:parentTitle]; -} - -// For the given folder node, walk the tree and add folder names to -// the given combo box. -- (void)addFolderNodes:(const BookmarkNode*)parent toComboBox:(NSComboBox*)box { - NSString* title = base::SysWideToNSString(parent->GetTitle()); - if ([title length]) { // no title if root - [box addItemWithObjectValue:title]; - [parentMapping_ insertObject:[NSValue valueWithPointer:parent] - atIndex:[box numberOfItems]-1]; - } - for (int i = 0; i < parent->GetChildCount(); i++) { - const BookmarkNode* child = parent->GetChild(i); - if (child->is_folder()) - [self addFolderNodes:child toComboBox:box]; - } -} - // Look at the dialog; if the user has changed anything, update the // bookmark node to reflect this. - (void)updateBookmarkNode { @@ -175,55 +156,89 @@ } // Then the parent folder. const BookmarkNode* oldParent = node_->GetParent(); - NSInteger selectedIndex = [folderComboBox_ indexOfSelectedItem]; - if (selectedIndex == -1) // No selection ever made. - return; - - if ((NSUInteger)selectedIndex == [parentMapping_ count]) { + NSMenuItem* selectedItem = [folderPopUpButton_ selectedItem]; + id representedObject = [selectedItem representedObject]; + if ([representedObject isEqual:[[self class] chooseAnotherFolderObject]]) { // "Choose another folder..." return; } - const BookmarkNode* newParent = static_cast<const BookmarkNode*>( - [[parentMapping_ objectAtIndex:selectedIndex] pointerValue]); + const BookmarkNode* newParent = + static_cast<const BookmarkNode*>([representedObject pointerValue]); DCHECK(newParent); if (oldParent != newParent) { - int index = newParent->GetChildCount(); - model_->Move(node_, newParent, index); - UserMetrics::RecordAction(L"BookmarkBubble_ChangeParent", - model_->profile()); + int index = newParent->GetChildCount(); + model_->Move(node_, newParent, index); + UserMetrics::RecordAction(L"BookmarkBubble_ChangeParent", + model_->profile()); } } -- (void)setTitle:(NSString*)title parentFolder:(NSString*)folder { - [nameTextField_ setStringValue:title]; - [folderComboBox_ selectItemWithObjectValue:folder]; +// Fill in all information related to the folder pop up button. +- (void)fillInFolderList { + [nameTextField_ setStringValue:base::SysWideToNSString(node_->GetTitle())]; + DCHECK([folderPopUpButton_ numberOfItems] == 0); + [self addFolderNodes:model_->root_node() toPopUpButton:folderPopUpButton_]; + NSMenu* menu = [folderPopUpButton_ menu]; + NSString* title = [[self class] chooseAnotherFolderString]; + NSMenuItem *item = [menu addItemWithTitle:title + action:NULL + keyEquivalent:@""]; + ChooseAnotherFolder* obj = [[self class] chooseAnotherFolderObject]; + [item setRepresentedObject:obj]; + // Finally, select the current parent. + NSValue* parentValue = [NSValue valueWithPointer:node_->GetParent()]; + NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; + [folderPopUpButton_ selectItemAtIndex:idx]; } -// Pick a specific parent node in the selection by finding the right -// combo box index. -- (void)setParentFolderSelection:(const BookmarkNode*)parent { - // Expectation: we have a parent mapping for all items in the - // folderComboBox except the last one ("Choose another folder..."). - DCHECK((NSInteger)[parentMapping_ count] == - [folderComboBox_ numberOfItems]-1); - for (NSUInteger i = 0; i < [parentMapping_ count]; i++) { - const BookmarkNode* possible = static_cast<const BookmarkNode*>( - [[parentMapping_ objectAtIndex:i] pointerValue]); - DCHECK(possible); - if (possible == parent) { - [folderComboBox_ selectItemAtIndex:i]; - return; - } +@end // BookmarkBubbleController + + +@implementation BookmarkBubbleController(ExposedForUnitTesting) + ++ (NSString*)chooseAnotherFolderString { + return l10n_util::GetNSStringWithFixup( + IDS_BOOMARK_BUBBLE_CHOOSER_ANOTHER_FOLDER); +} + +// For the given folder node, walk the tree and add folder names to +// the given pop up button. +- (void)addFolderNodes:(const BookmarkNode*)parent + toPopUpButton:(NSPopUpButton*)button { + NSString* title = base::SysWideToNSString(parent->GetTitle()); + if ([title length]) { // no title if root + NSMenu* menu = [button menu]; + NSMenuItem* item = [menu addItemWithTitle:title + action:NULL + keyEquivalent:@""]; + [item setRepresentedObject:[NSValue valueWithPointer:parent]]; + } + for (int i = 0; i < parent->GetChildCount(); i++) { + const BookmarkNode* child = parent->GetChild(i); + if (child->is_folder()) + [self addFolderNodes:child toPopUpButton:button]; } - NOTREACHED(); } -- (NSString*)chooseAnotherFolderString { - return chooseAnotherFolder_.get(); +- (void)setTitle:(NSString*)title parentFolder:(const BookmarkNode*)parent { + [nameTextField_ setStringValue:title]; + [self setParentFolderSelection:parent]; +} + +// Pick a specific parent node in the selection by finding the right +// pop up button index. +- (void)setParentFolderSelection:(const BookmarkNode*)parent { + // Expectation: There is a parent mapping for all items in the + // folderPopUpButton except the last one ("Choose another folder..."). + NSMenu* menu = [folderPopUpButton_ menu]; + NSValue* parentValue = [NSValue valueWithPointer:parent]; + NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; + DCHECK(idx != -1); + [folderPopUpButton_ selectItemAtIndex:idx]; } -- (NSComboBox*)folderComboBox { - return folderComboBox_; +- (NSPopUpButton*)folderPopUpButton { + return folderPopUpButton_; } @end // implementation BookmarkBubbleController(ExposedForUnitTesting) diff --git a/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm index d632d92..2295d48 100644 --- a/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm +++ b/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm @@ -118,28 +118,38 @@ TEST_F(BookmarkBubbleControllerTest, TestBubbleWindow) { TEST_F(BookmarkBubbleControllerTest, TestFillInFolder) { // Create some folders, including a nested folder BookmarkModel* model = GetBookmarkModel(); - const BookmarkNode* node1 = model->AddGroup(model->GetBookmarkBarNode(), - 0, L"one"); - const BookmarkNode* node2 = model->AddGroup(model->GetBookmarkBarNode(), - 1, L"two"); - const BookmarkNode* node3 = model->AddGroup(model->GetBookmarkBarNode(), - 2, L"three"); - const BookmarkNode* node4 = model->AddGroup(node2, - 0, L"sub"); - model->AddURL(node1, 0, L"title1", GURL("http://www.google.com")); - model->AddURL(node3, 0, L"title2", GURL("http://www.google.com")); - model->AddURL(node4, 0, L"title3", GURL("http://www.google.com/reader")); + EXPECT_TRUE(model); + const BookmarkNode* bookmarkBarNode = model->GetBookmarkBarNode(); + EXPECT_TRUE(bookmarkBarNode); + const BookmarkNode* node1 = model->AddGroup(bookmarkBarNode, 0, L"one"); + EXPECT_TRUE(node1); + const BookmarkNode* node2 = model->AddGroup(bookmarkBarNode, 1, L"two"); + EXPECT_TRUE(node2); + const BookmarkNode* node3 = model->AddGroup(bookmarkBarNode, 2, L"three"); + EXPECT_TRUE(node3); + const BookmarkNode* node4 = model->AddGroup(node2, 0, L"sub"); + EXPECT_TRUE(node4); + const BookmarkNode* node5 = + model->AddURL(node1, 0, L"title1", GURL("http://www.google.com")); + EXPECT_TRUE(node5); + const BookmarkNode* node6 = + model->AddURL(node3, 0, L"title2", GURL("http://www.google.com")); + EXPECT_TRUE(node6); + const BookmarkNode* node7 = + model->AddURL(node4, 0, L"title3", GURL("http://www.google.com/reader")); + EXPECT_TRUE(node7); BookmarkBubbleController* controller = ControllerForNode(node4); EXPECT_TRUE(controller); - NSArray* items = [[controller folderComboBox] objectValues]; - EXPECT_TRUE([items containsObject:@"one"]); - EXPECT_TRUE([items containsObject:@"two"]); - EXPECT_TRUE([items containsObject:@"three"]); - EXPECT_TRUE([items containsObject:@"sub"]); - EXPECT_FALSE([items containsObject:@"title1"]); - EXPECT_FALSE([items containsObject:@"title2"]); + NSArray* titles = + [[[controller folderPopUpButton] itemArray] valueForKey:@"title"]; + EXPECT_TRUE([titles containsObject:@"one"]); + EXPECT_TRUE([titles containsObject:@"two"]); + EXPECT_TRUE([titles containsObject:@"three"]); + EXPECT_TRUE([titles containsObject:@"sub"]); + EXPECT_FALSE([titles containsObject:@"title1"]); + EXPECT_FALSE([titles containsObject:@"title2"]); } // Click on edit; bubble gets closed. @@ -179,17 +189,23 @@ TEST_F(BookmarkBubbleControllerTest, TestClose) { // User changes title and parent folder in the UI TEST_F(BookmarkBubbleControllerTest, TestUserEdit) { BookmarkModel* model = GetBookmarkModel(); - const BookmarkNode* node = model->AddURL(model->GetBookmarkBarNode(), + EXPECT_TRUE(model); + const BookmarkNode* bookmarkBarNode = model->GetBookmarkBarNode(); + EXPECT_TRUE(bookmarkBarNode); + const BookmarkNode* node = model->AddURL(bookmarkBarNode, 0, L"short-title", GURL("http://www.google.com")); - model->AddGroup(model->GetBookmarkBarNode(), 0, L"grandma"); - model->AddGroup(model->GetBookmarkBarNode(), 0, L"grandpa"); + const BookmarkNode* grandma = model->AddGroup(bookmarkBarNode, 0, L"grandma"); + EXPECT_TRUE(grandma); + const BookmarkNode* grandpa = model->AddGroup(bookmarkBarNode, 0, L"grandpa"); + EXPECT_TRUE(grandpa); + BookmarkBubbleController* controller = ControllerForNode(node); EXPECT_TRUE(controller); // simulate a user edit - [controller setTitle:@"oops" parentFolder:@"grandma"]; + [controller setTitle:@"oops" parentFolder:grandma]; [controller edit:controller]; // Make sure bookmark has changed @@ -199,29 +215,58 @@ TEST_F(BookmarkBubbleControllerTest, TestUserEdit) { // Confirm happiness with parent nodes that have the same name. TEST_F(BookmarkBubbleControllerTest, TestNewParentSameName) { + BookmarkModel* model = GetBookmarkModel(); + EXPECT_TRUE(model); + const BookmarkNode* bookmarkBarNode = model->GetBookmarkBarNode(); + EXPECT_TRUE(bookmarkBarNode); for (int i=0; i<2; i++) { - BookmarkModel* model = GetBookmarkModel(); - const BookmarkNode* node = model->AddURL(model->GetBookmarkBarNode(), + const BookmarkNode* node = model->AddURL(bookmarkBarNode, 0, L"short-title", GURL("http://www.google.com")); - model->AddGroup(model->GetBookmarkBarNode(), 0, L"NAME"); - model->AddGroup(model->GetBookmarkBarNode(), 0, L"NAME"); - model->AddGroup(model->GetBookmarkBarNode(), 0, L"NAME"); + EXPECT_TRUE(node); + const BookmarkNode* group = model->AddGroup(bookmarkBarNode, 0, L"NAME"); + EXPECT_TRUE(group); + group = model->AddGroup(bookmarkBarNode, 0, L"NAME"); + EXPECT_TRUE(group); + group = model->AddGroup(bookmarkBarNode, 0, L"NAME"); + EXPECT_TRUE(group); BookmarkBubbleController* controller = ControllerForNode(node); EXPECT_TRUE(controller); // simulate a user edit - [controller setParentFolderSelection: - model->GetBookmarkBarNode()->GetChild(i)]; + [controller setParentFolderSelection:bookmarkBarNode->GetChild(i)]; [controller edit:controller]; // Make sure bookmark has changed, and that the parent is what we // expect. This proves nobody did searching based on name. - EXPECT_EQ(node->GetParent(), model->GetBookmarkBarNode()->GetChild(i)); + EXPECT_EQ(node->GetParent(), bookmarkBarNode->GetChild(i)); } } +// Confirm happiness with nodes with the same Name +TEST_F(BookmarkBubbleControllerTest, TestDuplicateNodeNames) { + BookmarkModel* model = GetBookmarkModel(); + const BookmarkNode* bookmarkBarNode = model->GetBookmarkBarNode(); + EXPECT_TRUE(bookmarkBarNode); + const BookmarkNode* node1 = model->AddGroup(bookmarkBarNode, 0, L"NAME"); + EXPECT_TRUE(node1); + const BookmarkNode* node2 = model->AddGroup(bookmarkBarNode, 0, L"NAME"); + EXPECT_TRUE(node2); + BookmarkBubbleController* controller = ControllerForNode(bookmarkBarNode); + EXPECT_TRUE(controller); + + NSPopUpButton* button = [controller folderPopUpButton]; + [controller setParentFolderSelection:node1]; + NSMenuItem* item = [button selectedItem]; + id itemObject = [item representedObject]; + EXPECT_TRUE([itemObject isEqual:[NSValue valueWithPointer:node1]]); + [controller setParentFolderSelection:node2]; + item = [button selectedItem]; + itemObject = [item representedObject]; + EXPECT_TRUE([itemObject isEqual:[NSValue valueWithPointer:node2]]); +} + // Click the "remove" button TEST_F(BookmarkBubbleControllerTest, TestRemove) { BookmarkModel* model = GetBookmarkModel(); @@ -240,7 +285,7 @@ TEST_F(BookmarkBubbleControllerTest, TestRemove) { } // Confirm picking "choose another folder" caused edit: to be called. -TEST_F(BookmarkBubbleControllerTest, ComboSelectionChanged) { +TEST_F(BookmarkBubbleControllerTest, PopUpSelectionChanged) { BookmarkModel* model = GetBookmarkModel(); GURL gurl("http://www.google.com"); const BookmarkNode* node = model->AddURL(model->GetBookmarkBarNode(), @@ -249,9 +294,10 @@ TEST_F(BookmarkBubbleControllerTest, ComboSelectionChanged) { BookmarkBubbleController* controller = ControllerForNode(node); EXPECT_TRUE(controller); - NSString* chooseAnotherFolder = [controller chooseAnotherFolderString]; + NSPopUpButton* button = [controller folderPopUpButton]; + [button selectItemWithTitle:[[controller class] chooseAnotherFolderString]]; EXPECT_EQ([delegate_ edits], 0); - [controller setTitle:@"DOH!" parentFolder:chooseAnotherFolder]; + [button sendAction:[button action] to:[button target]]; EXPECT_EQ([delegate_ edits], 1); } |