diff options
17 files changed, 226 insertions, 891 deletions
diff --git a/chrome/app/nibs/BookmarkBubble.xib b/chrome/app/nibs/BookmarkBubble.xib index 44035e5c..1574949 100644 --- a/chrome/app/nibs/BookmarkBubble.xib +++ b/chrome/app/nibs/BookmarkBubble.xib @@ -459,6 +459,14 @@ </object> <int key="connectionID">64</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">bubble_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="1005"/> + </object> + <int key="connectionID">65</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -797,7 +805,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">64</int> + <int key="maxID">65</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -829,12 +837,14 @@ <object class="NSMutableArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>bigTitle_</string> + <string>bubble_</string> <string>folderPopUpButton_</string> <string>nameTextField_</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>NSTextField</string> + <string>InfoBubbleView</string> <string>NSPopUpButton</string> <string>NSTextField</string> </object> @@ -960,6 +970,13 @@ <string key="className">NSWindow</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/chrome_browser_window.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> <string key="minorKey">browser/cocoa/themed_window.h</string> </object> </object> diff --git a/chrome/app/nibs/Toolbar.xib b/chrome/app/nibs/Toolbar.xib index 2525a8c..4acd5df 100644 --- a/chrome/app/nibs/Toolbar.xib +++ b/chrome/app/nibs/Toolbar.xib @@ -1,15 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> +<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03"> <data> <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">10C540</string> - <string key="IBDocument.InterfaceBuilderVersion">761</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">761</string> - </object> + <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> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> <integer value="1"/> @@ -20,7 +16,7 @@ </object> <object class="NSMutableDictionary" key="IBDocument.Metadata"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys" id="0"> + <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> </object> <object class="NSMutableArray" key="dict.values"> @@ -53,7 +49,7 @@ <object class="NSTextField" id="535508469"> <reference key="NSNextResponder" ref="928520650"/> <int key="NSvFlags">266</int> - <string key="NSFrame">{{165, 5}, {341, 27}}</string> + <string key="NSFrame">{{130, 5}, {376, 27}}</string> <reference key="NSSuperview" ref="928520650"/> <int key="NSTag">33004</int> <bool key="NSEnabled">YES</bool> @@ -63,7 +59,7 @@ <string key="NSContents">chromium.org</string> <object class="NSFont" key="NSSupport"> <string key="NSName">LucidaGrande</string> - <double key="NSSize">13</double> + <double key="NSSize">1.300000e+01</double> <int key="NSfFlags">16</int> </object> <reference key="NSControlView" ref="535508469"/> @@ -91,7 +87,7 @@ <object class="NSButton" id="368496192"> <reference key="NSNextResponder" ref="928520650"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{101, 5}, {31, 27}}</string> + <string key="NSFrame">{{66, 5}, {31, 27}}</string> <reference key="NSSuperview" ref="928520650"/> <int key="NSTag">33003</int> <bool key="NSEnabled">YES</bool> @@ -101,7 +97,7 @@ <string key="NSContents"/> <object class="NSFont" key="NSSupport" id="64724822"> <string key="NSName">LucidaGrande</string> - <double key="NSSize">13</double> + <double key="NSSize">1.300000e+01</double> <int key="NSfFlags">1044</int> </object> <reference key="NSControlView" ref="368496192"/> @@ -117,50 +113,21 @@ <int key="NSPeriodicInterval">75</int> </object> </object> - <object class="NSButton" id="559273956"> - <reference key="NSNextResponder" ref="928520650"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{136, 5}, {29, 27}}</string> - <reference key="NSSuperview" ref="928520650"/> - <int key="NSTag">35000</int> - <bool key="NSEnabled">YES</bool> - <object class="NSButtonCell" key="NSCell" id="960568152"> - <int key="NSCellFlags">67239424</int> - <int key="NSCellFlags2">134250496</int> - <string key="NSContents"/> - <reference key="NSSupport" ref="64724822"/> - <reference key="NSControlView" ref="559273956"/> - <int key="NSTag">-1</int> - <int key="NSButtonFlags">-2030812929</int> - <int key="NSButtonFlags2">6</int> - <object class="NSCustomResource" key="NSNormalImage"> - <string key="NSClassName">NSImage</string> - <string key="NSResourceName">star_Template</string> - </object> - <object class="NSCustomResource" key="NSAlternateImage"> - <string key="NSClassName">NSImage</string> - <string key="NSResourceName">starred</string> - </object> - <string key="NSAlternateContents"/> - <string key="NSKeyEquivalent"/> - <int key="NSPeriodicDelay">400</int> - <int key="NSPeriodicInterval">75</int> - </object> - </object> <object class="NSButton" id="458854861"> <reference key="NSNextResponder" ref="928520650"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{66, 5}, {31, 27}}</string> + <string key="NSFrame">{{101, 5}, {31, 27}}</string> <reference key="NSSuperview" ref="928520650"/> <int key="NSTag">33002</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="386107000"> - <int key="NSCellFlags">-2080244224</int> + <int key="NSCellFlags">67239424</int> <int key="NSCellFlags2">134250496</int> <string key="NSContents"/> <reference key="NSSupport" ref="64724822"/> + <int key="NSTag">-1</int> <reference key="NSControlView" ref="458854861"/> - <int key="NSButtonFlags">-2033958657</int> + <int key="NSButtonFlags">-2033434369</int> <int key="NSButtonFlags2">6</int> <object class="NSCustomResource" key="NSNormalImage"> <string key="NSClassName">NSImage</string> @@ -184,8 +151,8 @@ <int key="NSCellFlags2">134250496</int> <string key="NSContents"/> <reference key="NSSupport" ref="64724822"/> - <reference key="NSControlView" ref="781044416"/> <int key="NSTag">1</int> + <reference key="NSControlView" ref="781044416"/> <int key="NSButtonFlags">-2031861505</int> <int key="NSButtonFlags2">6</int> <object class="NSCustomResource" key="NSNormalImage"> @@ -210,8 +177,8 @@ <int key="NSCellFlags2">134250496</int> <string key="NSContents"/> <reference key="NSSupport" ref="64724822"/> - <reference key="NSControlView" ref="634265909"/> <int key="NSTag">-2</int> + <reference key="NSControlView" ref="634265909"/> <int key="NSButtonFlags">-2030812929</int> <int key="NSButtonFlags2">6</int> <object class="NSCustomResource" key="NSNormalImage"> @@ -236,8 +203,8 @@ <int key="NSCellFlags2">134250496</int> <string key="NSContents"/> <reference key="NSSupport" ref="64724822"/> - <reference key="NSControlView" ref="480525277"/> <int key="NSTag">1</int> + <reference key="NSControlView" ref="480525277"/> <int key="NSButtonFlags">-2031861505</int> <int key="NSButtonFlags2">6</int> <object class="NSCustomResource" key="NSNormalImage"> @@ -389,14 +356,6 @@ </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> - <string key="label">starButton_</string> - <reference key="source" ref="1001"/> - <reference key="destination" ref="559273956"/> - </object> - <int key="connectionID">34</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> <string key="label">homeButton_</string> <reference key="source" ref="1001"/> <reference key="destination" ref="368496192"/> @@ -420,14 +379,6 @@ <int key="connectionID">41</int> </object> <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">commandDispatch:</string> - <reference key="source" ref="1003"/> - <reference key="destination" ref="559273956"/> - </object> - <int key="connectionID">121</int> - </object> - <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">owner_</string> <reference key="source" ref="1044322163"/> @@ -473,26 +424,28 @@ <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBObjectRecord"> <int key="objectID">0</int> - <reference key="object" ref="0"/> + <object class="NSArray" key="object" id="349743695"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> <reference key="children" ref="1000"/> <nil key="parent"/> </object> <object class="IBObjectRecord"> <int key="objectID">-2</int> <reference key="object" ref="1001"/> - <reference key="parent" ref="0"/> - <string key="objectName">File's Owner</string> + <reference key="parent" ref="349743695"/> + <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string> </object> <object class="IBObjectRecord"> <int key="objectID">-1</int> <reference key="object" ref="1003"/> - <reference key="parent" ref="0"/> + <reference key="parent" ref="349743695"/> <string key="objectName">First Responder</string> </object> <object class="IBObjectRecord"> <int key="objectID">-3</int> <reference key="object" ref="1004"/> - <reference key="parent" ref="0"/> + <reference key="parent" ref="349743695"/> <string key="objectName">Application</string> </object> <object class="IBObjectRecord"> @@ -506,12 +459,11 @@ <reference ref="781044416"/> <reference ref="368496192"/> <reference ref="480525277"/> - <reference ref="559273956"/> <reference ref="602421009"/> <reference ref="571076484"/> <reference ref="421615633"/> </object> - <reference key="parent" ref="0"/> + <reference key="parent" ref="349743695"/> </object> <object class="IBObjectRecord"> <int key="objectID">2</int> @@ -598,20 +550,6 @@ <reference key="parent" ref="634265909"/> </object> <object class="IBObjectRecord"> - <int key="objectID">32</int> - <reference key="object" ref="559273956"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="960568152"/> - </object> - <reference key="parent" ref="928520650"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">33</int> - <reference key="object" ref="960568152"/> - <reference key="parent" ref="559273956"/> - </object> - <object class="IBObjectRecord"> <int key="objectID">36</int> <reference key="object" ref="571076484"/> <object class="NSMutableArray" key="children"> @@ -642,12 +580,12 @@ <object class="IBObjectRecord"> <int key="objectID">122</int> <reference key="object" ref="1044322163"/> - <reference key="parent" ref="0"/> + <reference key="parent" ref="349743695"/> </object> <object class="IBObjectRecord"> <int key="objectID">130</int> <reference key="object" ref="306232897"/> - <reference key="parent" ref="0"/> + <reference key="parent" ref="349743695"/> </object> <object class="IBObjectRecord"> <int key="objectID">144</int> @@ -659,7 +597,7 @@ </object> <object class="NSMutableDictionary" key="flattenedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> + <object class="NSMutableArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>-1.IBPluginDependency</string> <string>-2.IBPluginDependency</string> @@ -685,10 +623,6 @@ <string>2.IBPluginDependency</string> <string>3.IBAttributePlaceholdersKey</string> <string>3.IBPluginDependency</string> - <string>32.IBAttributePlaceholdersKey</string> - <string>32.IBPluginDependency</string> - <string>33.CustomClassName</string> - <string>33.IBPluginDependency</string> <string>36.CustomClassName</string> <string>36.IBAttributePlaceholdersKey</string> <string>36.IBPluginDependency</string> @@ -715,7 +649,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{196, 720}, {618, 36}}</string> + <string>{{322, 542}, {618, 36}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <boolean value="YES"/> <string>ClickHoldButtonCell</string> @@ -750,16 +684,6 @@ </object> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <object class="NSMutableDictionary"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference key="dict.sortedKeys" ref="0"/> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - </object> - </object> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>ToolbarButtonCell</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>MenuButton</string> <object class="NSMutableDictionary"> <string key="NS.key.0">ToolTip</string> @@ -812,7 +736,9 @@ </object> <object class="NSMutableDictionary" key="unlocalizedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> - <reference key="dict.sortedKeys" ref="0"/> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> @@ -820,7 +746,9 @@ <nil key="activeLocalization"/> <object class="NSMutableDictionary" key="localizations"> <bool key="EncodedWithXMLCoder">YES</bool> - <reference key="dict.sortedKeys" ref="0"/> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> @@ -896,7 +824,7 @@ <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="actions"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> + <object class="NSMutableArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>commandDispatch:</string> <string>commandDispatchUsingKeyModifiers:</string> @@ -917,7 +845,7 @@ <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> + <object class="NSMutableArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>otherObjectToLocalize_</string> <string>owner_</string> @@ -1006,7 +934,7 @@ <string key="superclassName">NSViewController</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> + <object class="NSMutableArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>backButton_</string> <string>browserActionsContainerView_</string> @@ -1017,7 +945,6 @@ <string>pageButton_</string> <string>reloadButton_</string> <string>resizeDelegate_</string> - <string>starButton_</string> <string>wrenchButton_</string> </object> <object class="NSMutableArray" key="dict.values"> @@ -1031,7 +958,6 @@ <string>MenuButton</string> <string>NSButton</string> <string>id</string> - <string>NSButton</string> <string>MenuButton</string> </object> </object> @@ -1057,705 +983,9 @@ </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="680097003"> - <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="214330444"> - <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="568897720"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSApplication</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSApplication</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSButton</string> - <string key="superclassName">NSControl</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSButton.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSButtonCell</string> - <string key="superclassName">NSActionCell</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSCell</string> - <string key="superclassName">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSCell.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSControl</string> - <string key="superclassName">NSView</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="636973055"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSControl.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSController</string> - <string key="superclassName">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSController.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSFormatter</string> - <string key="superclassName">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSMenu</string> - <string key="superclassName">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="662735041"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AddressBook.framework/Headers/ABActions.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSAlert.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSAnimation.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <reference key="sourceIdentifier" ref="680097003"/> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <reference key="sourceIdentifier" ref="214330444"/> - </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="568897720"/> - </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="636973055"/> - </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"> - <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="662735041"/> - </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="1021231619"> - <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"> - <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">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">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">NSUserDefaultsController</string> - <string key="superclassName">NSController</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSUserDefaultsController.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="1021231619"/> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSViewController</string> - <string key="superclassName">NSResponder</string> - <object class="NSMutableDictionary" key="outlets"> - <string key="NS.key.0">view</string> - <string key="NS.object.0">NSView</string> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSViewController.h</string> - </object> - </object> - </object> </object> <int key="IBDocument.localizationMode">0</int> - <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> - <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> - <integer value="1050" key="NS.object.0"/> - </object> - <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> - <integer value="1050" key="NS.object.0"/> - </object> - <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> - <integer value="3000" key="NS.object.0"/> - </object> - <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <string key="IBDocument.LastKnownRelativeProjectPath">../../chrome.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> - <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>back_Template</string> - <string>forward_Template</string> - <string>go_Template</string> - <string>home_Template</string> - <string>menu_chrome_Template</string> - <string>menu_page_Template</string> - <string>reload_Template</string> - <string>star_Template</string> - <string>starred</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>{19, 19}</string> - <string>{19, 19}</string> - <string>{19, 19}</string> - <string>{19, 19}</string> - <string>{30, 19}</string> - <string>{30, 19}</string> - <string>{19, 19}</string> - <string>{19, 19}</string> - <string>{30, 29}</string> - </object> - </object> </data> </archive> diff --git a/chrome/browser/cocoa/autocomplete_text_field.h b/chrome/browser/cocoa/autocomplete_text_field.h index 1b1856d..5130072 100644 --- a/chrome/browser/cocoa/autocomplete_text_field.h +++ b/chrome/browser/cocoa/autocomplete_text_field.h @@ -119,6 +119,10 @@ class AutocompleteTextFieldObserver { // is not over an action. - (NSMenu*)actionMenuForEvent:(NSEvent*)event; +// Return the rectangle the star is being shown in, for purposes of +// positioning the bookmark bubble. +- (NSRect)starIconFrame; + @end #endif // CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ diff --git a/chrome/browser/cocoa/autocomplete_text_field.mm b/chrome/browser/cocoa/autocomplete_text_field.mm index f69dcd3..a06ecac 100644 --- a/chrome/browser/cocoa/autocomplete_text_field.mm +++ b/chrome/browser/cocoa/autocomplete_text_field.mm @@ -204,6 +204,11 @@ [self addCursorRect:[icon rect] cursor:[NSCursor arrowCursor]]; } +// TODO(shess): -resetFieldEditorFrameIfNeeded is the place where +// changes to the cell layout should be flushed. LocationBarViewMac +// and ToolbarController are calling this routine directly, and I +// think they are probably wrong. +// http://crbug.com/40053 - (void)updateCursorAndToolTipRects { // This will force |resetCursorRects| to be called, as it is not to be called // directly. @@ -367,4 +372,9 @@ actionMenuForEvent:event inRect:[self bounds] ofView:self]; } +- (NSRect)starIconFrame { + AutocompleteTextFieldCell* cell = [self autocompleteTextFieldCell]; + return [cell starIconFrameForFrame:[self bounds]]; +} + @end diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell.h b/chrome/browser/cocoa/autocomplete_text_field_cell.h index b92692c..080e580 100644 --- a/chrome/browser/cocoa/autocomplete_text_field_cell.h +++ b/chrome/browser/cocoa/autocomplete_text_field_cell.h @@ -64,6 +64,10 @@ class ExtensionAction; // |keywordString_| overrides. LocationBarViewMac::LocationIconView* locationIconView_; + // The star icon sits at the right-hand side of the field when an + // URL is being shown. + LocationBarViewMac::LocationBarImageView* starIconView_; + // The security label floats to the left of page actions at the // right-hand side. LocationBarViewMac::LocationBarImageView* securityLabelView_; @@ -97,6 +101,7 @@ class ExtensionAction; - (void)clearKeywordAndHint; - (void)setLocationIconView:(LocationBarViewMac::LocationIconView*)view; +- (void)setStarIconView:(LocationBarViewMac::LocationBarImageView*)view; - (void)setSecurityLabelView:(LocationBarViewMac::LocationBarImageView*)view; - (void)setPageActionViewList:(LocationBarViewMac::PageActionViewList*)list; - (void)setContentSettingViewsList: @@ -106,6 +111,10 @@ class ExtensionAction; // only visible icons. - (NSArray*)layedOutIcons:(NSRect)cellFrame; +// Return the rectangle the star is being shown in, for purposes of +// positioning the bookmark bubble. +- (NSRect)starIconFrameForFrame:(NSRect)cellFrame; + // Returns the portion of the cell to use for displaying the Page // Action icon at the given index. May be NSZeroRect if the index's // action is not visible. This does a linear walk over all page diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell.mm b/chrome/browser/cocoa/autocomplete_text_field_cell.mm index 7c0c27f..699a59b 100644 --- a/chrome/browser/cocoa/autocomplete_text_field_cell.mm +++ b/chrome/browser/cocoa/autocomplete_text_field_cell.mm @@ -272,6 +272,10 @@ void DrawImageInRect(NSImage* image, NSView* view, const NSRect& rect) { locationIconView_ = view; } +- (void)setStarIconView:(LocationBarViewMac::LocationBarImageView*)view { + starIconView_ = view; +} + - (void)setSecurityLabelView:(LocationBarViewMac::LocationBarImageView*)view { securityLabelView_ = view; } @@ -340,6 +344,18 @@ void DrawImageInRect(NSImage* image, NSView* view, const NSRect& rect) { imageSize.width, imageSize.height); } +- (NSRect)starIconFrameForFrame:(NSRect)cellFrame { + if (!starIconView_ || !starIconView_->IsVisible()) + return NSZeroRect; + + // The star icon is always at the RHS. + scoped_nsobject<AutocompleteTextFieldIcon> icon( + [[AutocompleteTextFieldIcon alloc] initImageWithView:starIconView_]); + cellFrame.size.width -= kHintXOffset; + [icon positionInFrame:cellFrame]; + return [icon rect]; +} + - (size_t)pageActionCount { // page_action_views_ may be NULL during testing, or if the // containing LocationViewMac object has already been destructed @@ -471,6 +487,10 @@ void DrawImageInRect(NSImage* image, NSView* view, const NSRect& rect) { views.push_back(page_action_views_->ViewAt(i)); } + // The star icon should always come last. + if (starIconView_) + views.push_back(starIconView_); + // Load the visible views into |result|. for (std::vector<LocationBarViewMac::LocationBarImageView*>::const_iterator iter = views.begin(); iter != views.end(); ++iter) { diff --git a/chrome/browser/cocoa/bookmark_bubble_controller.h b/chrome/browser/cocoa/bookmark_bubble_controller.h index 1a95300..68f835f 100644 --- a/chrome/browser/cocoa/bookmark_bubble_controller.h +++ b/chrome/browser/cocoa/bookmark_bubble_controller.h @@ -10,6 +10,7 @@ class BookmarkModel; class BookmarkNode; @class BookmarkBubbleController; +@class InfoBubbleView; // Controller for the bookmark bubble. The bookmark bubble is a // bubble that pops up when clicking on the STAR next to the URL to @@ -18,7 +19,7 @@ class BookmarkNode; @interface BookmarkBubbleController : NSWindowController<NSWindowDelegate> { @private NSWindow* parentWindow_; // weak - NSPoint topLeftForBubble_; + NSPoint topRightForBubble_; // Both weak; owned by the current browser's profile BookmarkModel* model_; // weak @@ -32,6 +33,7 @@ class BookmarkNode; IBOutlet NSTextField* bigTitle_; // "Bookmark" or "Bookmark Added!" IBOutlet NSTextField* nameTextField_; IBOutlet NSPopUpButton* folderPopUpButton_; + IBOutlet InfoBubbleView* bubble_; // to set arrow position } @property (readonly, nonatomic) const BookmarkNode* node; @@ -43,7 +45,7 @@ class BookmarkNode; // it desires it to be visible on the screen. It is not shown by the // init routine. Closing of the window happens implicitly on dealloc. - (id)initWithParentWindow:(NSWindow*)parentWindow - topLeftForBubble:(NSPoint)topLeftForBubble + topRightForBubble:(NSPoint)topRightForBubble model:(BookmarkModel*)model node:(const BookmarkNode*)node alreadyBookmarked:(BOOL)alreadyBookmarked; diff --git a/chrome/browser/cocoa/bookmark_bubble_controller.mm b/chrome/browser/cocoa/bookmark_bubble_controller.mm index 075034c..e59d1f6 100644 --- a/chrome/browser/cocoa/bookmark_bubble_controller.mm +++ b/chrome/browser/cocoa/bookmark_bubble_controller.mm @@ -7,6 +7,7 @@ #include "base/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" +#import "chrome/browser/cocoa/info_bubble_view.h" #include "chrome/browser/metrics/user_metrics.h" #include "grit/generated_resources.h" @@ -38,7 +39,7 @@ } - (id)initWithParentWindow:(NSWindow*)parentWindow - topLeftForBubble:(NSPoint)topLeftForBubble + topRightForBubble:(NSPoint)topRightForBubble model:(BookmarkModel*)model node:(const BookmarkNode*)node alreadyBookmarked:(BOOL)alreadyBookmarked { @@ -47,7 +48,7 @@ ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { parentWindow_ = parentWindow; - topLeftForBubble_ = topLeftForBubble; + topRightForBubble_ = topRightForBubble; model_ = model; node_ = node; alreadyBookmarked_ = alreadyBookmarked; @@ -95,9 +96,11 @@ // showWindow:. Thus, we have our own version. - (void)showWindow:(id)sender { NSWindow* window = [self window]; // completes nib load - NSPoint origin = [parentWindow_ convertBaseToScreen:topLeftForBubble_]; + NSPoint origin = [parentWindow_ convertBaseToScreen:topRightForBubble_]; origin.y -= NSHeight([window frame]); + origin.x -= NSWidth([window frame]); [window setFrameOrigin:origin]; + [bubble_ setArrowLocation:kTopRight]; [parentWindow_ addChildWindow:window ordered:NSWindowAbove]; // Default is IDS_BOOMARK_BUBBLE_PAGE_BOOKMARK; "Bookmark". // If adding for the 1st time the string becomes "Bookmark Added!" diff --git a/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm index 530d2034..abc991c 100644 --- a/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm +++ b/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm @@ -42,7 +42,7 @@ class BookmarkBubbleControllerTest : public CocoaTest { } controller_ = [[BookmarkBubbleController alloc] initWithParentWindow:test_window() - topLeftForBubble:TopLeftForBubble() + topRightForBubble:TopRightForBubble() model:helper_.profile()->GetBookmarkModel() node:node alreadyBookmarked:YES]; @@ -61,8 +61,8 @@ class BookmarkBubbleControllerTest : public CocoaTest { return [static_cast<InfoBubbleWindow*>([controller_ window]) isClosing]; } - NSPoint TopLeftForBubble() { - return NSMakePoint(10, 300); + NSPoint TopRightForBubble() { + return NSMakePoint(NSWidth([test_window() frame]) - 10, 300); } }; @@ -334,7 +334,7 @@ TEST_F(BookmarkBubbleControllerTest, EscapeRemovesNewBookmark) { BookmarkBubbleController* controller = [[BookmarkBubbleController alloc] initWithParentWindow:test_window() - topLeftForBubble:TopLeftForBubble() + topRightForBubble:TopRightForBubble() model:helper_.profile()->GetBookmarkModel() node:node alreadyBookmarked:NO]; // The last param is the key difference. diff --git a/chrome/browser/cocoa/browser_window_controller.h b/chrome/browser/cocoa/browser_window_controller.h index 817d536..373fe20 100644 --- a/chrome/browser/cocoa/browser_window_controller.h +++ b/chrome/browser/cocoa/browser_window_controller.h @@ -345,8 +345,8 @@ class TabStripModelObserverBridge; // Return an autoreleased NSWindow suitable for fullscreen use. - (NSWindow*)createFullscreenWindow; -// Return a point suitable for the topLeft for a bookmark bubble. -- (NSPoint)topLeftForBubble; +// Return a point suitable for the topRight for a bookmark bubble. +- (NSPoint)topRightForBubble; // Resets any saved state about window growth (due to showing the bookmark bar // or the download shelf), so that future shrinking will occur from the bottom. diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index 62aba3d..91b891d 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -1368,13 +1368,13 @@ return phase; } -- (NSPoint)topLeftForBubble { - NSRect rect = [toolbarController_ starButtonInWindowCoordinates]; - NSPoint p = NSMakePoint(NSMinX(rect), NSMinY(rect)); // bottom left +- (NSPoint)topRightForBubble { + NSRect rect = [toolbarController_ starIconInWindowCoordinates]; + NSPoint p = NSMakePoint(NSMaxX(rect), NSMinY(rect)); // bottom right - // Adjust top-left based on our knowledge of how the view looks. - p.x -= 2; - p.y += 7; + // Adjust top-right based on our knowledge of how the view looks. + p.x += 31; + p.y += 5; return p; } @@ -1385,10 +1385,10 @@ if (!bookmarkBubbleController_) { BookmarkModel* model = browser_->profile()->GetBookmarkModel(); const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url); - NSPoint topLeft = [self topLeftForBubble]; + NSPoint topRight = [self topRightForBubble]; bookmarkBubbleController_ = [[BookmarkBubbleController alloc] initWithParentWindow:[self window] - topLeftForBubble:topLeft + topRightForBubble:topRight model:model node:node alreadyBookmarked:alreadyMarked]; diff --git a/chrome/browser/cocoa/browser_window_controller_unittest.mm b/chrome/browser/cocoa/browser_window_controller_unittest.mm index 0d4975a..fbdef54 100644 --- a/chrome/browser/cocoa/browser_window_controller_unittest.mm +++ b/chrome/browser/cocoa/browser_window_controller_unittest.mm @@ -433,14 +433,14 @@ TEST_F(BrowserWindowControllerTest, BookmarkBarIsSameWidth) { [bookmarkBarView frame].size.width); } -TEST_F(BrowserWindowControllerTest, TestTopLeftForBubble) { - NSPoint p = [controller_ topLeftForBubble]; +TEST_F(BrowserWindowControllerTest, TestTopRightForBubble) { + NSPoint p = [controller_ topRightForBubble]; NSRect all = [[controller_ window] frame]; - // As a sanity check make sure the point is vaguely in the top left + // As a sanity check make sure the point is vaguely in the top right // of the window. EXPECT_GT(p.y, all.origin.y + (all.size.height/2)); - EXPECT_LT(p.x, all.origin.x + (all.size.width/2)); + EXPECT_GT(p.x, all.origin.x + (all.size.width/2)); } // By the "zoom frame", we mean what Apple calls the "standard frame". diff --git a/chrome/browser/cocoa/location_bar_view_mac.h b/chrome/browser/cocoa/location_bar_view_mac.h index 2e8675a..cebab92 100644 --- a/chrome/browser/cocoa/location_bar_view_mac.h +++ b/chrome/browser/cocoa/location_bar_view_mac.h @@ -73,6 +73,9 @@ class LocationBarViewMac : public AutocompleteEditController, virtual ExtensionAction* GetVisiblePageAction(size_t index); virtual void TestPageActionPressed(size_t index); + // Set the starred state of the bookmark star. + void SetStarred(bool starred); + // Updates the location bar. Resets the bar's permanent text and // security style, and if |should_restore_state| is true, restores // saved state from the tab (for tab switching). @@ -139,7 +142,9 @@ class LocationBarViewMac : public AutocompleteEditController, // Sets the image. void SetImage(NSImage* image); - void SetImage(SkBitmap* image); + + // Get the |resource_id| image resource and set the image. + void SetIcon(int resource_id); // Sets the label text, font, and color. |text| may be nil; |color| and // |font| are ignored if |text| is nil. @@ -195,6 +200,30 @@ class LocationBarViewMac : public AutocompleteEditController, DISALLOW_COPY_AND_ASSIGN(LocationIconView); }; + // Used to display the bookmark star in the RHS. + class StarIconView : public LocationBarImageView { + public: + explicit StarIconView(CommandUpdater* command_updater); + virtual ~StarIconView() {} + + // Shows the bookmark bubble. + virtual void OnMousePressed(NSRect bounds); + + // Set the image and tooltip based on |starred|. + void SetStarred(bool starred); + + virtual const NSString* GetToolTip(); + + private: + // For bringing up bookmark bar. + CommandUpdater* command_updater_; // Weak, owned by Browser. + + // The string to show for a tooltip. + scoped_nsobject<NSString> tooltip_; + + DISALLOW_COPY_AND_ASSIGN(StarIconView); + }; + // PageActionImageView is used to display the icon for a given Page Action // and notify the extension when the icon is clicked. class PageActionImageView : public LocationBarImageView, @@ -397,6 +426,9 @@ class LocationBarViewMac : public AutocompleteEditController, // Security info as text which floats left of the page actions. LocationBarImageView security_label_view_; + // Bookmark star right of page actions. + StarIconView star_icon_view_; + // Any installed Page Actions. PageActionViewList page_action_views_; diff --git a/chrome/browser/cocoa/location_bar_view_mac.mm b/chrome/browser/cocoa/location_bar_view_mac.mm index c9584a0..3cbc49f 100644 --- a/chrome/browser/cocoa/location_bar_view_mac.mm +++ b/chrome/browser/cocoa/location_bar_view_mac.mm @@ -105,6 +105,7 @@ LocationBarViewMac::LocationBarViewMac( disposition_(CURRENT_TAB), location_icon_view_(this), security_label_view_(), + star_icon_view_(command_updater), page_action_views_(this, profile, toolbar_model), profile_(profile), browser_(browser), @@ -121,6 +122,7 @@ LocationBarViewMac::LocationBarViewMac( AutocompleteTextFieldCell* cell = [field_ autocompleteTextFieldCell]; [cell setLocationIconView:&location_icon_view_]; [cell setSecurityLabelView:&security_label_view_]; + [cell setStarIconView:&star_icon_view_]; [cell setPageActionViewList:&page_action_views_]; [cell setContentSettingViewsList:&content_setting_views_]; @@ -135,6 +137,7 @@ LocationBarViewMac::~LocationBarViewMac() { [cell setPageActionViewList:NULL]; [cell setLocationIconView:NULL]; [cell setSecurityLabelView:NULL]; + [cell setStarIconView:NULL]; } std::wstring LocationBarViewMac::GetInputString() const { @@ -449,6 +452,12 @@ void LocationBarViewMac::TestPageActionPressed(size_t index) { page_action_views_.OnMousePressed(NSZeroRect, index); } +void LocationBarViewMac::SetStarred(bool starred) { + star_icon_view_.SetStarred(starred); + [field_ updateCursorAndToolTipRects]; + [field_ resetFieldEditorFrameIfNeeded]; +} + NSImage* LocationBarViewMac::GetTabButtonImage() { if (!tab_button_image_) { SkBitmap* skiaBitmap = ResourceBundle::GetSharedInstance(). @@ -468,8 +477,7 @@ void LocationBarViewMac::SetIcon(int resource_id) { !edit_view_->model()->is_keyword_hint()) { location_icon_view_.SetVisible(false); } else { - location_icon_view_.SetImage( - ResourceBundle::GetSharedInstance().GetNSImageNamed(resource_id)); + location_icon_view_.SetIcon(resource_id); location_icon_view_.SetVisible(true); SetSecurityLabel(); } @@ -541,8 +549,9 @@ void LocationBarViewMac::LocationBarImageView::SetImage(NSImage* image) { image_.reset([image retain]); } -void LocationBarViewMac::LocationBarImageView::SetImage(SkBitmap* image) { - SetImage(gfx::SkBitmapToNSImage(*image)); +void LocationBarViewMac::LocationBarImageView::SetIcon(int resource_id) { + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + SetImage(rb.GetNSImageNamed(resource_id)); } void LocationBarViewMac::LocationBarImageView::SetLabel(NSString* text, @@ -600,6 +609,34 @@ void LocationBarViewMac::LocationIconView::OnMousePressed(NSRect bounds) { tab->ShowPageInfo(nav_entry->url(), nav_entry->ssl(), true); } +// StarIconView----------------------------------------------------------------- + +LocationBarViewMac::StarIconView::StarIconView(CommandUpdater* command_updater) + : command_updater_(command_updater) { + SetVisible(true); + SetStarred(false); +} + +void LocationBarViewMac::StarIconView::SetStarred(bool starred) { + if (starred) { + SetIcon(IDR_STARRED_NOBORDER_CENTER); + tooltip_.reset( + [l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STARRED) retain]); + } else { + SetIcon(IDR_STAR_NOBORDER_CENTER); + tooltip_.reset( + [l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STAR) retain]); + } +} + +void LocationBarViewMac::StarIconView::OnMousePressed(NSRect bounds) { + command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); +} + +const NSString* LocationBarViewMac::StarIconView::GetToolTip() { + return tooltip_.get(); +} + // PageActionImageView---------------------------------------------------------- LocationBarViewMac::PageActionImageView::PageActionImageView( @@ -853,10 +890,9 @@ void LocationBarViewMac::ContentSettingImageView::UpdateFromTabContents( const TabContents* tab_contents) { content_setting_image_model_->UpdateFromTabContents(tab_contents); if (content_setting_image_model_->is_visible()) { - ResourceBundle& rb = ResourceBundle::GetSharedInstance(); // TODO(thakis): We should use pdfs for these icons on OSX. // http://crbug.com/35847 - SetImage(rb.GetNSImageNamed(content_setting_image_model_->get_icon())); + SetIcon(content_setting_image_model_->get_icon()); SetToolTip(base::SysUTF8ToNSString( content_setting_image_model_->get_tooltip())); SetVisible(true); diff --git a/chrome/browser/cocoa/toolbar_controller.h b/chrome/browser/cocoa/toolbar_controller.h index 3c5086b..2413075 100644 --- a/chrome/browser/cocoa/toolbar_controller.h +++ b/chrome/browser/cocoa/toolbar_controller.h @@ -99,7 +99,6 @@ class ToolbarModel; IBOutlet DelayedMenuButton* forwardButton_; IBOutlet NSButton* reloadButton_; IBOutlet NSButton* homeButton_; - IBOutlet NSButton* starButton_; IBOutlet NSButton* goButton_; IBOutlet MenuButton* pageButton_; IBOutlet MenuButton* wrenchButton_; @@ -147,9 +146,10 @@ class ToolbarModel; // ignored. This changes the behavior of other methods, like |-view|. - (void)setHasToolbar:(BOOL)toolbar hasLocationBar:(BOOL)locBar; -// The bookmark bubble (when you click the star) needs to know where to go. -// Somewhere near the star button seems like a good start. -- (NSRect)starButtonInWindowCoordinates; +// The bookmark bubble (when you click the star or hit Command-d) +// needs to know where to go. Somewhere near the star icon seems like +// a good start. +- (NSRect)starIconInWindowCoordinates; // Returns the desired toolbar height for the given compression factor. - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight; diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm index fc0cdb0..f93ac61 100644 --- a/chrome/browser/cocoa/toolbar_controller.mm +++ b/chrome/browser/cocoa/toolbar_controller.mm @@ -51,8 +51,6 @@ NSString* const kBackButtonImageName = @"back_Template.pdf"; NSString* const kForwardButtonImageName = @"forward_Template.pdf"; NSString* const kReloadButtonImageName = @"reload_Template.pdf"; NSString* const kHomeButtonImageName = @"home_Template.pdf"; -NSString* const kStarButtonImageName = @"star_Template.pdf"; -NSString* const kStarButtonFillingImageName = @"starred.pdf"; NSString* const kGoButtonGoImageName = @"go_Template.pdf"; NSString* const kGoButtonStopImageName = @"stop_Template.pdf"; NSString* const kPageButtonImageName = @"menu_page_Template.pdf"; @@ -225,7 +223,6 @@ class PrefObserverBridge : public NotificationObserver { [forwardButton_ setImage:nsimage_cache::ImageNamed(kForwardButtonImageName)]; [reloadButton_ setImage:nsimage_cache::ImageNamed(kReloadButtonImageName)]; [homeButton_ setImage:nsimage_cache::ImageNamed(kHomeButtonImageName)]; - [starButton_ setImage:nsimage_cache::ImageNamed(kStarButtonImageName)]; [goButton_ setImage:nsimage_cache::ImageNamed(kGoButtonGoImageName)]; [pageButton_ setImage:nsimage_cache::ImageNamed(kPageButtonImageName)]; [wrenchButton_ setImage:nsimage_cache::ImageNamed(kWrenchButtonImageName)]; @@ -312,10 +309,6 @@ class PrefObserverBridge : public NotificationObserver { [[homeButton_ cell] accessibilitySetOverrideValue:description forAttribute:NSAccessibilityDescriptionAttribute]; - description = l10n_util::GetNSStringWithFixup(IDS_ACCNAME_STAR); - [[starButton_ cell] - accessibilitySetOverrideValue:description - forAttribute:NSAccessibilityDescriptionAttribute]; description = l10n_util::GetNSStringWithFixup(IDS_ACCNAME_LOCATION); [[locationBar_ cell] accessibilitySetOverrideValue:description @@ -394,9 +387,6 @@ class PrefObserverBridge : public NotificationObserver { case IDC_HOME: button = homeButton_; break; - case IDC_BOOKMARK_PAGE: - button = starButton_; - break; } [button setEnabled:enabled]; } @@ -409,8 +399,6 @@ class PrefObserverBridge : public NotificationObserver { setEnabled:commands->IsCommandEnabled(IDC_FORWARD) ? YES : NO]; [reloadButton_ setEnabled:commands->IsCommandEnabled(IDC_RELOAD) ? YES : NO]; [homeButton_ setEnabled:commands->IsCommandEnabled(IDC_HOME) ? YES : NO]; - [starButton_ - setEnabled:commands->IsCommandEnabled(IDC_BOOKMARK_PAGE) ? YES : NO]; } - (void)updateToolbarWithContents:(TabContents*)tab @@ -425,23 +413,7 @@ class PrefObserverBridge : public NotificationObserver { } - (void)setStarredState:(BOOL)isStarred { - NSImage* starImage = nil; - NSString* toolTip; - if (isStarred) { - starImage = nsimage_cache::ImageNamed(kStarButtonFillingImageName); - // Cache the string since we'll need it a lot - static NSString* starredToolTip = - [l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STARRED) retain]; - toolTip = starredToolTip; - } else { - // Cache the string since we'll need it a lot - static NSString* starToolTip = - [l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STAR) retain]; - toolTip = starToolTip; - } - - [(GradientButtonCell*)[starButton_ cell] setUnderlayImage:starImage]; - [starButton_ setToolTip:toolTip]; + locationBarView_->SetStarred(isStarred ? true : false); } - (void)setIsLoading:(BOOL)isLoading { @@ -508,7 +480,7 @@ class PrefObserverBridge : public NotificationObserver { // Returns an array of views in the order of the outlets above. - (NSArray*)toolbarViews { return [NSArray arrayWithObjects:backButton_, forwardButton_, reloadButton_, - homeButton_, starButton_, goButton_, pageButton_, wrenchButton_, + homeButton_, goButton_, pageButton_, wrenchButton_, locationBar_, browserActionsContainerView_, nil]; } @@ -521,14 +493,16 @@ class PrefObserverBridge : public NotificationObserver { return frame; } -// Computes the padding between the buttons that should have a separation from -// the positions in the nib. Since the forward and reload buttons are always -// visible, we use those buttons as the canonical spacing. +// Computes the padding between the buttons that should have a +// separation from the positions in the nib. |homeButton_| is right +// of |forwardButton_| unless it has been hidden, in which case +// |reloadButton_| is in that spot. - (CGFloat)interButtonSpacing { - NSRect forwardFrame = [forwardButton_ frame]; - NSRect reloadFrame = [reloadButton_ frame]; - DCHECK(NSMinX(reloadFrame) > NSMaxX(forwardFrame)); - return NSMinX(reloadFrame) - NSMaxX(forwardFrame); + const NSRect forwardFrame = [forwardButton_ frame]; + NSButton* nextButton = [homeButton_ isHidden] ? reloadButton_ : homeButton_; + const NSRect nextButtonFrame = [nextButton frame]; + DCHECK_GT(NSMinX(nextButtonFrame), NSMaxX(forwardFrame)); + return NSMinX(nextButtonFrame) - NSMaxX(forwardFrame); } // Show or hide the home button based on the pref. @@ -547,7 +521,7 @@ class PrefObserverBridge : public NotificationObserver { if (hide) moveX *= -1; // Reverse the direction of the move. - [starButton_ setFrame:NSOffsetRect([starButton_ frame], moveX, 0)]; + [reloadButton_ setFrame:NSOffsetRect([reloadButton_ frame], moveX, 0)]; [locationBar_ setFrame:[self adjustRect:[locationBar_ frame] byAmount:moveX]]; [homeButton_ setHidden:hide]; @@ -770,8 +744,8 @@ class PrefObserverBridge : public NotificationObserver { [NSAnimationContext endGrouping]; } -- (NSRect)starButtonInWindowCoordinates { - return [starButton_ convertRect:[starButton_ bounds] toView:nil]; +- (NSRect)starIconInWindowCoordinates { + return [locationBar_ convertRect:[locationBar_ starIconFrame] toView:nil]; } - (CGFloat)desiredHeightForCompression:(CGFloat)compressByHeight { diff --git a/chrome/browser/cocoa/toolbar_controller_unittest.mm b/chrome/browser/cocoa/toolbar_controller_unittest.mm index 8dcb135..60eff6c 100644 --- a/chrome/browser/cocoa/toolbar_controller_unittest.mm +++ b/chrome/browser/cocoa/toolbar_controller_unittest.mm @@ -43,7 +43,7 @@ class ToolbarControllerTest : public CocoaTest { // Indexes that match the ordering returned by the private ToolbarController // |-toolbarViews| method. enum { - kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex, kStarIndex, kGoIndex, + kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex, kGoIndex, kPageIndex, kWrenchIndex, kLocationIndex, kBrowserActionContainerViewIndex }; @@ -78,8 +78,6 @@ class ToolbarControllerTest : public CocoaTest { [[views objectAtIndex:kReloadIndex] isEnabled] ? true : false); EXPECT_EQ(updater->IsCommandEnabled(IDC_HOME), [[views objectAtIndex:kHomeIndex] isEnabled] ? true : false); - EXPECT_EQ(updater->IsCommandEnabled(IDC_BOOKMARK_PAGE), - [[views objectAtIndex:kStarIndex] isEnabled] ? true : false); } BrowserTestHelper helper_; @@ -160,16 +158,16 @@ TEST_F(ToolbarControllerTest, ToggleHome) { NSView* homeButton = [[bar_ toolbarViews] objectAtIndex:kHomeIndex]; EXPECT_EQ(showHome, ![homeButton isHidden]); - NSView* starButton = [[bar_ toolbarViews] objectAtIndex:kStarIndex]; + NSView* reloadButton = [[bar_ toolbarViews] objectAtIndex:kReloadIndex]; NSView* locationBar = [[bar_ toolbarViews] objectAtIndex:kLocationIndex]; - NSRect originalStarFrame = [starButton frame]; + NSRect originalReloadFrame = [reloadButton frame]; NSRect originalLocationBarFrame = [locationBar frame]; // Toggle the pref and make sure the button changed state and the other // views moved. prefs->SetBoolean(prefs::kShowHomeButton, !showHome); EXPECT_EQ(showHome, [homeButton isHidden]); - EXPECT_NE(NSMinX(originalStarFrame), NSMinX([starButton frame])); + EXPECT_NE(NSMinX(originalReloadFrame), NSMinX([reloadButton frame])); EXPECT_NE(NSMinX(originalLocationBarFrame), NSMinX([locationBar frame])); EXPECT_NE(NSWidth(originalLocationBarFrame), NSWidth([locationBar frame])); } @@ -220,8 +218,8 @@ TEST_F(ToolbarControllerTest, DontToggleWhenNoToolbar) { EXPECT_TRUE(NSEqualRects(locationBarFrame, newLocationBarFrame)); } -TEST_F(ToolbarControllerTest, StarButtonInWindowCoordinates) { - NSRect star = [bar_ starButtonInWindowCoordinates]; +TEST_F(ToolbarControllerTest, StarIconInWindowCoordinates) { + NSRect star = [bar_ starIconInWindowCoordinates]; NSRect all = [[[bar_ view] window] frame]; // Make sure the star is completely inside the window rect |