summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-22 17:05:17 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-22 17:05:17 +0000
commit868d3022ab0c7ee4abd2387e34fffb0136ca2f49 (patch)
treee2621f02f291ee9ad2303f9080e94fe7efe9ba5b /chrome
parent51587f3778268cd0d04ddbcd75a3631cac4c2037 (diff)
downloadchromium_src-868d3022ab0c7ee4abd2387e34fffb0136ca2f49.zip
chromium_src-868d3022ab0c7ee4abd2387e34fffb0136ca2f49.tar.gz
chromium_src-868d3022ab0c7ee4abd2387e34fffb0136ca2f49.tar.bz2
[Mac] Add the instant opt-in UI to the omnibox dropdown.
BUG=58917, 56385 TEST=Once Instant opt-in is enabled, it should appear in omnibox, not look ugly. Review URL: http://codereview.chromium.org/5161003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/nibs/InstantOptIn.xib1143
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_mac.h19
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_mac.mm94
-rw-r--r--chrome/browser/cocoa/location_bar/instant_opt_in_controller.h43
-rw-r--r--chrome/browser/cocoa/location_bar/instant_opt_in_controller.mm31
-rw-r--r--chrome/browser/cocoa/location_bar/instant_opt_in_controller_unittest.mm62
-rw-r--r--chrome/browser/cocoa/location_bar/instant_opt_in_view.h16
-rw-r--r--chrome/browser/cocoa/location_bar/instant_opt_in_view.mm54
-rw-r--r--chrome/browser/cocoa/location_bar/instant_opt_in_view_unittest.mm26
-rw-r--r--chrome/browser/cocoa/location_bar/omnibox_popup_view.h17
-rw-r--r--chrome/browser/cocoa/location_bar/omnibox_popup_view.mm43
-rw-r--r--chrome/browser/cocoa/location_bar/omnibox_popup_view_unittest.mm68
-rw-r--r--chrome/chrome_browser.gypi6
-rw-r--r--chrome/chrome_dll.gypi1
-rw-r--r--chrome/chrome_tests.gypi3
15 files changed, 1612 insertions, 14 deletions
diff --git a/chrome/app/nibs/InstantOptIn.xib b/chrome/app/nibs/InstantOptIn.xib
new file mode 100644
index 0000000..4a79b50
--- /dev/null
+++ b/chrome/app/nibs/InstantOptIn.xib
@@ -0,0 +1,1143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1050</int>
+ <string key="IBDocument.SystemVersion">10F569</string>
+ <string key="IBDocument.InterfaceBuilderVersion">804</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">804</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1001">
+ <string key="NSClassName">InstantOptInController</string>
+ </object>
+ <object class="NSCustomObject" id="1003">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1004">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSCustomView" id="1005">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">290</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="114455495">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">257</int>
+ <string key="NSFrame">{{380, 8}, {80, 19}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="284964310">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">No, Thanks</string>
+ <object class="NSFont" key="NSSupport" id="157226293">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">12</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="114455495"/>
+ <int key="NSButtonFlags">-2038152961</int>
+ <int key="NSButtonFlags2">164</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ </object>
+ <object class="NSButton" id="243662278">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">257</int>
+ <string key="NSFrame">{{308, 8}, {64, 19}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="744872552">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Enable...</string>
+ <reference key="NSSupport" ref="157226293"/>
+ <reference key="NSControlView" ref="243662278"/>
+ <int key="NSButtonFlags">-2038152961</int>
+ <int key="NSButtonFlags2">164</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="173431085">
+ <reference key="NSNextResponder" ref="1005"/>
+ <int key="NSvFlags">258</int>
+ <string key="NSFrame">{{17, 10}, {286, 17}}</string>
+ <reference key="NSSuperview" ref="1005"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="881103160">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">272630784</int>
+ <string key="NSContents">Enable Instant for Faster Searching?</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="173431085"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 40}</string>
+ <reference key="NSSuperview"/>
+ <string key="NSClassName">InstantOptInView</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">view</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">12</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">okButton_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="243662278"/>
+ </object>
+ <int key="connectionID">26</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">label_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="173431085"/>
+ </object>
+ <int key="connectionID">27</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">cancelButton_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="114455495"/>
+ </object>
+ <int key="connectionID">28</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">ok:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="243662278"/>
+ </object>
+ <int key="connectionID">29</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">cancel:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="114455495"/>
+ </object>
+ <int key="connectionID">30</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>
+ <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="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="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="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="1005"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="173431085"/>
+ <reference ref="243662278"/>
+ <reference ref="114455495"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">20</int>
+ <reference key="object" ref="173431085"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="881103160"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">21</int>
+ <reference key="object" ref="881103160"/>
+ <reference key="parent" ref="173431085"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">22</int>
+ <reference key="object" ref="243662278"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="744872552"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="744872552"/>
+ <reference key="parent" ref="243662278"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">24</int>
+ <reference key="object" ref="114455495"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="284964310"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">25</int>
+ <reference key="object" ref="284964310"/>
+ <reference key="parent" ref="114455495"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.IBPluginDependency</string>
+ <string>-2.IBPluginDependency</string>
+ <string>-3.IBPluginDependency</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>1.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>20.IBPluginDependency</string>
+ <string>20.IBViewBoundsToFrameTransform</string>
+ <string>21.IBPluginDependency</string>
+ <string>22.IBPluginDependency</string>
+ <string>22.IBViewBoundsToFrameTransform</string>
+ <string>23.IBPluginDependency</string>
+ <string>24.IBPluginDependency</string>
+ <string>24.IBViewBoundsToFrameTransform</string>
+ <string>25.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{611, 697}, {480, 40}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{628, 654}</string>
+ <string>{{357, 416}, {480, 272}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABBiAAAwbAAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABDmgAAwegAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABDvgAAwegAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <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">30</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">InstantOptInController</string>
+ <string key="superclassName">NSViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>cancel:</string>
+ <string>ok:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>cancel:</string>
+ <string>ok:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">cancel:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">ok:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>cancelButton_</string>
+ <string>label_</string>
+ <string>okButton_</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSButton</string>
+ <string>NSTextField</string>
+ <string>NSButton</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>cancelButton_</string>
+ <string>label_</string>
+ <string>okButton_</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">cancelButton_</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">label_</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">okButton_</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/instant_opt_in_controller.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">InstantOptInView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/instant_opt_in_view.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">../third_party/GTM/Foundation/GTMNSObject+KeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/objc_zombie.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/status_bubble_mac.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/tab_strip_model_observer_bridge.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/view_id_util.h</string>
+ </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="680993771">
+ <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="146721929">
+ <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="40894536">
+ <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="692359979">
+ <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="330386417">
+ <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="680993771"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="146721929"/>
+ </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="40894536"/>
+ </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="692359979"/>
+ </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="330386417"/>
+ </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="401626849">
+ <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">QuartzCore.framework/Headers/CAAnimation.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">SecurityInterface.framework/Headers/SFAuthorizationView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">SecurityInterface.framework/Headers/SFCertificatePanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">SecurityInterface.framework/Headers/SFChooseIdentityPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">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="401626849"/>
+ </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="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">view</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">view</string>
+ <string key="candidateClassName">NSView</string>
+ </object>
+ </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>
+ </data>
+</archive>
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h
index 20af4f0..32e080c 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h
@@ -16,12 +16,16 @@
#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/autocomplete/autocomplete_popup_view.h"
+#import "chrome/browser/cocoa/location_bar/instant_opt_in_controller.h"
#include "gfx/font.h"
#include "webkit/glue/window_open_disposition.h"
-class AutocompletePopupModel;
+
class AutocompleteEditModel;
class AutocompleteEditViewMac;
+@class AutocompleteMatrix;
+class AutocompletePopupModel;
+@class InstantOptInController;
@class NSImage;
class Profile;
@@ -31,7 +35,8 @@ class Profile;
// TODO(rohitrao): This class is set up in a way that makes testing hard.
// Refactor and write unittests. http://crbug.com/9977
-class AutocompletePopupViewMac : public AutocompletePopupView {
+class AutocompletePopupViewMac : public AutocompletePopupView,
+ public InstantOptInControllerDelegate {
public:
AutocompletePopupViewMac(AutocompleteEditViewMac* edit_view,
AutocompleteEditModel* edit_model,
@@ -39,6 +44,9 @@ class AutocompletePopupViewMac : public AutocompletePopupView {
NSTextField* field);
virtual ~AutocompletePopupViewMac();
+ // Implement the InstantOptInControllerDelegate interface.
+ virtual void UserPressedOptIn(bool opt_in);
+
// Implement the AutocompletePopupView interface.
virtual bool IsOpen() const;
virtual void InvalidateLine(size_t line) {
@@ -111,6 +119,9 @@ class AutocompletePopupViewMac : public AutocompletePopupView {
const float cellWidth);
private:
+ // Returns the AutocompleteMatrix for this popup view.
+ AutocompleteMatrix* GetAutocompleteMatrix();
+
// Create the popup_ instance if needed.
void CreatePopupIfNeeded();
@@ -125,12 +136,16 @@ class AutocompletePopupViewMac : public AutocompletePopupView {
// Returns the NSImage that should be used as an icon for the given match.
NSImage* ImageForMatch(const AutocompleteMatch& match);
+ // Returns whether or not to show the instant opt-in prompt.
+ bool ShouldShowInstantOptIn();
+
scoped_ptr<AutocompletePopupModel> model_;
AutocompleteEditViewMac* edit_view_;
NSTextField* field_; // owned by tab controller
// Child window containing a matrix which implements the popup.
scoped_nsobject<NSWindow> popup_;
+ scoped_nsobject<InstantOptInController> opt_in_controller_;
NSRect targetPopupFrame_;
DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewMac);
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
index 6f26248..0a84fb2 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
@@ -8,6 +8,7 @@
#include "app/resource_bundle.h"
#include "app/text_elider.h"
+#include "base/mac_util.h"
#include "base/stl_util-inl.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
@@ -17,10 +18,17 @@
#include "chrome/browser/autocomplete/autocomplete_popup_model.h"
#include "chrome/browser/cocoa/event_utils.h"
#include "chrome/browser/cocoa/image_utils.h"
+#import "chrome/browser/cocoa/location_bar/instant_opt_in_controller.h"
+#import "chrome/browser/cocoa/location_bar/instant_opt_in_view.h"
+#import "chrome/browser/cocoa/location_bar/omnibox_popup_view.h"
+#include "chrome/browser/instant/instant_confirm_dialog.h"
+#include "chrome/browser/instant/promo_counter.h"
+#include "chrome/browser/profile.h"
#include "gfx/rect.h"
#include "grit/theme_resources.h"
#include "skia/ext/skia_utils_mac.h"
#import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
+#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h"
namespace {
@@ -251,10 +259,16 @@ NSAttributedString* AutocompletePopupViewMac::MatchText(
@interface AutocompleteMatrix : NSMatrix {
@private
+ // If YES, the matrix draws itself with rounded corners at the bottom.
+ // Otherwise, the bottom corners will be square.
+ BOOL bottomCornersRounded_;
+
// Target for click and middle-click.
AutocompletePopupViewMac* popupView_; // weak, owns us.
}
+@property(assign, nonatomic) BOOL bottomCornersRounded;
+
// Create a zero-size matrix initializing |popupView_|.
- initWithPopupView:(AutocompletePopupViewMac*)popupView;
@@ -276,6 +290,7 @@ AutocompletePopupViewMac::AutocompletePopupViewMac(
edit_view_(edit_view),
field_(field),
popup_(nil),
+ opt_in_controller_(nil),
targetPopupFrame_(NSZeroRect) {
DCHECK(edit_view);
DCHECK(edit_model);
@@ -290,11 +305,22 @@ AutocompletePopupViewMac::~AutocompletePopupViewMac() {
// Break references to |this| because the popup may not be
// deallocated immediately.
- AutocompleteMatrix* matrix = [popup_ contentView];
+ AutocompleteMatrix* matrix = GetAutocompleteMatrix();
DCHECK(matrix == nil || [matrix isKindOfClass:[AutocompleteMatrix class]]);
[matrix setPopupView:NULL];
}
+AutocompleteMatrix* AutocompletePopupViewMac::GetAutocompleteMatrix() {
+ // The AutocompleteMatrix will always be the first subview of the popup's
+ // content view.
+ if (popup_ && [[[popup_ contentView] subviews] count]) {
+ NSArray* subviews = [[popup_ contentView] subviews];
+ DCHECK_GE([subviews count], 0U);
+ return (AutocompleteMatrix*)[subviews objectAtIndex:0];
+ }
+ return nil;
+}
+
bool AutocompletePopupViewMac::IsOpen() const {
return [popup_ isVisible] ? true : false;
}
@@ -306,8 +332,7 @@ void AutocompletePopupViewMac::CreatePopupIfNeeded() {
backing:NSBackingStoreBuffered
defer:YES]);
[popup_ setMovableByWindowBackground:NO];
- // The window shape is determined by the content view
- // (AutocompleteMatrix).
+ // The window shape is determined by the content view (OmniboxPopupView).
[popup_ setAlphaValue:1.0];
[popup_ setOpaque:NO];
[popup_ setBackgroundColor:[NSColor clearColor]];
@@ -316,7 +341,11 @@ void AutocompletePopupViewMac::CreatePopupIfNeeded() {
scoped_nsobject<AutocompleteMatrix> matrix(
[[AutocompleteMatrix alloc] initWithPopupView:this]);
- [popup_ setContentView:matrix];
+ scoped_nsobject<OmniboxPopupView> contentView(
+ [[OmniboxPopupView alloc] initWithFrame:NSZeroRect]);
+
+ [contentView addSubview:matrix];
+ [popup_ setContentView:contentView];
}
}
@@ -407,7 +436,7 @@ void AutocompletePopupViewMac::UpdatePopupAppearance() {
// Break references to |this| because the popup may not be
// deallocated immediately.
- AutocompleteMatrix* matrix = [popup_ contentView];
+ AutocompleteMatrix* matrix = GetAutocompleteMatrix();
DCHECK(matrix == nil || [matrix isKindOfClass:[AutocompleteMatrix class]]);
[matrix setPopupView:NULL];
@@ -424,7 +453,7 @@ void AutocompletePopupViewMac::UpdatePopupAppearance() {
gfx::Font resultFont(base::SysNSStringToWide([fieldFont fontName]),
static_cast<int>(resultFontSize));
- AutocompleteMatrix* matrix = [popup_ contentView];
+ AutocompleteMatrix* matrix = GetAutocompleteMatrix();
// Calculate the width of the matrix based on backing out the
// popup's border from the width of the field. Would prefer to use
@@ -454,6 +483,22 @@ void AutocompletePopupViewMac::UpdatePopupAppearance() {
const CGFloat cellHeight = cellSize.height + kCellHeightAdjust;
[matrix setCellSize:NSMakeSize(matrixWidth, cellHeight)];
+ // Add in the instant view if needed and not already present.
+ CGFloat instantHeight = 0;
+ if (ShouldShowInstantOptIn()) {
+ if (!opt_in_controller_.get()) {
+ opt_in_controller_.reset(
+ [[InstantOptInController alloc] initWithDelegate:this]);
+ }
+ [[popup_ contentView] addSubview:[opt_in_controller_ view]];
+ [GetAutocompleteMatrix() setBottomCornersRounded:NO];
+ instantHeight = NSHeight([[opt_in_controller_ view] frame]);
+ } else {
+ [[opt_in_controller_ view] removeFromSuperview];
+ opt_in_controller_.reset(nil);
+ [GetAutocompleteMatrix() setBottomCornersRounded:YES];
+ }
+
// Update the selection before placing (and displaying) the window.
PaintUpdatesNow();
@@ -461,7 +506,8 @@ void AutocompletePopupViewMac::UpdatePopupAppearance() {
// because actually resizing the matrix messed up the popup size
// animation.
DCHECK_EQ([matrix intercellSpacing].height, 0.0);
- PositionPopup(rows * cellHeight);
+ CGFloat matrixHeight = rows * cellHeight;
+ PositionPopup(matrixHeight + instantHeight);
}
gfx::Rect AutocompletePopupViewMac::GetTargetBounds() {
@@ -480,7 +526,7 @@ void AutocompletePopupViewMac::SetSelectedLine(size_t line) {
// This is only called by model in SetSelectedLine() after updating
// everything. Popup should already be visible.
void AutocompletePopupViewMac::PaintUpdatesNow() {
- AutocompleteMatrix* matrix = [popup_ contentView];
+ AutocompleteMatrix* matrix = GetAutocompleteMatrix();
[matrix selectCellAtRow:model_->selected_line() column:0];
}
@@ -509,6 +555,24 @@ void AutocompletePopupViewMac::OpenURLForRow(int row, bool force_background) {
is_keyword_hint ? std::wstring() : keyword);
}
+void AutocompletePopupViewMac::UserPressedOptIn(bool opt_in) {
+ PromoCounter* counter = model_->profile()->GetInstantPromoCounter();
+ DCHECK(counter);
+ counter->Hide();
+ if (opt_in) {
+ browser::ShowInstantConfirmDialogIfNecessary([field_ window],
+ model_->profile());
+ }
+
+ // This call will remove and delete |opt_in_controller_|.
+ UpdatePopupAppearance();
+}
+
+bool AutocompletePopupViewMac::ShouldShowInstantOptIn() {
+ PromoCounter* counter = model_->profile()->GetInstantPromoCounter();
+ return (counter && counter->ShouldShow(base::Time::Now()));
+}
+
@implementation AutocompleteButtonCell
- init {
@@ -569,7 +633,7 @@ void AutocompletePopupViewMac::OpenURLForRow(int row, bool force_background) {
@implementation AutocompleteMatrix
-
+@synthesize bottomCornersRounded = bottomCornersRounded_;
// Remove all tracking areas and initialize the one we want. Removing
// all might be overkill, but it's unclear why there would be others
@@ -752,10 +816,16 @@ void AutocompletePopupViewMac::OpenURLForRow(int row, bool force_background) {
// This handles drawing the decorations of the rounded popup window,
// calling on NSMatrix to draw the actual contents.
- (void)drawRect:(NSRect)rect {
+ CGFloat bottomCornerRadius =
+ (bottomCornersRounded_ ? kPopupRoundingRadius : 0);
+
+ // "Top" really means "bottom" here, since the view is flipped.
NSBezierPath* path =
- [NSBezierPath bezierPathWithRoundedRect:[self bounds]
- xRadius:kPopupRoundingRadius
- yRadius:kPopupRoundingRadius];
+ [NSBezierPath gtm_bezierPathWithRoundRect:[self bounds]
+ topLeftCornerRadius:bottomCornerRadius
+ topRightCornerRadius:bottomCornerRadius
+ bottomLeftCornerRadius:kPopupRoundingRadius
+ bottomRightCornerRadius:kPopupRoundingRadius];
// Draw the matrix clipped to our border.
[NSGraphicsContext saveGraphicsState];
diff --git a/chrome/browser/cocoa/location_bar/instant_opt_in_controller.h b/chrome/browser/cocoa/location_bar/instant_opt_in_controller.h
new file mode 100644
index 0000000..bf53b17
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/instant_opt_in_controller.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_INSTANT_OPT_IN_CONTROLLER_H_
+#define CHROME_BROWSER_COCOA_LOCATION_BAR_INSTANT_OPT_IN_CONTROLLER_H_
+#pragma once
+
+#import <Cocoa/Cocoa.h>
+
+class Profile;
+
+// This delegate receives callbacks from the InstantOptInController when the OK
+// and Cancel buttons are pushed.
+class InstantOptInControllerDelegate {
+ public:
+ virtual void UserPressedOptIn(bool opt_in) = 0;
+
+ protected:
+ virtual ~InstantOptInControllerDelegate() {}
+};
+
+// Manages an instant opt-in view, which is part of the omnibox popup.
+@interface InstantOptInController : NSViewController {
+ @private
+ InstantOptInControllerDelegate* delegate_; // weak
+
+ // Needed in order to localize text and resize to fit.
+ IBOutlet NSButton* okButton_;
+ IBOutlet NSButton* cancelButton_;
+ IBOutlet NSTextField* label_;
+}
+
+// Designated initializer.
+- (id)initWithDelegate:(InstantOptInControllerDelegate*)delegate;
+
+// Button actions.
+- (IBAction)ok:(id)sender;
+- (IBAction)cancel:(id)sender;
+
+@end
+
+#endif // CHROME_BROWSER_COCOA_LOCATION_BAR_INSTANT_OPT_IN_CONTROLLER_H_
diff --git a/chrome/browser/cocoa/location_bar/instant_opt_in_controller.mm b/chrome/browser/cocoa/location_bar/instant_opt_in_controller.mm
new file mode 100644
index 0000000..181dc44
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/instant_opt_in_controller.mm
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/cocoa/location_bar/instant_opt_in_controller.h"
+
+#include "base/mac_util.h"
+
+@implementation InstantOptInController
+
+- (id)initWithDelegate:(InstantOptInControllerDelegate*)delegate {
+ if ((self = [super initWithNibName:@"InstantOptIn"
+ bundle:mac_util::MainAppBundle()])) {
+ delegate_ = delegate;
+ }
+ return self;
+}
+
+- (void)awakeFromNib {
+ // TODO(rohitrao): Translate and resize strings.
+}
+
+- (IBAction)ok:(id)sender {
+ delegate_->UserPressedOptIn(true);
+}
+
+- (IBAction)cancel:(id)sender {
+ delegate_->UserPressedOptIn(false);
+}
+
+@end
diff --git a/chrome/browser/cocoa/location_bar/instant_opt_in_controller_unittest.mm b/chrome/browser/cocoa/location_bar/instant_opt_in_controller_unittest.mm
new file mode 100644
index 0000000..7c3e1153
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/instant_opt_in_controller_unittest.mm
@@ -0,0 +1,62 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/scoped_nsobject.h"
+#include "base/scoped_ptr.h"
+#import "chrome/browser/cocoa/cocoa_test_helper.h"
+#import "chrome/browser/cocoa/location_bar/instant_opt_in_controller.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/platform_test.h"
+
+@interface InstantOptInController (ExposedForTesting)
+- (NSButton*)okButton;
+- (NSButton*)cancelButton;
+@end
+
+@implementation InstantOptInController (ExposedForTesting)
+- (NSButton*)okButton {
+ return okButton_;
+}
+
+- (NSButton*)cancelButton {
+ return cancelButton_;
+}
+@end
+
+
+namespace {
+
+class MockDelegate : public InstantOptInControllerDelegate {
+ public:
+ MOCK_METHOD1(UserPressedOptIn, void(bool opt_in));
+};
+
+class InstantOptInControllerTest : public CocoaTest {
+ public:
+ void SetUp() {
+ CocoaTest::SetUp();
+
+ controller_.reset(
+ [[InstantOptInController alloc] initWithDelegate:&delegate_]);
+
+ NSView* parent = [test_window() contentView];
+ [parent addSubview:[controller_ view]];
+ }
+
+ MockDelegate delegate_;
+ scoped_nsobject<InstantOptInController> controller_;
+};
+
+TEST_F(InstantOptInControllerTest, OkButtonCallback) {
+ EXPECT_CALL(delegate_, UserPressedOptIn(true));
+ [[controller_ okButton] performClick:nil];
+}
+
+TEST_F(InstantOptInControllerTest, CancelButtonCallback) {
+ EXPECT_CALL(delegate_, UserPressedOptIn(false));
+ [[controller_ cancelButton] performClick:nil];
+}
+
+} // namespace
diff --git a/chrome/browser/cocoa/location_bar/instant_opt_in_view.h b/chrome/browser/cocoa/location_bar/instant_opt_in_view.h
new file mode 100644
index 0000000..9e8c722
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/instant_opt_in_view.h
@@ -0,0 +1,16 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_INSTANT_OPT_IN_VIEW_H_
+#define CHROME_BROWSER_COCOA_LOCATION_BAR_INSTANT_OPT_IN_VIEW_H_
+#pragma once
+
+#import <Cocoa/Cocoa.h>
+
+// The instant opt in view that is embedded in the omnibox. Draws rounded
+// bottom corners and a horizontal gray line at the top.
+@interface InstantOptInView : NSView
+@end
+
+#endif // CHROME_BROWSER_COCOA_LOCATION_BAR_INSTANT_OPT_IN_VIEW_H_
diff --git a/chrome/browser/cocoa/location_bar/instant_opt_in_view.mm b/chrome/browser/cocoa/location_bar/instant_opt_in_view.mm
new file mode 100644
index 0000000..4b5e9ac
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/instant_opt_in_view.mm
@@ -0,0 +1,54 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <algorithm>
+
+#import "chrome/browser/cocoa/location_bar/instant_opt_in_view.h"
+#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h"
+
+namespace {
+// How to round off the popup's corners. Goal is to match star and go
+// buttons.
+const CGFloat kPopupRoundingRadius = 3.5;
+
+// How far from the top of the view to place the horizontal line.
+const CGFloat kHorizontalLineTopOffset = 2;
+
+// How far from the sides to inset the horizontal line.
+const CGFloat kHorizontalLineInset = 2;
+}
+
+@implementation InstantOptInView
+
+- (void)drawRect:(NSRect)rect {
+ // Round off the bottom corners only.
+ NSBezierPath* path =
+ [NSBezierPath gtm_bezierPathWithRoundRect:[self bounds]
+ topLeftCornerRadius:0
+ topRightCornerRadius:0
+ bottomLeftCornerRadius:kPopupRoundingRadius
+ bottomRightCornerRadius:kPopupRoundingRadius];
+
+ [NSGraphicsContext saveGraphicsState];
+ [path addClip];
+
+ // Background is white.
+ [[NSColor whiteColor] set];
+ NSRectFill(rect);
+
+ // Draw a horizontal line 2 px down from the top of the view, inset at the
+ // sides by 2 px.
+ CGFloat lineY = NSMaxY([self bounds]) - kHorizontalLineTopOffset;
+ CGFloat minX = std::min(NSMinX([self bounds]) + kHorizontalLineInset,
+ NSMaxX([self bounds]));
+ CGFloat maxX = std::max(NSMaxX([self bounds]) - kHorizontalLineInset,
+ NSMinX([self bounds]));
+
+ [[NSColor lightGrayColor] set];
+ NSRectFill(NSMakeRect(minX, lineY, maxX - minX, 1));
+
+ [NSGraphicsContext restoreGraphicsState];
+}
+
+@end
diff --git a/chrome/browser/cocoa/location_bar/instant_opt_in_view_unittest.mm b/chrome/browser/cocoa/location_bar/instant_opt_in_view_unittest.mm
new file mode 100644
index 0000000..a8e60e9
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/instant_opt_in_view_unittest.mm
@@ -0,0 +1,26 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/cocoa/cocoa_test_helper.h"
+#import "chrome/browser/cocoa/location_bar/instant_opt_in_view.h"
+
+namespace {
+
+class InstantOptInViewTest : public CocoaTest {
+ public:
+ InstantOptInViewTest() {
+ NSRect content_frame = [[test_window() contentView] frame];
+ scoped_nsobject<InstantOptInView> view(
+ [[InstantOptInView alloc] initWithFrame:content_frame]);
+ view_ = view.get();
+ [[test_window() contentView] addSubview:view_];
+ }
+
+ InstantOptInView* view_; // Weak. Owned by the view hierarchy.
+};
+
+// Tests display, add/remove.
+TEST_VIEW(InstantOptInViewTest, view_);
+
+} // namespace
diff --git a/chrome/browser/cocoa/location_bar/omnibox_popup_view.h b/chrome/browser/cocoa/location_bar/omnibox_popup_view.h
new file mode 100644
index 0000000..938e635
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/omnibox_popup_view.h
@@ -0,0 +1,17 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_OMNIBOX_POPUP_VIEW_H_
+#define CHROME_BROWSER_COCOA_LOCATION_BAR_OMNIBOX_POPUP_VIEW_H_
+#pragma once
+
+#import <Cocoa/Cocoa.h>
+
+// The content view for the omnibox popup. Supports up to two subviews (the
+// AutocompleteMatrix containing autocomplete results and (optionally) an
+// InstantOptInView.
+@interface OmniboxPopupView : NSView
+@end
+
+#endif // CHROME_BROWSER_COCOA_LOCATION_BAR_OMNIBOX_POPUP_VIEW_H_
diff --git a/chrome/browser/cocoa/location_bar/omnibox_popup_view.mm b/chrome/browser/cocoa/location_bar/omnibox_popup_view.mm
new file mode 100644
index 0000000..b8319ec
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/omnibox_popup_view.mm
@@ -0,0 +1,43 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/cocoa/location_bar/omnibox_popup_view.h"
+
+#include "base/logging.h"
+
+@implementation OmniboxPopupView
+
+// If there is only one subview, it is sized to fill all available space. If
+// there are two subviews, the second subview is placed at the bottom of the
+// view, and the first subview is sized to fill all remaining space.
+- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
+ NSArray* subviews = [self subviews];
+ if ([subviews count] == 0)
+ return;
+
+ DCHECK_LE([subviews count], 2U);
+
+ NSRect availableSpace = [self bounds];
+
+ if ([subviews count] >= 2) {
+ NSView* instantView = [subviews objectAtIndex:1];
+ CGFloat height = NSHeight([instantView frame]);
+ NSRect instantFrame = availableSpace;
+ instantFrame.size.height = height;
+
+ availableSpace.origin.y = height;
+ availableSpace.size.height -= height;
+ [instantView setFrame:instantFrame];
+ }
+
+ if ([subviews count] >= 1) {
+ NSView* matrixView = [subviews objectAtIndex:0];
+ if (NSHeight(availableSpace) < 0)
+ availableSpace.size.height = 0;
+
+ [matrixView setFrame:availableSpace];
+ }
+}
+
+@end
diff --git a/chrome/browser/cocoa/location_bar/omnibox_popup_view_unittest.mm b/chrome/browser/cocoa/location_bar/omnibox_popup_view_unittest.mm
new file mode 100644
index 0000000..1bbb6ee
--- /dev/null
+++ b/chrome/browser/cocoa/location_bar/omnibox_popup_view_unittest.mm
@@ -0,0 +1,68 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "base/scoped_nsobject.h"
+#import "chrome/browser/cocoa/cocoa_test_helper.h"
+#import "chrome/browser/cocoa/location_bar/omnibox_popup_view.h"
+
+namespace {
+
+class OmniboxPopupViewTest : public CocoaTest {
+ public:
+ OmniboxPopupViewTest() {
+ NSRect content_frame = [[test_window() contentView] frame];
+ scoped_nsobject<OmniboxPopupView> view(
+ [[OmniboxPopupView alloc] initWithFrame:content_frame]);
+ view_ = view.get();
+ [[test_window() contentView] addSubview:view_];
+ }
+
+ OmniboxPopupView* view_; // Weak. Owned by the view hierarchy.
+};
+
+// Tests display, add/remove.
+TEST_VIEW(OmniboxPopupViewTest, view_);
+
+// A single subview should completely fill the popup view.
+TEST_F(OmniboxPopupViewTest, ResizeWithOneSubview) {
+ scoped_nsobject<NSView> subview1([[NSView alloc] initWithFrame:NSZeroRect]);
+
+ // Adding the subview should not change its frame.
+ [view_ addSubview:subview1];
+ EXPECT_TRUE(NSEqualRects(NSZeroRect, [subview1 frame]));
+
+ // Resizing the popup view should also resize the subview.
+ [view_ setFrame:NSMakeRect(0, 0, 100, 100)];
+ EXPECT_TRUE(NSEqualRects([view_ bounds], [subview1 frame]));
+}
+
+TEST_F(OmniboxPopupViewTest, ResizeWithTwoSubviews) {
+ const CGFloat height = 50;
+ NSRect initial = NSMakeRect(0, 0, 100, height);
+
+ scoped_nsobject<NSView> subview1([[NSView alloc] initWithFrame:NSZeroRect]);
+ scoped_nsobject<NSView> subview2([[NSView alloc] initWithFrame:initial]);
+ [view_ addSubview:subview1];
+ [view_ addSubview:subview2];
+
+ // Resize the popup view to be much larger than height. |subview2|'s height
+ // should stay the same, and |subview1| should resize to fill all available
+ // space.
+ [view_ setFrame:NSMakeRect(0, 0, 300, 4 * height)];
+ EXPECT_EQ(NSWidth([view_ frame]), NSWidth([subview1 frame]));
+ EXPECT_EQ(NSWidth([view_ frame]), NSWidth([subview2 frame]));
+ EXPECT_EQ(height, NSHeight([subview2 frame]));
+ EXPECT_EQ(NSHeight([view_ frame]),
+ NSHeight([subview1 frame]) + NSHeight([subview2 frame]));
+
+ // Now resize the popup view to be smaller than height. |subview2|'s height
+ // should stay the same, and |subview1|'s height should be zero, not negative.
+ [view_ setFrame:NSMakeRect(0, 0, 300, height - 10)];
+ EXPECT_EQ(NSWidth([view_ frame]), NSWidth([subview1 frame]));
+ EXPECT_EQ(NSWidth([view_ frame]), NSWidth([subview2 frame]));
+ EXPECT_EQ(0, NSHeight([subview1 frame]));
+ EXPECT_EQ(height, NSHeight([subview2 frame]));
+}
+
+} // namespace
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 1073f1a..168597e 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1067,6 +1067,10 @@
'browser/cocoa/location_bar/ev_bubble_decoration.mm',
'browser/cocoa/location_bar/image_decoration.h',
'browser/cocoa/location_bar/image_decoration.mm',
+ 'browser/cocoa/location_bar/instant_opt_in_controller.h',
+ 'browser/cocoa/location_bar/instant_opt_in_controller.mm',
+ 'browser/cocoa/location_bar/instant_opt_in_view.h',
+ 'browser/cocoa/location_bar/instant_opt_in_view.mm',
'browser/cocoa/location_bar/keyword_hint_decoration.h',
'browser/cocoa/location_bar/keyword_hint_decoration.mm',
'browser/cocoa/location_bar/location_bar_decoration.h',
@@ -1075,6 +1079,8 @@
'browser/cocoa/location_bar/location_bar_view_mac.mm',
'browser/cocoa/location_bar/location_icon_decoration.h',
'browser/cocoa/location_bar/location_icon_decoration.mm',
+ 'browser/cocoa/location_bar/omnibox_popup_view.h',
+ 'browser/cocoa/location_bar/omnibox_popup_view.mm',
'browser/cocoa/location_bar/page_action_decoration.h',
'browser/cocoa/location_bar/page_action_decoration.mm',
'browser/cocoa/location_bar/selected_keyword_decoration.h',
diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi
index 36b9af0..ffc6dee 100644
--- a/chrome/chrome_dll.gypi
+++ b/chrome/chrome_dll.gypi
@@ -233,6 +233,7 @@
'app/nibs/ImportSettingsDialog.xib',
'app/nibs/InfoBar.xib',
'app/nibs/InfoBarContainer.xib',
+ 'app/nibs/InstantOptIn.xib',
'app/nibs/ImportProgressDialog.xib',
'app/nibs/KeywordEditor.xib',
'app/nibs/MainMenu.xib',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index dcad7d7..78b6c97 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -1195,7 +1195,10 @@
'browser/cocoa/location_bar/autocomplete_text_field_unittest_helper.mm',
'browser/cocoa/location_bar/ev_bubble_decoration_unittest.mm',
'browser/cocoa/location_bar/image_decoration_unittest.mm',
+ 'browser/cocoa/location_bar/instant_opt_in_controller_unittest.mm',
+ 'browser/cocoa/location_bar/instant_opt_in_view_unittest.mm',
'browser/cocoa/location_bar/keyword_hint_decoration_unittest.mm',
+ 'browser/cocoa/location_bar/omnibox_popup_view_unittest.mm',
'browser/cocoa/location_bar/selected_keyword_decoration_unittest.mm',
'browser/cocoa/menu_button_unittest.mm',
'browser/cocoa/menu_controller_unittest.mm',