diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-26 04:05:29 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-26 04:05:29 +0000 |
commit | 2381ed2ed0e7560a29fe484d6c79103ca8eafa12 (patch) | |
tree | 59870ca2e3de1b1bece166dae2981a983ae65b54 | |
parent | 31d71b0e8b1b04c12e6ec654d9deca49f6303a6e (diff) | |
download | chromium_src-2381ed2ed0e7560a29fe484d6c79103ca8eafa12.zip chromium_src-2381ed2ed0e7560a29fe484d6c79103ca8eafa12.tar.gz chromium_src-2381ed2ed0e7560a29fe484d6c79103ca8eafa12.tar.bz2 |
Remove the first-run search engine dialog/ballot.
No changes to the Gtk and Mac first-run (reporting & default browser) dialog.
Tested optionally with GYP_DEFINES="branding=Chrome" and "--first-run --organic".
Chromium (all platforms): Shows the browser window directly (no dialog).
Chrome (Windows): Shows the browser window directly (no dialog).
Chrome (Linux and Mac): Shows the first-run (reporting & default browser) dialog before the browser window.
TODO(msw): Close crbug.com/111062 for removed test.
TODO(msw): Remove search engine icon/image resources (TemplateURL::logo_id_).
BUG=107005
TEST=No more standalone search engine selection dialog/ballot, Gtk and Mac first-run dialog works as before.
Review URL: http://codereview.chromium.org/9285002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119189 0039d316-1c4b-4281-b951-d872f2087c98
28 files changed, 33 insertions, 2955 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index dcf2871..55dbab9 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -7840,18 +7840,6 @@ The following plug-in is unresponsive: <ph name="PLUGIN_NAME">$1 </message> </if> - <!-- Search engine dialog messages --> - <message name="IDS_FR_SEARCH_MAIN_LABEL" desc="Tells the user to choose a search engine"> - Choose a search engine - </message> - <message name="IDS_FR_SEARCH_TEXT" desc="Explains the omnibox and asks the user to choose a search engine for this feature"> - <ph name="PRODUCT_NAME"> - $1<ex>Google Chrome</ex></ph> allows you to search the web using the omnibox. Please choose which search engine you would like it to use: - </message> - <message name="IDS_FR_SEARCH_CHOOSE" desc="Command on button to choose a search engine"> - Choose - </message> - <!-- First run bubble popup --> <message name="IDS_FR_BUBBLE_TITLE" desc="Bubble-like popup dialog title"> You can search from here with <ph name="SEARCH_ENGINE">$1<ex>Google</ex></ph> diff --git a/chrome/app/nibs/SearchEngineDialog.xib b/chrome/app/nibs/SearchEngineDialog.xib deleted file mode 100644 index 04f95f2..0000000 --- a/chrome/app/nibs/SearchEngineDialog.xib +++ /dev/null @@ -1,1391 +0,0 @@ -<?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">10F2108</string> - <string key="IBDocument.InterfaceBuilderVersion">823</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">823</string> - </object> - <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> - <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="2"/> - </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">SearchEngineDialogController</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="NSWindowTemplate" id="1005"> - <int key="NSWindowStyleMask">1</int> - <int key="NSWindowBacking">2</int> - <string key="NSWindowRect">{{196, 342}, {440, 168}}</string> - <int key="NSWTFlags">544736256</int> - <string key="NSWindowTitle">^IDS_FIRSTRUN_DLG_TITLE</string> - <string key="NSWindowClass">NSWindow</string> - <nil key="NSViewClass"/> - <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string> - <object class="NSView" key="NSWindowView" id="1006"> - <reference key="NSNextResponder"/> - <int key="NSvFlags">256</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSBox" id="608864880"> - <reference key="NSNextResponder" ref="1006"/> - <int key="NSvFlags">10</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSView" id="23335506"> - <reference key="NSNextResponder" ref="608864880"/> - <int key="NSvFlags">256</int> - <object class="NSMutableArray" key="NSSubviews"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSImageView" id="198783687"> - <reference key="NSNextResponder" ref="23335506"/> - <int key="NSvFlags">266</int> - <object class="NSMutableSet" key="NSDragTypes"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="set.sortedObjects"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>Apple PDF pasteboard type</string> - <string>Apple PICT pasteboard type</string> - <string>Apple PNG pasteboard type</string> - <string>NSFilenamesPboardType</string> - <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string> - <string>NeXT TIFF v4.0 pasteboard type</string> - </object> - </object> - <string key="NSFrameSize">{440, 60}</string> - <reference key="NSSuperview" ref="23335506"/> - <bool key="NSEnabled">YES</bool> - <object class="NSImageCell" key="NSCell" id="1070707006"> - <int key="NSCellFlags">130560</int> - <int key="NSCellFlags2">33554432</int> - <int key="NSAlign">8</int> - <int key="NSScale">2</int> - <int key="NSStyle">0</int> - <bool key="NSAnimates">NO</bool> - </object> - <bool key="NSEditable">YES</bool> - </object> - <object class="NSTextField" id="452310683"> - <reference key="NSNextResponder" ref="23335506"/> - <int key="NSvFlags">268</int> - <string key="NSFrame">{{17, 20}, {300, 17}}</string> - <reference key="NSSuperview" ref="23335506"/> - <bool key="NSEnabled">YES</bool> - <object class="NSTextFieldCell" key="NSCell" id="719278236"> - <int key="NSCellFlags">68288064</int> - <int key="NSCellFlags2">272630784</int> - <string key="NSContents">^IDS_FR_SEARCH_MAIN_LABEL</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="452310683"/> - <object class="NSColor" key="NSBackgroundColor" id="240138719"> - <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" id="320172931"> - <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">{564, 59}</string> - <reference key="NSSuperview" ref="608864880"/> - </object> - </object> - <string key="NSFrame">{{0, 109}, {564, 59}}</string> - <reference key="NSSuperview" ref="1006"/> - <string key="NSOffsets">{0, 0}</string> - <object class="NSTextFieldCell" key="NSTitleCell"> - <int key="NSCellFlags">67239424</int> - <int key="NSCellFlags2">0</int> - <string key="NSContents">Box</string> - <object class="NSFont" key="NSSupport" id="26"> - <string key="NSName">LucidaGrande</string> - <double key="NSSize">11</double> - <int key="NSfFlags">3100</int> - </object> - <object class="NSColor" key="NSBackgroundColor"> - <int key="NSColorSpace">6</int> - <string key="NSCatalogName">System</string> - <string key="NSColorName">textBackgroundColor</string> - <object class="NSColor" key="NSColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MQA</bytes> - </object> - </object> - <object class="NSColor" key="NSTextColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MCAwLjgwMDAwMDAxMTkAA</bytes> - </object> - </object> - <reference key="NSContentView" ref="23335506"/> - <int key="NSBorderType">1</int> - <int key="NSBoxType">4</int> - <int key="NSTitlePosition">0</int> - <bool key="NSTransparent">NO</bool> - <real value="0.0" key="NSBorderWidth2"/> - <object class="NSColor" key="NSBorderColor2"> - <int key="NSColorSpace">1</int> - <bytes key="NSRGB">MCAwIDAgMAA</bytes> - </object> - <object class="NSColor" key="NSFillColor2"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MC44NTAzNjQ5NjM1AA</bytes> - </object> - </object> - <object class="NSTextField" id="821211219"> - <reference key="NSNextResponder" ref="1006"/> - <int key="NSvFlags">266</int> - <string key="NSFrame">{{17, 58}, {406, 34}}</string> - <reference key="NSSuperview" ref="1006"/> - <bool key="NSEnabled">YES</bool> - <object class="NSTextFieldCell" key="NSCell" id="657434314"> - <int key="NSCellFlags">67239424</int> - <int key="NSCellFlags2">272760832</int> - <string key="NSContents">^IDS_FR_SEARCH_TEXT$IDS_PRODUCT_NAME</string> - <reference key="NSSupport" ref="26"/> - <reference key="NSControlView" ref="821211219"/> - <reference key="NSBackgroundColor" ref="240138719"/> - <reference key="NSTextColor" ref="320172931"/> - </object> - </object> - <object class="NSCustomView" id="949800387"> - <reference key="NSNextResponder" ref="1006"/> - <int key="NSvFlags">274</int> - <string key="NSFrame">{{20, 20}, {400, 30}}</string> - <reference key="NSSuperview" ref="1006"/> - <string key="NSClassName">NSView</string> - </object> - </object> - <string key="NSFrameSize">{440, 168}</string> - <reference key="NSSuperview"/> - </object> - <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string> - <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string> - </object> - <object class="NSCustomObject" id="336975392"> - <string key="NSClassName">ChromeUILocalizer</string> - </object> - <object class="NSCustomObject" id="309060391"> - <string key="NSClassName">GTMUILocalizerAndLayoutTweaker</string> - </object> - <object class="NSUserDefaultsController" id="518185475"> - <bool key="NSSharedInstance">YES</bool> - </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">localizer_</string> - <reference key="source" ref="309060391"/> - <reference key="destination" ref="336975392"/> - </object> - <int key="connectionID">5</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">uiObject_</string> - <reference key="source" ref="309060391"/> - <reference key="destination" ref="1005"/> - </object> - <int key="connectionID">6</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">headerImageView_</string> - <reference key="source" ref="1001"/> - <reference key="destination" ref="198783687"/> - </object> - <int key="connectionID">23</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">searchEngineView_</string> - <reference key="source" ref="1001"/> - <reference key="destination" ref="949800387"/> - </object> - <int key="connectionID">24</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">window</string> - <reference key="source" ref="1001"/> - <reference key="destination" ref="1005"/> - </object> - <int key="connectionID">25</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBBindingConnection" key="connection"> - <string key="label">font: mainLabelFont</string> - <reference key="source" ref="452310683"/> - <reference key="destination" ref="1001"/> - <object class="NSNibBindingConnector" key="connector"> - <reference key="NSSource" ref="452310683"/> - <reference key="NSDestination" ref="1001"/> - <string key="NSLabel">font: mainLabelFont</string> - <string key="NSBinding">font</string> - <string key="NSKeyPath">mainLabelFont</string> - <int key="NSNibBindingConnectorVersion">2</int> - </object> - </object> - <int key="connectionID">29</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="1006"/> - </object> - <reference key="parent" ref="0"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">2</int> - <reference key="object" ref="1006"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="608864880"/> - <reference ref="949800387"/> - <reference ref="821211219"/> - </object> - <reference key="parent" ref="1005"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">3</int> - <reference key="object" ref="336975392"/> - <reference key="parent" ref="0"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">4</int> - <reference key="object" ref="309060391"/> - <reference key="parent" ref="0"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">7</int> - <reference key="object" ref="608864880"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="198783687"/> - <reference ref="452310683"/> - </object> - <reference key="parent" ref="1006"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">8</int> - <reference key="object" ref="198783687"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="1070707006"/> - </object> - <reference key="parent" ref="608864880"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">9</int> - <reference key="object" ref="1070707006"/> - <reference key="parent" ref="198783687"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">10</int> - <reference key="object" ref="452310683"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="719278236"/> - </object> - <reference key="parent" ref="608864880"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">11</int> - <reference key="object" ref="719278236"/> - <reference key="parent" ref="452310683"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">12</int> - <reference key="object" ref="821211219"/> - <object class="NSMutableArray" key="children"> - <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="657434314"/> - </object> - <reference key="parent" ref="1006"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">13</int> - <reference key="object" ref="657434314"/> - <reference key="parent" ref="821211219"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">22</int> - <reference key="object" ref="949800387"/> - <reference key="parent" ref="1006"/> - </object> - <object class="IBObjectRecord"> - <int key="objectID">26</int> - <reference key="object" ref="518185475"/> - <reference key="parent" ref="0"/> - </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.IBWindowTemplateEditedContentRect</string> - <string>1.NSWindowTemplate.visibleAtLaunch</string> - <string>1.WindowOrigin</string> - <string>1.editorWindowContentRectSynchronizationRect</string> - <string>10.IBPluginDependency</string> - <string>11.IBPluginDependency</string> - <string>12.IBPluginDependency</string> - <string>13.IBPluginDependency</string> - <string>2.IBPluginDependency</string> - <string>2.IBUserGuides</string> - <string>22.IBPluginDependency</string> - <string>3.IBPluginDependency</string> - <string>4.IBPluginDependency</string> - <string>7.IBPluginDependency</string> - <string>7.IBUserGuides</string> - <string>8.IBPluginDependency</string> - <string>9.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>{{928, 818}, {440, 168}}</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{928, 818}, {440, 168}}</string> - <boolean value="NO"/> - <string>{196, 240}</string> - <string>{{357, 418}, {480, 270}}</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <object class="NSMutableArray"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBUserGuide"> - <reference key="view" ref="1006"/> - <double key="location">20</double> - <int key="affinity">0</int> - </object> - </object> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <reference ref="0"/> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <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">ChromeUILocalizer</string> - <string key="superclassName">GTMUILocalizer</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">browser/ui/cocoa/ui_localizer.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">GTMUILocalizer</string> - <string key="superclassName">NSObject</string> - <object class="NSMutableDictionary" key="outlets"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>otherObjectToLocalize_</string> - <string>owner_</string> - <string>yetAnotherObjectToLocalize_</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>id</string> - <string>id</string> - <string>id</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>otherObjectToLocalize_</string> - <string>owner_</string> - <string>yetAnotherObjectToLocalize_</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBToOneOutletInfo"> - <string key="name">otherObjectToLocalize_</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">owner_</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">yetAnotherObjectToLocalize_</string> - <string key="candidateClassName">id</string> - </object> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizer.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">GTMUILocalizerAndLayoutTweaker</string> - <string key="superclassName">NSObject</string> - <object class="NSMutableDictionary" key="outlets"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>localizerOwner_</string> - <string>localizer_</string> - <string>uiObject_</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>id</string> - <string>GTMUILocalizer</string> - <string>id</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>localizerOwner_</string> - <string>localizer_</string> - <string>uiObject_</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBToOneOutletInfo"> - <string key="name">localizerOwner_</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">localizer_</string> - <string key="candidateClassName">GTMUILocalizer</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">uiObject_</string> - <string key="candidateClassName">id</string> - </object> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.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/ui/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/ui/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/ui/cocoa/tabs/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/ui/cocoa/view_id_util.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/ui/cocoa/framed_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/ui/cocoa/themed_window.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">SearchEngineDialogController</string> - <string key="superclassName">NSWindowController</string> - <object class="NSMutableDictionary" key="outlets"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>headerImageView_</string> - <string>searchEngineView_</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>NSImageView</string> - <string>NSView</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>headerImageView_</string> - <string>searchEngineView_</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="IBToOneOutletInfo"> - <string key="name">headerImageView_</string> - <string key="candidateClassName">NSImageView</string> - </object> - <object class="IBToOneOutletInfo"> - <string key="name">searchEngineView_</string> - <string key="candidateClassName">NSView</string> - </object> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">browser/ui/cocoa/search_engine_dialog_controller.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="383371885"> - <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="295806107"> - <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="83847204"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSApplication</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSApplication</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSBox</string> - <string key="superclassName">NSView</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSBox.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">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="664571841"> - <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">NSImageCell</string> - <string key="superclassName">NSCell</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSImageCell.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSImageView</string> - <string key="superclassName">NSControl</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSImageView.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSMenu</string> - <string key="superclassName">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="962950552"> - <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="383371885"/> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <reference key="sourceIdentifier" ref="295806107"/> - </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="83847204"/> - </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="664571841"/> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSDatePickerCell.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="182891219"> - <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="962950552"/> - </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="460825150"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSView.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="529509650"> - <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">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="460825150"/> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSWindow</string> - <reference key="sourceIdentifier" ref="182891219"/> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSWindow</string> - <string key="superclassName">NSResponder</string> - <reference key="sourceIdentifier" ref="529509650"/> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSWindow</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSWindowController</string> - <string key="superclassName">NSResponder</string> - <object class="NSMutableDictionary" key="actions"> - <string key="NS.key.0">showWindow:</string> - <string key="NS.object.0">id</string> - </object> - <object class="NSMutableDictionary" key="actionInfosByName"> - <string key="NS.key.0">showWindow:</string> - <object class="IBActionInfo" key="NS.object.0"> - <string key="name">showWindow:</string> - <string key="candidateClassName">id</string> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string> - </object> - </object> - </object> - </object> - <int key="IBDocument.localizationMode">0</int> - <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> - <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/app/resources/locale_settings.grd b/chrome/app/resources/locale_settings.grd index 1014ad7..cce6e3b 100644 --- a/chrome/app/resources/locale_settings.grd +++ b/chrome/app/resources/locale_settings.grd @@ -298,23 +298,6 @@ 25 </message> - <!-- The width and height of the First Run Search Engine Selection dialog box in characters and --> - <!-- lines (See above). --> - <message name="IDS_FIRSTRUN_SEARCH_ENGINE_SELECTION_WIDTH_CHARS" use_name_for_id="true"> - 128 - </message> - <if expr="pp_ifdef('_google_chrome')"> - <message name="IDS_FIRSTRUN_SEARCH_ENGINE_SELECTION_HEIGHT_LINES" use_name_for_id="true"> - 22 - </message> - </if> - <!-- With text instead of images, the selection dialog is much smaller. --> - <if expr="not pp_ifdef('_google_chrome')"> - <message name="IDS_FIRSTRUN_SEARCH_ENGINE_SELECTION_HEIGHT_LINES" use_name_for_id="true"> - 14 - </message> - </if> - <!-- The width and height of the Import Progress dialog box in characters and --> <!-- lines (See above). --> <message name="IDS_IMPORTPROGRESS_DIALOG_WIDTH_CHARS" use_name_for_id="true"> diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 7952244..da8b53f 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -1535,8 +1535,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { master_prefs_->homepage_defined, master_prefs_->do_import_items, master_prefs_->dont_import_items, - master_prefs_->run_search_engine_experiment, - master_prefs_->randomize_search_engine_experiment, master_prefs_->make_chrome_default, process_singleton_.get()); #if defined(OS_POSIX) @@ -1841,10 +1839,8 @@ void ChromeBrowserMainParts::PostMainMessageLoopRun() { chrome_extra_parts_[i]->PostMainMessageLoopRun(); #if defined(OS_WIN) - // If it's the first run, log the search engine chosen. We wait until - // shutdown because otherwise we can't be sure the user has finished - // selecting a search engine through the dialog reached from the first run - // bubble link. + // Log the search engine chosen on first run. Do this at shutdown, after any + // changes are made from the first run bubble link, etc. if (record_search_engine_) { TemplateURLService* url_service = TemplateURLServiceFactory::GetForProfile(profile_); @@ -1856,32 +1852,9 @@ void ChromeBrowserMainParts::PostMainMessageLoopRun() { default_search_engine ? default_search_engine->search_engine_type() : SEARCH_ENGINE_OTHER; // Record the search engine chosen. - if (master_prefs_->run_search_engine_experiment) { - UMA_HISTOGRAM_ENUMERATION( - "Chrome.SearchSelectExperiment", - search_engine_type, - SEARCH_ENGINE_MAX); - // If the selection has been randomized, also record the winner by slot. - if (master_prefs_->randomize_search_engine_experiment) { - size_t engine_pos = url_service->GetSearchEngineDialogSlot(); - if (engine_pos < 4) { - std::string experiment_type = "Chrome.SearchSelectExperimentSlot"; - // Nicer in UMA if slots are 1-based. - experiment_type.push_back('1' + engine_pos); - UMA_HISTOGRAM_ENUMERATION( - experiment_type, - search_engine_type, - SEARCH_ENGINE_MAX); - } else { - NOTREACHED() << "Invalid search engine selection slot."; - } - } - } else { - UMA_HISTOGRAM_ENUMERATION( - "Chrome.SearchSelectExempt", - search_engine_type, - SEARCH_ENGINE_MAX); - } + UMA_HISTOGRAM_ENUMERATION("Chrome.SearchSelectExempt", + search_engine_type, + SEARCH_ENGINE_MAX); } #endif diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index 27e9b34..5fa9b89 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -161,8 +161,6 @@ void AutoImportPlatformCommon( bool homepage_defined, int import_items, int dont_import_items, - bool search_engine_experiment, - bool randomize_search_engine_experiment, bool make_chrome_default) { FilePath local_state_path; PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); @@ -226,13 +224,13 @@ void AutoImportPlatformCommon( content::RecordAction(UserMetricsAction("FirstRunDef_Accept")); - // Launch the search engine dialog only for certain builds, and only if the - // user has not already set preferences. + // Launch the first run dialog only for certain builds, and only if the user + // has not already set preferences. if (IsOrganicFirstRun() && !local_state_file_exists) { // The home page string may be set in the preferences, but the user should // initially use Chrome with the NTP as home page in organic builds. profile->GetPrefs()->SetBoolean(prefs::kHomePageIsNewTabPage, true); - ShowFirstRunDialog(profile, randomize_search_engine_experiment); + ShowFirstRunDialog(profile); } if (make_chrome_default) @@ -324,10 +322,6 @@ bool SetPersonalDataManagerFirstRunPref() { return true; } -bool ShouldShowSearchEngineSelector(const TemplateURLService* model) { - return model && !model->is_default_search_managed(); -} - } // namespace first_run // FirstRun ------------------------------------------------------------------- @@ -337,8 +331,6 @@ FirstRun::MasterPrefs::MasterPrefs() homepage_defined(false), do_import_items(0), dont_import_items(0), - run_search_engine_experiment(false), - randomize_search_engine_experiment(false), make_chrome_default(false) { } @@ -425,14 +417,6 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, } } - // Check to see if search engine logos should be randomized. - if (prefs.GetBool( - installer::master_preferences:: - kSearchEngineExperimentRandomizePref, - &value) && value) { - out_prefs->randomize_search_engine_experiment = true; - } - // If we're suppressing the first-run bubble, set that preference now. // Otherwise, wait until the user has completed first run to set it, so the // user is guaranteed to see the bubble iff he or she has completed the first diff --git a/chrome/browser/first_run/first_run.h b/chrome/browser/first_run/first_run.h index 0d20014..0d255b1 100644 --- a/chrome/browser/first_run/first_run.h +++ b/chrome/browser/first_run/first_run.h @@ -65,9 +65,6 @@ bool SetShowWelcomePagePref(); // Returns false if the pref could not be set. bool SetPersonalDataManagerFirstRunPref(); -// Whether the search engine selection dialog should be shown on first run. -bool ShouldShowSearchEngineSelector(const TemplateURLService* model); - // -- Platform-specific functions -- // Automatically import history and home page (and search engine, if @@ -76,8 +73,6 @@ void AutoImport(Profile* profile, bool homepage_defined, int import_items, int dont_import_items, - bool search_engine_experiment, - bool randomize_search_engine_experiment, bool make_chrome_default, ProcessSingleton* process_singleton); @@ -112,8 +107,6 @@ class FirstRun { bool homepage_defined; int do_import_items; int dont_import_items; - bool run_search_engine_experiment; - bool randomize_search_engine_experiment; bool make_chrome_default; std::vector<GURL> new_tabs; std::vector<GURL> bookmarks; diff --git a/chrome/browser/first_run/first_run_dialog.h b/chrome/browser/first_run/first_run_dialog.h index a5801b7..93529ff 100644 --- a/chrome/browser/first_run/first_run_dialog.h +++ b/chrome/browser/first_run/first_run_dialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -10,10 +10,8 @@ class Profile; namespace first_run { -// Shows the search engine choice dialog. Only called if IsOrganicFirstRun() -// is true. -void ShowFirstRunDialog(Profile* profile, - bool randomize_search_engine_experiment); +// Shows the first run dialog. Only called if IsOrganicFirstRun() is true. +void ShowFirstRunDialog(Profile* profile); } // namespace first_run diff --git a/chrome/browser/first_run/first_run_internal.h b/chrome/browser/first_run/first_run_internal.h index 54d89a0..5f66f3e 100644 --- a/chrome/browser/first_run/first_run_internal.h +++ b/chrome/browser/first_run/first_run_internal.h @@ -77,8 +77,6 @@ void AutoImportPlatformCommon( bool homepage_defined, int import_items, int dont_import_items, - bool search_engine_experiment, - bool randomize_search_engine_experiment, bool make_chrome_default); #endif // !defined(USE_AURA) diff --git a/chrome/browser/first_run/first_run_linux.cc b/chrome/browser/first_run/first_run_linux.cc index 160fa64..3465473 100644 --- a/chrome/browser/first_run/first_run_linux.cc +++ b/chrome/browser/first_run/first_run_linux.cc @@ -68,8 +68,6 @@ void AutoImport( bool homepage_defined, int import_items, int dont_import_items, - bool search_engine_experiment, - bool randomize_search_engine_experiment, bool make_chrome_default, ProcessSingleton* process_singleton) { #if !defined(USE_AURA) @@ -88,8 +86,6 @@ void AutoImport( homepage_defined, import_items, dont_import_items, - search_engine_experiment, - randomize_search_engine_experiment, make_chrome_default); process_singleton->Unlock(); diff --git a/chrome/browser/first_run/first_run_mac.mm b/chrome/browser/first_run/first_run_mac.mm index 3df3c34..c145488 100644 --- a/chrome/browser/first_run/first_run_mac.mm +++ b/chrome/browser/first_run/first_run_mac.mm @@ -30,8 +30,6 @@ void AutoImport( bool homepage_defined, int import_items, int dont_import_items, - bool search_engine_experiment, - bool randomize_search_engine_experiment, bool make_chrome_default, ProcessSingleton* process_singleton) { // We need to avoid dispatching new tabs when we are importing because @@ -53,8 +51,6 @@ void AutoImport( homepage_defined, import_items, dont_import_items, - search_engine_experiment, - randomize_search_engine_experiment, make_chrome_default); process_singleton->Unlock(); diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc index 2017bca..4edb867 100644 --- a/chrome/browser/first_run/first_run_win.cc +++ b/chrome/browser/first_run/first_run_win.cc @@ -444,8 +444,6 @@ void AutoImport( bool homepage_defined, int import_items, int dont_import_items, - bool search_engine_experiment, - bool randomize_search_engine_experiment, bool make_chrome_default, ProcessSingleton* process_singleton) { #if !defined(USE_AURA) @@ -463,8 +461,6 @@ void AutoImport( internal::AutoImportPlatformCommon(importer_host, profile, homepage_defined, import_items, dont_import_items, - search_engine_experiment, - randomize_search_engine_experiment, make_chrome_default); process_singleton->Unlock(); diff --git a/chrome/browser/google/google_update_settings_unittest.cc b/chrome/browser/google/google_update_settings_unittest.cc index 4301a35..0896a16 100644 --- a/chrome/browser/google/google_update_settings_unittest.cc +++ b/chrome/browser/google/google_update_settings_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -35,7 +35,7 @@ TEST_F(GoogleUpdateTest, LastRunTime) { #endif // defined(OS_WIN) -TEST_F(GoogleUpdateTest, ShouldShowSearchEngineDialog) { +TEST_F(GoogleUpdateTest, IsOrganicFirstRunBrandCodes) { // Test some brand codes to ensure that future changes to this method won't // go unnoticed. EXPECT_FALSE(google_util::IsOrganicFirstRun("CHFO")); diff --git a/chrome/browser/search_engines/template_url_service.h b/chrome/browser/search_engines/template_url_service.h index 68c280b..fd33966 100644 --- a/chrome/browser/search_engines/template_url_service.h +++ b/chrome/browser/search_engines/template_url_service.h @@ -279,14 +279,6 @@ class TemplateURLService : public WebDataServiceConsumer, Profile* profile() const { return profile_; } - void SetSearchEngineDialogSlot(int slot) { - search_engine_dialog_chosen_slot_ = slot; - } - - int GetSearchEngineDialogSlot() const { - return search_engine_dialog_chosen_slot_; - } - // Returns a SyncData with a sync representation of the search engine data // from |turl|. static SyncData CreateSyncDataFromTemplateURL(const TemplateURL& turl); @@ -552,10 +544,6 @@ class TemplateURLService : public WebDataServiceConsumer, // TemplateURL owned by template_urls_. const TemplateURL* default_search_provider_; - // Used for UX testing. Gives the slot in the search engine dialog that was - // chosen as the default search engine. - int search_engine_dialog_chosen_slot_; - // The initial search provider extracted from preferences. This is only valid // if we haven't been loaded or loading failed. scoped_ptr<TemplateURL> initial_default_search_provider_; diff --git a/chrome/browser/ui/cocoa/first_run_dialog.mm b/chrome/browser/ui/cocoa/first_run_dialog.mm index e7138f7..2c1c0c8 100644 --- a/chrome/browser/ui/cocoa/first_run_dialog.mm +++ b/chrome/browser/ui/cocoa/first_run_dialog.mm @@ -18,7 +18,6 @@ #include "chrome/browser/search_engines/template_url_service.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/shell_integration.h" -#import "chrome/browser/ui/cocoa/search_engine_dialog_controller.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/url_constants.h" #include "googleurl/src/gurl.h" @@ -72,17 +71,6 @@ void FirstRunShowBridge::ShowDialog() { MessageLoop::current()->QuitNow(); } -// Show the search engine selection dialog. -void ShowSearchEngineSelectionDialog(Profile* profile, - bool randomize_search_engine_experiment) { - scoped_nsobject<SearchEngineDialogController> dialog( - [[SearchEngineDialogController alloc] init]); - [dialog.get() setProfile:profile]; - [dialog.get() setRandomize:randomize_search_engine_experiment]; - - [dialog.get() showWindow:nil]; -} - // Show the first run UI. void ShowFirstRun(Profile* profile) { #if defined(GOOGLE_CHROME_BUILD) @@ -127,7 +115,7 @@ void ShowFirstRun(Profile* profile) { first_run::CreateSentinel(); // Set preference to show first run bubble and welcome page. - // Don't display the minimal bubble if there is no default search provider. + // Only display the bubble if there is a default search provider. TemplateURLService* search_engines_model = TemplateURLServiceFactory::GetForProfile(profile); if (search_engines_model && @@ -148,15 +136,7 @@ bool StatsCheckboxDefault() { namespace first_run { -void ShowFirstRunDialog(Profile* profile, - bool randomize_search_engine_experiment) { - // If the default search is not managed via policy, ask the user to - // choose a default. - TemplateURLService* model = TemplateURLServiceFactory::GetForProfile(profile); - if (first_run::ShouldShowSearchEngineSelector(model)) { - ShowSearchEngineSelectionDialog(profile, - randomize_search_engine_experiment); - } +void ShowFirstRunDialog(Profile* profile) { ShowFirstRun(profile); } diff --git a/chrome/browser/ui/cocoa/search_engine_dialog_controller.h b/chrome/browser/ui/cocoa/search_engine_dialog_controller.h deleted file mode 100644 index 41aea13..0000000 --- a/chrome/browser/ui/cocoa/search_engine_dialog_controller.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import <Cocoa/Cocoa.h> - -#include <vector> - -#import "base/memory/ref_counted.h" -#import "base/memory/scoped_nsobject.h" -#include "base/memory/scoped_ptr.h" - -class Profile; -class SearchEngineDialogControllerBridge; -class TemplateURL; -class TemplateURLService; - -// Class that acts as a controller for the search engine choice dialog. -@interface SearchEngineDialogController : NSWindowController { - @private - // Our current profile. - Profile* profile_; - - // If logos are to be displayed in random order. Used for UX testing. - bool randomize_; - - // Owned by the profile_. - TemplateURLService* searchEnginesModel_; - - // Bridge to the C++ world. - scoped_refptr<SearchEngineDialogControllerBridge> bridge_; - - // Offered search engine choices. - std::vector<const TemplateURL*> choices_; - - IBOutlet NSImageView* headerImageView_; - IBOutlet NSView* searchEngineView_; -} - -@property(assign, nonatomic) Profile* profile; -@property(assign, nonatomic) bool randomize; - -// Properties for bindings. -@property(readonly) NSFont* mainLabelFont; - -@end diff --git a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm b/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm deleted file mode 100644 index 3fb4359..0000000 --- a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) 2011 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/ui/cocoa/search_engine_dialog_controller.h" - -#include <algorithm> - -#include "base/bind.h" -#include "base/mac/bundle_locations.h" -#include "base/mac/mac_util.h" -#include "base/message_loop.h" -#include "base/sys_string_conversions.h" -#include "base/time.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/search_engines/template_url.h" -#include "chrome/browser/search_engines/template_url_service.h" -#include "chrome/browser/search_engines/template_url_service_factory.h" -#include "chrome/browser/search_engines/template_url_service_observer.h" -#include "grit/generated_resources.h" -#include "grit/theme_resources.h" -#import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" -#include "ui/base/l10n/l10n_util_mac.h" -#include "ui/base/resource/resource_bundle.h" -#include "ui/gfx/image/image.h" - -// Horizontal spacing between search engine choices. -const int kSearchEngineSpacing = 20; - -// Vertical spacing between the search engine logo and the button underneath. -const int kLogoButtonSpacing = 10; - -// Width of a label used in place of a logo. -const int kLogoLabelWidth = 170; - -// Height of a label used in place of a logo. -const int kLogoLabelHeight = 25; - -@interface SearchEngineDialogController (Private) -- (void)onTemplateURLServiceChanged; -- (void)buildSearchEngineView; -- (NSView*)viewForSearchEngine:(const TemplateURL*)engine - atIndex:(size_t)index; -- (IBAction)searchEngineSelected:(id)sender; -@end - -class SearchEngineDialogControllerBridge : - public base::RefCounted<SearchEngineDialogControllerBridge>, - public TemplateURLServiceObserver { - public: - SearchEngineDialogControllerBridge(SearchEngineDialogController* controller); - - // TemplateURLServiceObserver - virtual void OnTemplateURLServiceChanged(); - - private: - SearchEngineDialogController* controller_; -}; - -SearchEngineDialogControllerBridge::SearchEngineDialogControllerBridge( - SearchEngineDialogController* controller) : controller_(controller) { -} - -void SearchEngineDialogControllerBridge::OnTemplateURLServiceChanged() { - [controller_ onTemplateURLServiceChanged]; - MessageLoop::current()->QuitNow(); -} - -@implementation SearchEngineDialogController - -@synthesize profile = profile_; -@synthesize randomize = randomize_; - -- (id)init { - NSString* nibpath = - [base::mac::FrameworkBundle() pathForResource:@"SearchEngineDialog" - ofType:@"nib"]; - self = [super initWithWindowNibPath:nibpath owner:self]; - if (self != nil) { - bridge_ = new SearchEngineDialogControllerBridge(self); - } - return self; -} - -- (void)dealloc { - [super dealloc]; -} - -- (IBAction)showWindow:(id)sender { - searchEnginesModel_ = TemplateURLServiceFactory::GetForProfile(profile_); - searchEnginesModel_->AddObserver(bridge_.get()); - - if (searchEnginesModel_->loaded()) { - MessageLoop::current()->PostTask(FROM_HERE, - base::Bind( - &SearchEngineDialogControllerBridge::OnTemplateURLServiceChanged, - bridge_.get())); - } else { - searchEnginesModel_->Load(); - } - MessageLoop::current()->Run(); -} - -- (void)onTemplateURLServiceChanged { - searchEnginesModel_->RemoveObserver(bridge_.get()); - - // Add the search engines in the search_engines_model_ to the buttons list. - // The first three will always be from prepopulated data. - std::vector<const TemplateURL*> templateUrls = - searchEnginesModel_->GetTemplateURLs(); - - // If we have fewer than two search engines, end the search engine dialog - // immediately, leaving the imported default search engine setting intact. - if (templateUrls.size() < 2) { - return; - } - - NSWindow* win = [self window]; - - [win setBackgroundColor:[NSColor whiteColor]]; - - NSImage* headerImage = ResourceBundle::GetSharedInstance(). - GetNativeImageNamed(IDR_SEARCH_ENGINE_DIALOG_TOP); - [headerImageView_ setImage:headerImage]; - - // Is the user's default search engine included in the first three - // prepopulated set? If not, we need to expand the dialog to include a fourth - // engine. - const TemplateURL* defaultSearchEngine = - searchEnginesModel_->GetDefaultSearchProvider(); - - std::vector<const TemplateURL*>::iterator engineIter = - templateUrls.begin(); - for (int i = 0; engineIter != templateUrls.end(); ++i, ++engineIter) { - if (i < 3) { - choices_.push_back(*engineIter); - } else { - if (*engineIter == defaultSearchEngine) - choices_.push_back(*engineIter); - } - } - - // Randomize the order of the logos if the option has been set. - if (randomize_) { - int seed = static_cast<int>(base::Time::Now().ToInternalValue()); - srand(seed); - std::random_shuffle(choices_.begin(), choices_.end()); - } - - [self buildSearchEngineView]; - - // Display the dialog. - NSInteger choice = [NSApp runModalForWindow:win]; - searchEnginesModel_->SetDefaultSearchProvider(choices_.at(choice)); -} - -- (void)buildSearchEngineView { - scoped_nsobject<NSMutableArray> searchEngineViews - ([[NSMutableArray alloc] init]); - - for (size_t i = 0; i < choices_.size(); ++i) - [searchEngineViews addObject:[self viewForSearchEngine:choices_.at(i) - atIndex:i]]; - - NSSize newOverallSize = NSZeroSize; - for (NSView* view in searchEngineViews.get()) { - NSRect engineFrame = [view frame]; - engineFrame.origin = NSMakePoint(newOverallSize.width, 0); - [searchEngineView_ addSubview:view]; - [view setFrame:engineFrame]; - newOverallSize = NSMakeSize( - newOverallSize.width + NSWidth(engineFrame) + kSearchEngineSpacing, - std::max(newOverallSize.height, NSHeight(engineFrame))); - } - newOverallSize.width -= kSearchEngineSpacing; - - // Resize the window to fit (and because it's bound on all sides it will - // resize the search engine view). - NSSize currentOverallSize = [searchEngineView_ bounds].size; - NSSize deltaSize = NSMakeSize( - newOverallSize.width - currentOverallSize.width, - newOverallSize.height - currentOverallSize.height); - NSSize windowDeltaSize = [searchEngineView_ convertSize:deltaSize toView:nil]; - NSRect windowFrame = [[self window] frame]; - windowFrame.size.width += windowDeltaSize.width; - windowFrame.size.height += windowDeltaSize.height; - [[self window] setFrame:windowFrame display:NO]; -} - -- (NSView*)viewForSearchEngine:(const TemplateURL*)engine - atIndex:(size_t)index { - bool useImages = false; -#if defined(GOOGLE_CHROME_BUILD) - useImages = true; -#endif - - // Make the engine identifier. - NSView* engineIdentifier = nil; // either the logo or the text label - - int logoId = engine->logo_id(); - NSString* shortName = SysUTF16ToNSString(engine->short_name()); - if (useImages && logoId > 0) { - NSImage* logoImage = - ResourceBundle::GetSharedInstance().GetNativeImageNamed(logoId); - NSRect logoBounds = NSZeroRect; - logoBounds.size = [logoImage size]; - NSImageView* logoView = - [[[NSImageView alloc] initWithFrame:logoBounds] autorelease]; - [logoView setImage:logoImage]; - [logoView setEditable:NO]; - - // Tooltip text provides accessibility. - [logoView setToolTip:shortName]; - [logoView accessibilitySetOverrideValue:shortName - forAttribute:NSAccessibilityDescriptionAttribute]; - engineIdentifier = logoView; - } else { - // No logo -- we must show a text label. - NSRect labelBounds = NSMakeRect(0, 0, kLogoLabelWidth, kLogoLabelHeight); - NSTextField* labelField = - [[[NSTextField alloc] initWithFrame:labelBounds] autorelease]; - [labelField setBezeled:NO]; - [labelField setEditable:NO]; - [labelField setSelectable:NO]; - - scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( - [[NSMutableParagraphStyle alloc] init]); - [paragraphStyle setAlignment:NSCenterTextAlignment]; - NSDictionary* attrs = [NSDictionary dictionaryWithObjectsAndKeys: - [NSFont boldSystemFontOfSize:13], NSFontAttributeName, - paragraphStyle.get(), NSParagraphStyleAttributeName, - nil]; - - scoped_nsobject<NSAttributedString> attrValue( - [[NSAttributedString alloc] initWithString:shortName - attributes:attrs]); - - [labelField setAttributedStringValue:attrValue.get()]; - - engineIdentifier = labelField; - } - - // Make the "Choose" button. - scoped_nsobject<NSButton> chooseButton( - [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 34)]); - [chooseButton setBezelStyle:NSRoundedBezelStyle]; - [[chooseButton cell] setFont:[NSFont systemFontOfSize: - [NSFont systemFontSizeForControlSize:NSRegularControlSize]]]; - [chooseButton setTitle:l10n_util::GetNSStringWithFixup(IDS_FR_SEARCH_CHOOSE)]; - [GTMUILocalizerAndLayoutTweaker sizeToFitView:chooseButton.get()]; - [chooseButton setTag:index]; - [chooseButton setTarget:self]; - [chooseButton setAction:@selector(searchEngineSelected:)]; - - // Provide a more descriptive accessibility description. - id accElement = NSAccessibilityUnignoredDescendant(engineIdentifier); - [[chooseButton cell] accessibilitySetOverrideValue:accElement - forAttribute:NSAccessibilityTitleUIElementAttribute]; - - // Put 'em together. - NSRect engineIdentifierFrame = [engineIdentifier frame]; - NSRect chooseButtonFrame = [chooseButton frame]; - - NSRect containingViewFrame = NSZeroRect; - containingViewFrame.size.width += engineIdentifierFrame.size.width; - containingViewFrame.size.height += engineIdentifierFrame.size.height; - containingViewFrame.size.height += kLogoButtonSpacing; - containingViewFrame.size.height += chooseButtonFrame.size.height; - - NSView* containingView = - [[[NSView alloc] initWithFrame:containingViewFrame] autorelease]; - - [containingView addSubview:engineIdentifier]; - engineIdentifierFrame.origin.y = - chooseButtonFrame.size.height + kLogoButtonSpacing; - [engineIdentifier setFrame:engineIdentifierFrame]; - - [containingView addSubview:chooseButton]; - chooseButtonFrame.origin.x = - int((containingViewFrame.size.width - chooseButtonFrame.size.width) / 2); - [chooseButton setFrame:chooseButtonFrame]; - - return containingView; -} - -- (NSFont*)mainLabelFont { - return [NSFont boldSystemFontOfSize:13]; -} - -- (IBAction)searchEngineSelected:(id)sender { - [[self window] close]; - [NSApp stopModalWithCode:[sender tag]]; -} - -@end diff --git a/chrome/browser/ui/gtk/first_run_dialog.cc b/chrome/browser/ui/gtk/first_run_dialog.cc index 5d61dd0..e8e93fa 100644 --- a/chrome/browser/ui/gtk/first_run_dialog.cc +++ b/chrome/browser/ui/gtk/first_run_dialog.cc @@ -14,10 +14,6 @@ #include "chrome/browser/google/google_util.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/process_singleton.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/search_engines/template_url.h" -#include "chrome/browser/search_engines/template_url_service.h" -#include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" #include "chrome/browser/ui/gtk/gtk_util.h" @@ -32,7 +28,6 @@ #include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/gfx/image/image.h" #if defined(USE_LINUX_BREAKPAD) #include "chrome/app/breakpad_linux.h" @@ -45,28 +40,6 @@ namespace { -const gchar* kSearchEngineKey = "template-url-search-engine"; - -// Height of the label that displays the search engine's logo (in lieu of the -// actual logo) in chromium. -const int kLogoLabelHeight = 100; - -// Size of the small logo (for when we show 4 search engines). -const int kLogoLabelWidthSmall = 132; -const int kLogoLabelHeightSmall = 88; - -// The number of search engine options we normally show. It may be less than -// this number if there are not enough search engines for the current locale, -// or more if the user's imported default is not one of the top search engines -// for the current locale. -const size_t kNormalBallotSize = 3; - -// The width of the explanatory label. The 180 is the width of the large images. -const int kExplanationWidth = kNormalBallotSize * 180; - -// Horizontal spacing between search engine choices. -const int kSearchEngineSpacing = 6; - // Set the (x, y) coordinates of the welcome message (which floats on top of // the omnibox image at the top of the first run dialog). void SetWelcomePosition(GtkFloatingContainer* container, @@ -96,23 +69,14 @@ void SetWelcomePosition(GtkFloatingContainer* container, namespace first_run { -void ShowFirstRunDialog(Profile* profile, - bool randomize_search_engine_order) { - FirstRunDialog::Show(profile, randomize_search_engine_order); +void ShowFirstRunDialog(Profile* profile) { + FirstRunDialog::Show(); } } // namespace first_run // static -bool FirstRunDialog::Show(Profile* profile, - bool randomize_search_engine_order) { - // Figure out which dialogs we will show. - // If the default search is managed via policy, we won't ask. - const TemplateURLService* search_engines_model = - TemplateURLServiceFactory::GetForProfile(profile); - bool show_search_engines_dialog = - first_run::ShouldShowSearchEngineSelector(search_engines_model); - +bool FirstRunDialog::Show() { #if defined(GOOGLE_CHROME_BUILD) // If the metrics reporting is managed, we won't ask. const PrefService::Preference* metrics_reporting_pref = @@ -124,15 +88,12 @@ bool FirstRunDialog::Show(Profile* profile, bool show_reporting_dialog = false; #endif - if (!show_search_engines_dialog && !show_reporting_dialog) + if (!show_reporting_dialog) return true; // Nothing to do int response = -1; // Object deletes itself. - new FirstRunDialog(profile, - show_reporting_dialog, - show_search_engines_dialog, - &response); + new FirstRunDialog(show_reporting_dialog, &response); // TODO(port): it should be sufficient to just run the dialog: // int response = gtk_dialog_run(GTK_DIALOG(dialog)); @@ -144,103 +105,18 @@ bool FirstRunDialog::Show(Profile* profile, return (response == GTK_RESPONSE_ACCEPT); } -FirstRunDialog::FirstRunDialog(Profile* profile, - bool show_reporting_dialog, - bool show_search_engines_dialog, - int* response) - : search_engine_window_(NULL), - dialog_(NULL), +FirstRunDialog::FirstRunDialog(bool show_reporting_dialog, int* response) + : dialog_(NULL), report_crashes_(NULL), make_default_(NULL), - profile_(profile), - chosen_search_engine_(NULL), show_reporting_dialog_(show_reporting_dialog), response_(response) { - if (!show_search_engines_dialog) { - ShowReportingDialog(); - return; - } - search_engines_model_ = TemplateURLServiceFactory::GetForProfile(profile_); - - ShowSearchEngineWindow(); - - search_engines_model_->AddObserver(this); - if (search_engines_model_->loaded()) - OnTemplateURLServiceChanged(); - else - search_engines_model_->Load(); + ShowReportingDialog(); } FirstRunDialog::~FirstRunDialog() { } -void FirstRunDialog::ShowSearchEngineWindow() { - search_engine_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_deletable(GTK_WINDOW(search_engine_window_), FALSE); - gtk_window_set_title( - GTK_WINDOW(search_engine_window_), - l10n_util::GetStringUTF8(IDS_FIRSTRUN_DLG_TITLE).c_str()); - gtk_window_set_resizable(GTK_WINDOW(search_engine_window_), FALSE); - g_signal_connect(search_engine_window_, "destroy", - G_CALLBACK(OnSearchEngineWindowDestroyThunk), this); - GtkWidget* content_area = gtk_vbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(search_engine_window_), content_area); - - GdkPixbuf* pixbuf = - ui::ResourceBundle::GetSharedInstance().GetRTLEnabledPixbufNamed( - IDR_SEARCH_ENGINE_DIALOG_TOP); - GtkWidget* top_image = gtk_image_new_from_pixbuf(pixbuf); - // Right align the image. - gtk_misc_set_alignment(GTK_MISC(top_image), 1, 0); - gtk_widget_set_size_request(top_image, 0, -1); - - GtkWidget* welcome_message = gtk_util::CreateBoldLabel( - l10n_util::GetStringUTF8(IDS_FR_SEARCH_MAIN_LABEL)); - // Force the font size to make sure the label doesn't overlap the image. - // 13.4px == 10pt @ 96dpi - gtk_util::ForceFontSizePixels(welcome_message, 13.4); - - GtkWidget* top_area = gtk_floating_container_new(); - gtk_container_add(GTK_CONTAINER(top_area), top_image); - gtk_floating_container_add_floating(GTK_FLOATING_CONTAINER(top_area), - welcome_message); - g_signal_connect(top_area, "set-floating-position", - G_CALLBACK(SetWelcomePosition), welcome_message); - - gtk_box_pack_start(GTK_BOX(content_area), top_area, - FALSE, FALSE, 0); - - GtkWidget* bubble_area_background = gtk_event_box_new(); - gtk_widget_modify_bg(bubble_area_background, - GTK_STATE_NORMAL, &ui::kGdkWhite); - - GtkWidget* bubble_area_box = gtk_vbox_new(FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(bubble_area_box), - ui::kContentAreaSpacing); - gtk_container_add(GTK_CONTAINER(bubble_area_background), - bubble_area_box); - - GtkWidget* explanation = gtk_label_new( - l10n_util::GetStringFUTF8(IDS_FR_SEARCH_TEXT, - l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)).c_str()); - gtk_util::SetLabelColor(explanation, &ui::kGdkBlack); - gtk_util::SetLabelWidth(explanation, kExplanationWidth); - gtk_box_pack_start(GTK_BOX(bubble_area_box), explanation, FALSE, FALSE, 0); - - // We will fill this in after the TemplateURLService has loaded. - // GtkHButtonBox because we want all children to have the same size. - search_engine_hbox_ = gtk_hbutton_box_new(); - gtk_box_set_spacing(GTK_BOX(search_engine_hbox_), kSearchEngineSpacing); - gtk_box_pack_start(GTK_BOX(bubble_area_box), search_engine_hbox_, - FALSE, FALSE, 0); - - gtk_box_pack_start(GTK_BOX(content_area), bubble_area_background, - TRUE, TRUE, 0); - - gtk_widget_show_all(content_area); - gtk_window_present(GTK_WINDOW(search_engine_window_)); -} - void FirstRunDialog::ShowReportingDialog() { // The purpose of the dialog is to ask the user to enable stats and crash // reporting. This setting may be controlled through configuration management @@ -299,105 +175,6 @@ void FirstRunDialog::ShowReportingDialog() { gtk_widget_show_all(dialog_); } -void FirstRunDialog::OnTemplateURLServiceChanged() { - // We only watch the search engine model change once, on load. Remove - // observer so we don't try to redraw if engines change under us. - search_engines_model_->RemoveObserver(this); - - // Add search engines in |search_engines_model_| to buttons list. - std::vector<const TemplateURL*> ballot_engines = - search_engines_model_->GetTemplateURLs(); - // Drop any not in the first 3. - if (ballot_engines.size() > kNormalBallotSize) - ballot_engines.resize(kNormalBallotSize); - - const TemplateURL* default_search_engine = - search_engines_model_->GetDefaultSearchProvider(); - if (std::find(ballot_engines.begin(), - ballot_engines.end(), - default_search_engine) == - ballot_engines.end()) { - ballot_engines.push_back(default_search_engine); - } - - std::string choose_text = l10n_util::GetStringUTF8(IDS_FR_SEARCH_CHOOSE); - for (std::vector<const TemplateURL*>::iterator search_engine_iter = - ballot_engines.begin(); - search_engine_iter < ballot_engines.end(); - ++search_engine_iter) { - // Create a container for the search engine widgets. - GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing); - - // We show text on Chromium and images on Google Chrome. - bool show_images = false; -#if defined(GOOGLE_CHROME_BUILD) - show_images = true; -#endif - - // Create the image (maybe). - int logo_id = (*search_engine_iter)->logo_id(); - if (show_images && logo_id > 0) { - GdkPixbuf* pixbuf = - ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(logo_id); - if (ballot_engines.size() > kNormalBallotSize) { - GdkPixbuf* old = pixbuf; - pixbuf = gdk_pixbuf_scale_simple(pixbuf, - kLogoLabelWidthSmall, - kLogoLabelHeightSmall, - GDK_INTERP_HYPER); - g_object_unref(old); - } else { - g_object_ref(pixbuf); - } - - GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf); - gtk_box_pack_start(GTK_BOX(vbox), image, FALSE, FALSE, 0); - g_object_unref(pixbuf); - } else { - GtkWidget* logo_label = gtk_label_new(NULL); - char* markup = g_markup_printf_escaped( - "<span weight='bold' size='x-large' color='black'>%s</span>", - UTF16ToUTF8((*search_engine_iter)->short_name()).c_str()); - gtk_label_set_markup(GTK_LABEL(logo_label), markup); - g_free(markup); - gtk_widget_set_size_request(logo_label, -1, - ballot_engines.size() > kNormalBallotSize ? kLogoLabelHeightSmall : - kLogoLabelHeight); - gtk_box_pack_start(GTK_BOX(vbox), logo_label, FALSE, FALSE, 0); - } - - // Create the button. - GtkWidget* button = gtk_button_new_with_label(choose_text.c_str()); - g_signal_connect(button, "clicked", - G_CALLBACK(OnSearchEngineButtonClickedThunk), this); - g_object_set_data(G_OBJECT(button), kSearchEngineKey, - const_cast<TemplateURL*>(*search_engine_iter)); - - GtkWidget* button_centerer = gtk_hbox_new(FALSE, 0); - gtk_box_pack_start(GTK_BOX(button_centerer), button, TRUE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), button_centerer, FALSE, FALSE, 0); - - gtk_container_add(GTK_CONTAINER(search_engine_hbox_), vbox); - gtk_widget_show_all(search_engine_hbox_); - } -} - -void FirstRunDialog::OnSearchEngineButtonClicked(GtkWidget* sender) { - chosen_search_engine_ = static_cast<TemplateURL*>( - g_object_get_data(G_OBJECT(sender), kSearchEngineKey)); - gtk_widget_destroy(search_engine_window_); -} - -void FirstRunDialog::OnSearchEngineWindowDestroy(GtkWidget* sender) { - search_engine_window_ = NULL; - if (chosen_search_engine_) { - search_engines_model_->SetDefaultSearchProvider(chosen_search_engine_); - ShowReportingDialog(); - } else { - FirstRunDone(); - } -} - void FirstRunDialog::OnResponseDialog(GtkWidget* widget, int response) { if (dialog_) gtk_widget_hide_all(dialog_); diff --git a/chrome/browser/ui/gtk/first_run_dialog.h b/chrome/browser/ui/gtk/first_run_dialog.h index 67b8e6d..684dd29 100644 --- a/chrome/browser/ui/gtk/first_run_dialog.h +++ b/chrome/browser/ui/gtk/first_run_dialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -11,32 +11,20 @@ typedef struct _GtkWidget GtkWidget; #include "base/compiler_specific.h" #include "chrome/browser/first_run/first_run.h" -#include "chrome/browser/search_engines/template_url_service_observer.h" #include "ui/base/gtk/gtk_signal.h" -class TemplateURL; -class TemplateURLService; - -class FirstRunDialog : public TemplateURLServiceObserver { +class FirstRunDialog { public: // Displays the first run UI for reporting opt-in, import data etc. - static bool Show(Profile* profile, bool randomize_search_engine_order); - - virtual void OnTemplateURLServiceChanged() OVERRIDE; + static bool Show(); private: - FirstRunDialog(Profile* profile, - bool show_reporting_dialog, - bool show_search_engines_dialog, - int* response); + FirstRunDialog(bool show_reporting_dialog, int* response); virtual ~FirstRunDialog(); CHROMEGTK_CALLBACK_1(FirstRunDialog, void, OnResponseDialog, int); - CHROMEGTK_CALLBACK_0(FirstRunDialog, void, OnSearchEngineButtonClicked); - CHROMEGTK_CALLBACK_0(FirstRunDialog, void, OnSearchEngineWindowDestroy); CHROMEG_CALLBACK_0(FirstRunDialog, void, OnLearnMoreLinkClicked, GtkButton*); - void ShowSearchEngineWindow(); void ShowReportingDialog(); // This method closes the first run window and quits the message loop so that @@ -44,32 +32,15 @@ class FirstRunDialog : public TemplateURLServiceObserver { // first run tasks are done. void FirstRunDone(); - // The search engine choice window. This is created and shown before - // |dialog_|. - GtkWidget* search_engine_window_; - // Dialog that holds the bug reporting and default browser checkboxes. GtkWidget* dialog_; - // Container for the search engine choices. - GtkWidget* search_engine_hbox_; - // Crash reporting checkbox GtkWidget* report_crashes_; // Make browser default checkbox GtkWidget* make_default_; - // Our current profile - Profile* profile_; - - // Owned by the profile_. - TemplateURLService* search_engines_model_; - - // The search engine the user chose, or NULL if the user has not chosen a - // search engine. - TemplateURL* chosen_search_engine_; - // Whether we should show the dialog asking the user whether to report // crashes and usage stats. bool show_reporting_dialog_; diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc index f1e3561..912b640 100644 --- a/chrome/browser/ui/views/first_run_bubble.cc +++ b/chrome/browser/ui/views/first_run_bubble.cc @@ -22,7 +22,11 @@ const int kTopInset = 1; const int kLeftInset = 2; const int kBottomInset = 7; const int kRightInset = 2; -} +} // namespace + +namespace first_run { + void ShowFirstRunDialog(Profile* profile) {} +} // namespace first_run // static FirstRunBubble* FirstRunBubble::ShowBubble(Profile* profile, diff --git a/chrome/browser/ui/views/first_run_search_engine_view.cc b/chrome/browser/ui/views/first_run_search_engine_view.cc deleted file mode 100644 index 4f1d505..0000000 --- a/chrome/browser/ui/views/first_run_search_engine_view.cc +++ /dev/null @@ -1,510 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/first_run_search_engine_view.h" - -#include <algorithm> -#include <map> -#include <vector> - -#include "base/i18n/rtl.h" -#include "base/rand_util.h" -#include "base/time.h" -#include "base/utf_string_conversions.h" -#include "chrome/browser/first_run/first_run.h" -#include "chrome/browser/first_run/first_run_dialog.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/search_engines/search_engine_type.h" -#include "chrome/browser/search_engines/template_url.h" -#include "chrome/browser/search_engines/template_url_service.h" -#include "chrome/browser/search_engines/template_url_service_factory.h" -#include "chrome/browser/themes/theme_service.h" -#include "grit/chromium_strings.h" -#include "grit/generated_resources.h" -#include "grit/google_chrome_strings.h" -#include "grit/locale_settings.h" -#include "grit/theme_resources.h" -#include "ui/base/accessibility/accessible_view_state.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/base/resource/resource_bundle.h" -#include "ui/gfx/canvas.h" -#include "ui/gfx/font.h" -#include "ui/views/controls/button/button.h" -#include "ui/views/controls/image_view.h" -#include "ui/views/controls/label.h" -#include "ui/views/focus/accelerator_handler.h" -#include "ui/views/layout/layout_constants.h" -#include "ui/views/view_text_utils.h" -#include "ui/views/widget/widget.h" - -namespace { - -// Size to scale logos down to if showing 4 instead of 3 choices. Logo images -// are all originally sized at 180 x 120 pixels, with the logo text baseline -// located 74 pixels beneath the top of the image. -const int kSmallLogoWidth = 132; -const int kSmallLogoHeight = 88; - -// Used to pad text label height so it fits nicely in view. -const int kLabelPadding = 25; - -} // namespace - -namespace first_run { - -void ShowFirstRunDialog(Profile* profile, - bool randomize_search_engine_experiment) { - // If the default search is managed via policy, we don't ask the user to - // choose. - TemplateURLService* model = TemplateURLServiceFactory::GetForProfile(profile); - if (!first_run::ShouldShowSearchEngineSelector(model)) - return; - - views::Widget* window = views::Widget::CreateWindow( - new FirstRunSearchEngineView( - profile, randomize_search_engine_experiment)); - window->SetAlwaysOnTop(true); - window->Show(); - views::AcceleratorHandler accelerator_handler; - MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); -} - -} // namespace first_run - -SearchEngineChoice::SearchEngineChoice(views::ButtonListener* listener, - const TemplateURL* search_engine, - bool use_small_logos) - : NativeTextButton( - listener, - UTF16ToWide(l10n_util::GetStringUTF16(IDS_FR_SEARCH_CHOOSE))), - is_image_label_(false), - search_engine_(search_engine), - slot_(0) { - bool use_images = false; -#if defined(GOOGLE_CHROME_BUILD) - use_images = true; -#endif - int logo_id = search_engine_->logo_id(); - if (use_images && logo_id != kNoSearchEngineLogo) { - is_image_label_ = true; - views::ImageView* logo_image = new views::ImageView(); - SkBitmap* logo_bmp = - ResourceBundle::GetSharedInstance().GetBitmapNamed(logo_id); - logo_image->SetImage(logo_bmp); - if (use_small_logos) - logo_image->SetImageSize(gfx::Size(kSmallLogoWidth, kSmallLogoHeight)); - // Tooltip text provides accessibility for low-vision users. - logo_image->SetTooltipText(search_engine_->short_name()); - choice_view_ = logo_image; - } else { - // No logo -- we must show a text label. - views::Label* logo_label = new views::Label(search_engine_->short_name()); - logo_label->SetBackgroundColor(SK_ColorWHITE); - logo_label->SetEnabledColor(SK_ColorDKGRAY); - logo_label->SetFont(logo_label->font().DeriveFont(3, gfx::Font::BOLD)); - logo_label->SetHorizontalAlignment(views::Label::ALIGN_CENTER); - logo_label->SetTooltipText(search_engine_->short_name()); - logo_label->SetMultiLine(true); - logo_label->SizeToFit(kSmallLogoWidth); - choice_view_ = logo_label; - } - - // The accessible name of the button provides accessibility for - // screenreaders. It uses the browser name rather than the text of the - // button "Choose", since it's not obvious to a screenreader user which - // browser each button corresponds to. - SetAccessibleName(search_engine_->short_name()); -} - -int SearchEngineChoice::GetChoiceViewWidth() { - if (is_image_label_) - return choice_view_->GetPreferredSize().width(); - else - return kSmallLogoWidth; -} - -int SearchEngineChoice::GetChoiceViewHeight() { - if (!is_image_label_) { - // Labels need to be padded to look nicer. - return choice_view_->GetPreferredSize().height() + kLabelPadding; - } else { - return choice_view_->GetPreferredSize().height(); - } -} - -void SearchEngineChoice::SetChoiceViewBounds(int x, int y, int width, - int height) { - choice_view_->SetBounds(x, y, width, height); -} - -FirstRunSearchEngineView::FirstRunSearchEngineView(Profile* profile, - bool randomize) - : views::ClientView(NULL, NULL), - background_image_(NULL), - template_url_service_(TemplateURLServiceFactory::GetForProfile(profile)), - text_direction_is_rtl_(base::i18n::IsRTL()), - added_to_view_hierarchy_(false), - randomize_(randomize), - user_chosen_engine_(false), - fallback_choice_(NULL), - quit_on_closing_(true) { - // Don't show ourselves until all the search engines have loaded from - // the profile -- otherwise we have nothing to show. - SetVisible(false); - - // Start loading the search engines for the given profile. The service is - // already loaded in tests. - DCHECK(template_url_service_); - if (!template_url_service_->loaded()) { - template_url_service_->AddObserver(this); - template_url_service_->Load(); - } -} - -FirstRunSearchEngineView::~FirstRunSearchEngineView() { - template_url_service_->RemoveObserver(this); -} - -string16 FirstRunSearchEngineView::GetWindowTitle() const { - return l10n_util::GetStringUTF16(IDS_FIRSTRUN_DLG_TITLE); -} - -views::View* FirstRunSearchEngineView::GetContentsView() { - return this; -} - -views::ClientView* FirstRunSearchEngineView::CreateClientView( - views::Widget* widget) { - return this; -} - -void FirstRunSearchEngineView::WindowClosing() { - // If the window is closed by clicking the close button, we default to the - // engine in the first slot. - if (!user_chosen_engine_) - ChooseSearchEngine(fallback_choice_); - if (quit_on_closing_) - MessageLoop::current()->Quit(); -} - -views::Widget* FirstRunSearchEngineView::GetWidget() { - return View::GetWidget(); -} - -const views::Widget* FirstRunSearchEngineView::GetWidget() const { - return View::GetWidget(); -} - -bool FirstRunSearchEngineView::CanClose() { - // We need a valid search engine to set as default, so if the user tries to - // close the window before the template URL service is loaded, we must prevent - // this from happening. - return fallback_choice_ != NULL; -} - -void FirstRunSearchEngineView::ButtonPressed(views::Button* sender, - const views::Event& event) { - ChooseSearchEngine(static_cast<SearchEngineChoice*>(sender)); - GetWidget()->Close(); - // This will call through to WindowClosing() above and will quit the message - // loop. -} - -void FirstRunSearchEngineView::OnPaint(gfx::Canvas* canvas) { - // Fill in behind the background image with the standard gray toolbar color. - canvas->FillRect(GetThemeProvider()->GetColor(ThemeService::COLOR_TOOLBAR), - gfx::Rect(0, 0, width(), background_image_->height())); - // The rest of the dialog background should be white. - DCHECK(height() > background_image_->height()); - canvas->FillRect(SK_ColorWHITE, - gfx::Rect(0, background_image_->height(), width(), - height() - background_image_->height())); -} - -void FirstRunSearchEngineView::OnTemplateURLServiceChanged() { - // We only watch the search engine model change once, on load. Remove - // observer so we don't try to redraw if engines change under us. - template_url_service_->RemoveObserver(this); - AddSearchEnginesIfPossible(); -} - -gfx::Size FirstRunSearchEngineView::GetPreferredSize() { - return views::Widget::GetLocalizedContentsSize( - IDS_FIRSTRUN_SEARCH_ENGINE_SELECTION_WIDTH_CHARS, - IDS_FIRSTRUN_SEARCH_ENGINE_SELECTION_HEIGHT_LINES); -} - -void FirstRunSearchEngineView::Layout() { - gfx::Size pref_size = background_image_->GetPreferredSize(); - background_image_->SetBounds(0, 0, GetPreferredSize().width(), - pref_size.height()); - - // General vertical spacing between elements: - const int kVertSpacing = 8; - // Percentage of vertical space around logos to use for upper padding. - const double kUpperPaddingPercent = 0.4; - - int num_choices = search_engine_choices_.size(); - int label_width = GetPreferredSize().width() - 2 * views::kPanelHorizMargin; - int label_height = GetPreferredSize().height() - 2 * views::kPanelVertMargin; - - // Set title. - title_label_->SetBounds( - views::kPanelHorizMargin, - pref_size.height() / 2 - title_label_->GetPreferredSize().height() / 2, - label_width, - title_label_->GetPreferredSize().height()); - - int next_v_space = background_image_->height() + kVertSpacing * 2; - - // Set text describing search engine hooked into omnibox. - text_label_->SetBounds(views::kPanelHorizMargin, - next_v_space, - label_width, - text_label_->GetPreferredSize().height()); - next_v_space = text_label_->y() + - text_label_->height() + kVertSpacing; - - // Logos and buttons - if (num_choices > 0) { - // All search engine logos are sized the same, so the size of the first is - // generally valid as the size of all. - int logo_width = search_engine_choices_[0]->GetChoiceViewWidth(); - int logo_height = search_engine_choices_[0]->GetChoiceViewHeight(); - int button_width = search_engine_choices_[0]->GetPreferredSize().width(); - int button_height = search_engine_choices_[0]->GetPreferredSize().height(); - - int logo_section_height = logo_height + kVertSpacing + button_height; - // Upper logo margin gives the amount of whitespace between the text label - // and the logo field. The total amount of whitespace available is equal - // to the height of the whole label subtracting the heights of the logo - // section itself, the top image, the text label, and vertical spacing - // between those elements. - int upper_logo_margin = - static_cast<int>((label_height - logo_section_height - - background_image_->height() - text_label_->height() - - kVertSpacing + views::kPanelVertMargin) * kUpperPaddingPercent); - - next_v_space = text_label_->y() + text_label_->height() + - upper_logo_margin; - - // The search engine logos (which all have equal size): - int logo_padding = - (label_width - (num_choices * logo_width)) / (num_choices + 1); - - search_engine_choices_[0]->SetChoiceViewBounds( - views::kPanelHorizMargin + logo_padding, next_v_space, logo_width, - logo_height); - - int next_h_space = search_engine_choices_[0]->GetView()->x() + - logo_width + logo_padding; - search_engine_choices_[1]->SetChoiceViewBounds( - next_h_space, next_v_space, logo_width, logo_height); - - next_h_space = search_engine_choices_[1]->GetView()->x() + logo_width + - logo_padding; - if (num_choices > 2) { - search_engine_choices_[2]->SetChoiceViewBounds( - next_h_space, next_v_space, logo_width, logo_height); - } - - if (num_choices > 3) { - next_h_space = search_engine_choices_[2]->GetView()->x() + logo_width + - logo_padding; - search_engine_choices_[3]->SetChoiceViewBounds( - next_h_space, next_v_space, logo_width, logo_height); - } - - next_v_space = search_engine_choices_[0]->GetView()->y() + logo_height + - kVertSpacing; - - // The buttons for search engine selection: - int button_padding = logo_padding + logo_width / 2 - button_width / 2; - - search_engine_choices_[0]->SetBounds( - views::kPanelHorizMargin + button_padding, next_v_space, - button_width, button_height); - - next_h_space = search_engine_choices_[0]->x() + logo_width + logo_padding; - search_engine_choices_[1]->SetBounds(next_h_space, next_v_space, - button_width, button_height); - next_h_space = search_engine_choices_[1]->x() + logo_width + logo_padding; - if (num_choices > 2) { - search_engine_choices_[2]->SetBounds(next_h_space, next_v_space, - button_width, button_height); - } - - if (num_choices > 3) { - next_h_space = search_engine_choices_[2]->x() + logo_width + - logo_padding; - search_engine_choices_[3]->SetBounds(next_h_space, next_v_space, - button_width, button_height); - } - } // if (search_engine_choices.size() > 0) -} - -void FirstRunSearchEngineView::ViewHierarchyChanged(bool is_add, - View* parent, - View* child) { - View::ViewHierarchyChanged(is_add, parent, child); - - if (is_add && (child == this)) { - background_image_ = new views::ImageView(); - background_image_->SetImage( - ResourceBundle::GetSharedInstance().GetBitmapNamed( - IDR_SEARCH_ENGINE_DIALOG_TOP)); - background_image_->EnableCanvasFlippingForRTLUI(true); - background_image_->SetHorizontalAlignment(text_direction_is_rtl_ ? - views::ImageView::LEADING : views::ImageView::TRAILING); - - AddChildView(background_image_); - - int label_width = GetPreferredSize().width() - 2 * views::kPanelHorizMargin; - - // Add title and text asking the user to choose a search engine: - title_label_ = new views::Label(l10n_util::GetStringUTF16( - IDS_FR_SEARCH_MAIN_LABEL)); - title_label_->SetBackgroundColor( - GetThemeProvider()->GetColor(ThemeService::COLOR_TOOLBAR)); - title_label_->SetEnabledColor(SK_ColorBLACK); - title_label_->SetFont(title_label_->font().DeriveFont(3, gfx::Font::BOLD)); - title_label_->SetMultiLine(true); - title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); - title_label_->SizeToFit(label_width); - AddChildView(title_label_); - - text_label_ = new views::Label(l10n_util::GetStringFUTF16( - IDS_FR_SEARCH_TEXT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); - text_label_->SetBackgroundColor(SK_ColorWHITE); - text_label_->SetEnabledColor(SK_ColorBLACK); - text_label_->SetFont(text_label_->font().DeriveFont(1, gfx::Font::NORMAL)); - text_label_->SetMultiLine(true); - text_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); - text_label_->SizeToFit(label_width); - AddChildView(text_label_); - - added_to_view_hierarchy_ = true; - AddSearchEnginesIfPossible(); - } -} - -void FirstRunSearchEngineView::GetAccessibleState( - ui::AccessibleViewState* state) { - state->role = ui::AccessibilityTypes::ROLE_ALERT; -} - -void FirstRunSearchEngineView::AddSearchEnginesIfPossible() { - if (!template_url_service_->loaded() || !added_to_view_hierarchy_) - return; - - // Add search engines in template_url_service_ to buttons list. The - // first three will always be from prepopulated data. - std::vector<const TemplateURL*> template_urls = - template_url_service_->GetTemplateURLs(); - - // If we have fewer than two search engines, end search engine dialog - // immediately, leaving imported default search engine setting intact. - if (template_urls.size() < 2) { - MessageLoop::current()->Quit(); - return; - } - - std::vector<const TemplateURL*>::iterator search_engine_iter; - - // Is user's default search engine included in first three prepopulated - // set? If not, we need to expand the dialog to include a fourth engine. - const TemplateURL* default_search_engine = - template_url_service_->GetDefaultSearchProvider(); - // If the user's default choice is not in the first three search engines - // in template_urls, store it in |default_choice| and provide it as a - // fourth option. - SearchEngineChoice* default_choice = NULL; - - // First, see if we have 4 logos to show (in which case we use small logos). - // We show 4 logos when the default search engine the user has chosen is - // not one of the first three prepopulated engines. - if (template_urls.size() > 3) { - for (search_engine_iter = template_urls.begin() + 3; - search_engine_iter != template_urls.end(); - ++search_engine_iter) { - if (default_search_engine == *search_engine_iter) { - default_choice = new SearchEngineChoice(this, *search_engine_iter, - true); - } - } - } - - // Now that we know what size the logos should be, create new search engine - // choices for the view. If there are 2 search engines, only show 2 - // choices; for 3 or more, show 3 (unless the default is not one of the - // top 3, in which case show 4). - for (search_engine_iter = template_urls.begin(); - search_engine_iter < template_urls.begin() + - (template_urls.size() < 3 ? 2 : 3); - ++search_engine_iter) { - // Push first three engines into buttons: - SearchEngineChoice* choice = new SearchEngineChoice(this, - *search_engine_iter, default_choice != NULL); - search_engine_choices_.push_back(choice); - AddChildView(choice->GetView()); // The logo or text view. - AddChildView(choice); // The button associated with the choice. - } - // Push the default choice to the fourth position. - if (default_choice) { - search_engine_choices_.push_back(default_choice); - AddChildView(default_choice->GetView()); // The logo or text view. - AddChildView(default_choice); // The button associated with the choice. - } - - // It is critically important that this line happens before randomization is - // done below. - fallback_choice_ = search_engine_choices_.front(); - - // Randomize order of logos if option has been set. - if (randomize_) { - std::random_shuffle(search_engine_choices_.begin(), - search_engine_choices_.end(), - base::RandGenerator); - // Assign to each choice the position in which it is shown on the screen. - std::vector<SearchEngineChoice*>::iterator it; - int slot = 0; - for (it = search_engine_choices_.begin(); - it != search_engine_choices_.end(); - it++) { - (*it)->set_slot(slot++); - } - } - - // Now that we know how many logos to show, lay out and become visible. - SetVisible(true); - Layout(); - SchedulePaint(); - - // If the widget has detected that a screenreader is running, change the - // button names from "Choose" to the name of the search engine. This works - // around a bug that JAWS ignores the accessible name of a native button. - if (GetWidget() && GetWidget()->IsAccessibleWidget()) { - std::vector<SearchEngineChoice*>::iterator it; - for (it = search_engine_choices_.begin(); - it != search_engine_choices_.end(); - it++) { - (*it)->SetText((*it)->GetSearchEngine()->short_name()); - } - } - - // This will tell screenreaders that they should read the full text - // of this dialog to the user now (rather than waiting for the user - // to explore it). - GetWidget()->NotifyAccessibilityEvent( - this, ui::AccessibilityTypes::EVENT_ALERT, true); -} - -void FirstRunSearchEngineView::ChooseSearchEngine(SearchEngineChoice* choice) { - user_chosen_engine_ = true; - DCHECK(choice && template_url_service_); - template_url_service_->SetSearchEngineDialogSlot(choice->slot()); - const TemplateURL* default_search = choice->GetSearchEngine(); - if (default_search) - template_url_service_->SetDefaultSearchProvider(default_search); -} diff --git a/chrome/browser/ui/views/first_run_search_engine_view.h b/chrome/browser/ui/views/first_run_search_engine_view.h deleted file mode 100644 index 841c2e5..0000000 --- a/chrome/browser/ui/views/first_run_search_engine_view.h +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) 2011 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_UI_VIEWS_FIRST_RUN_SEARCH_ENGINE_VIEW_H_ -#define CHROME_BROWSER_UI_VIEWS_FIRST_RUN_SEARCH_ENGINE_VIEW_H_ -#pragma once - -#include <vector> - -#include "chrome/browser/search_engines/template_url_service_observer.h" -#include "ui/gfx/size.h" -#include "ui/views/controls/button/text_button.h" -#include "ui/views/view.h" -#include "ui/views/widget/widget_delegate.h" -#include "ui/views/window/client_view.h" - -class Profile; -class TemplateURL; -class TemplateURLService; -class ThemeService; - -namespace views { -class ImageView; -class Label; -} - -// This class holds the logo and TemplateURL for a search engine and serves -// as its button in the search engine selection view. -class SearchEngineChoice : public views::NativeTextButton { - public: - // |listener| is the FirstRunView that waits for the search engine selection - // to complete; |search_engine| holds the data for the particular search - // engine this button represents; |use_small_logos| is true if we're - // displaying more than three choices. - SearchEngineChoice(views::ButtonListener* listener, - const TemplateURL* search_engine, - bool use_small_logos); - - virtual ~SearchEngineChoice() {} - - // These methods return data about the logo or text view associated - // with this search engine choice. - views::View* GetView() { return choice_view_; } - int GetChoiceViewWidth(); - int GetChoiceViewHeight(); - - // Set the bounds for the search engine choice view; called in the - // Layout method, when we know what the new bounds should be. - void SetChoiceViewBounds(int x, int y, int width, int height); - - // Accessor for the search engine data this button represents. - const TemplateURL* GetSearchEngine() { return search_engine_; } - - // Used for UX testing. - void set_slot(int slot) { slot_ = slot; } - int slot() const { return slot_; } - - private: - // Either an ImageView of a logo, or a Label with text. Owned by - // FirstRunSearchEngineView. - views::View* choice_view_; - - // True if choice_view_ is holding an ImageView. - bool is_image_label_; - - // Data for the search engine held here. - const TemplateURL* search_engine_; - - // Used for UX testing. Gives slot in which search engine was shown. - int slot_; - - DISALLOW_COPY_AND_ASSIGN(SearchEngineChoice); -}; - -// This class displays a large search engine choice dialog view during -// initial first run import. -class FirstRunSearchEngineView : public views::ClientView, - public views::WidgetDelegate, - public views::ButtonListener, - public TemplateURLServiceObserver { - public: - // |profile| allows us to get the set of imported search engines. - // |randomize| is true if logos are to be displayed in random order. - FirstRunSearchEngineView(Profile* profile, bool randomize); - - virtual ~FirstRunSearchEngineView(); - - // Overridden from views::WidgetDelegate: - virtual string16 GetWindowTitle() const OVERRIDE; - virtual views::View* GetContentsView() OVERRIDE; - virtual views::ClientView* CreateClientView(views::Widget* widget) OVERRIDE; - virtual void WindowClosing() OVERRIDE; - virtual views::Widget* GetWidget() OVERRIDE; - virtual const views::Widget* GetWidget() const OVERRIDE; - - // Overridden from views::ClientView: - virtual bool CanClose() OVERRIDE; - - // Overridden from views::ButtonListener: - virtual void ButtonPressed(views::Button* sender, - const views::Event& event) OVERRIDE; - - // Overridden from views::View: - virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual void Layout() OVERRIDE; - virtual void ViewHierarchyChanged(bool is_add, - View* parent, - View* child) OVERRIDE; - virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; - - // Override from views::View so we can draw the gray background at dialog top. - virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; - - // Overridden from TemplateURLServiceObserver. When the search engines have - // loaded from the profile, we can populate the logos in the dialog box - // to present to the user. - virtual void OnTemplateURLServiceChanged() OVERRIDE; - -#if defined(UNIT_TEST) - void set_quit_on_closing(bool quit_on_closing) { - quit_on_closing_ = quit_on_closing; - } -#endif - - private: - // Once the TemplateURLService has loaded and we're in a View hierarchy, it's - // OK to add the search engines from the TemplateURLService. - void AddSearchEnginesIfPossible(); - - // Sets the default search engine to the one represented by |choice|. - void ChooseSearchEngine(SearchEngineChoice* choice); - - // One for each search engine choice offered, either three or four. - std::vector<SearchEngineChoice*> search_engine_choices_; - - // If logos are to be displayed in random order. Used for UX testing. - bool randomize_; - - // Services associated with the current profile. - TemplateURLService* template_url_service_; - ThemeService* theme_service_; - - bool text_direction_is_rtl_; - - bool added_to_view_hierarchy_; - - // Image of browser search box with grey background and bubble arrow. - views::ImageView* background_image_; - - // UI elements: - views::Label* title_label_; - views::Label* text_label_; - - // True when the user has chosen a particular search engine. Defaults to - // false. When the user closes the window without choosing a search engine, - // the engine specified by |fallback_choice_| is chosen. - bool user_chosen_engine_; - - // The engine to choose when the user closes the window without explicitly - // making a selection. Because of randomization functionality, we cannot - // reliably deduce this from slot order, so this value is saved prior to - // randomization. - SearchEngineChoice* fallback_choice_; - - // Defaults to true. Indicates that the current message loop should be quit - // when the window is closed. This is false in tests when this dialog does not - // spin its own message loop. - bool quit_on_closing_; - - DISALLOW_COPY_AND_ASSIGN(FirstRunSearchEngineView); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_FIRST_RUN_SEARCH_ENGINE_VIEW_H_ diff --git a/chrome/browser/ui/views/first_run_search_engine_view_unittest.cc b/chrome/browser/ui/views/first_run_search_engine_view_unittest.cc deleted file mode 100644 index 0532c49..0000000 --- a/chrome/browser/ui/views/first_run_search_engine_view_unittest.cc +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/first_run_search_engine_view.h" - -#include "base/threading/thread.h" -#include "chrome/browser/search_engines/template_url.h" -#include "chrome/browser/search_engines/template_url_service.h" -#include "chrome/browser/search_engines/template_url_service_factory.h" -#include "chrome/common/chrome_notification_types.h" -#include "chrome/test/base/testing_profile.h" -#include "chrome/test/base/ui_test_utils.h" -#include "content/public/browser/notification_service.h" -#include "content/test/test_browser_thread.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "ui/views/focus/accelerator_handler.h" -#include "ui/views/test/views_test_base.h" -#include "ui/views/widget/widget.h" - -typedef views::ViewsTestBase FirstRunSearchEngineViewTest; - -TEST_F(FirstRunSearchEngineViewTest, ClosingSelectsFirstEngine) { - // Create the first run search engine selector, and just close the window. - // The first engine in the vector returned by GetTemplateURLs should be set as - // the default engine. - TestingProfile profile; - profile.CreateTemplateURLService(); - profile.BlockUntilTemplateURLServiceLoaded(); - - // Set a dummy provider as the default so we can verify something changed. - TemplateURLService* service = - TemplateURLServiceFactory::GetForProfile(&profile); - ASSERT_TRUE(service != NULL); - EXPECT_EQ(NULL, service->GetDefaultSearchProvider()); - TemplateURL* d1 = new TemplateURL; - TemplateURL* d2 = new TemplateURL; - TemplateURL* d3 = new TemplateURL; - service->Add(d1); - service->Add(d2); - service->Add(d3); - service->SetDefaultSearchProvider(d3); - - FirstRunSearchEngineView* contents = - new FirstRunSearchEngineView(&profile, false); - contents->set_quit_on_closing(false); - views::Widget* window = views::Widget::CreateWindow(contents); - window->Show(); - window->Close(); - RunPendingMessages(); // Allows the window to be destroyed after Close(); - - TemplateURLService::TemplateURLVector template_urls = - service->GetTemplateURLs(); - ASSERT_TRUE(!template_urls.empty()); - EXPECT_EQ(template_urls.front(), service->GetDefaultSearchProvider()); -} - -// http://code.google.com/p/chromium/issues/detail?id=111062 -TEST_F(FirstRunSearchEngineViewTest, - FLAKY_ClosingBeforeServiceLoadedAbortsClose) { - // This ensures the current thread is named the UI thread, so code that checks - // that this is the UI thread doesn't assert. - base::Thread db_thread("tempdbthread"); - db_thread.Start(); - content::TestBrowserThread ui_thread(content::BrowserThread::UI, - message_loop()); - content::TestBrowserThread db_test_thread(content::BrowserThread::DB, - db_thread.message_loop()); - - TestingProfile profile; - // We need to initialize the web database before accessing the template url - // service otherwise the template url service will init itself synchronously - // and appear to be loaded. - profile.CreateWebDataService(false); - profile.CreateTemplateURLService(); - - // Instead of giving the template url service a chance to load, try and close - // the window immediately. - FirstRunSearchEngineView* contents = - new FirstRunSearchEngineView(&profile, false); - contents->set_quit_on_closing(false); - views::Widget* window = views::Widget::CreateWindow(contents); - window->Show(); - EXPECT_TRUE(window->IsVisible()); - window->Close(); - // The window wouldn't actually be closed until a return to the message loop, - // which we don't want to spin here because the window shouldn't have closed - // in the correct case. The window is however actually hidden immediately when - // the window is allowed to close, so we can test for visibility to make sure - // it hasn't. - EXPECT_TRUE(window->IsVisible()); - - // Now let the template url service a chance to load. - ui_test_utils::WindowedNotificationObserver service_load_observer( - chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, - content::NotificationService::AllSources()); - service_load_observer.Wait(); - - // .. and try and close the window. It should be allowed to now. - window->Close(); - EXPECT_FALSE(window->IsVisible()); - - // Allow the window to actually close. - RunPendingMessages(); - - // Verify goodness. Because we actually went to the trouble of starting the - // WebDB, we will have real data in the model, so we can verify a choice was - // made without having to seed the model with dummy data. - TemplateURLService* service = - TemplateURLServiceFactory::GetForProfile(&profile); - ASSERT_TRUE(service != NULL); - EXPECT_TRUE(service->GetDefaultSearchProvider() != NULL); -} diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 293fd95..23d6b3d 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2854,8 +2854,6 @@ 'browser/ui/cocoa/profile_menu_controller.mm', 'browser/ui/cocoa/restart_browser.h', 'browser/ui/cocoa/restart_browser.mm', - 'browser/ui/cocoa/search_engine_dialog_controller.h', - 'browser/ui/cocoa/search_engine_dialog_controller.mm', 'browser/ui/cocoa/select_file_dialog_mac.mm', 'browser/ui/cocoa/simple_message_box_mac.mm', 'browser/ui/cocoa/speech_input_window_controller.h', @@ -3495,8 +3493,6 @@ 'browser/ui/views/find_bar_view.h', 'browser/ui/views/first_run_bubble.cc', 'browser/ui/views/first_run_bubble.h', - 'browser/ui/views/first_run_search_engine_view.cc', - 'browser/ui/views/first_run_search_engine_view.h', 'browser/ui/views/frame/app_panel_browser_frame_view.cc', 'browser/ui/views/frame/app_panel_browser_frame_view.h', 'browser/ui/views/frame/browser_frame.cc', @@ -4693,7 +4689,6 @@ 'app/nibs/MainMenu.xib', 'app/nibs/SadTab.xib', 'app/nibs/SaveAccessoryView.xib', - 'app/nibs/SearchEngineDialog.xib', 'app/nibs/SpeechInputBubble.xib', 'app/nibs/TaskManager.xib', 'app/nibs/Toolbar.xib', @@ -4834,8 +4829,6 @@ ['include', '^browser/ui/gtk/download/download_started_animation_gtk.cc'], ['include', '^browser/ui/gtk/edit_search_engine_dialog.cc'], ['include', '^browser/ui/gtk/edit_search_engine_dialog.h'], - ['include', '^browser/ui/gtk/first_run_dialog.cc'], - ['include', '^browser/ui/gtk/first_run_dialog.h'], ['include', '^browser/ui/gtk/gtk_chrome_button.cc'], ['include', '^browser/ui/gtk/gtk_chrome_button.h'], ['include', '^browser/ui/gtk/gtk_chrome_cookie_view.cc'], diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi index 2119cea..bfc1c73 100644 --- a/chrome/chrome_dll.gypi +++ b/chrome/chrome_dll.gypi @@ -256,7 +256,6 @@ 'app/nibs/PreviewableContents.xib', 'app/nibs/SaveAccessoryView.xib', 'app/nibs/SadTab.xib', - 'app/nibs/SearchEngineDialog.xib', 'app/nibs/SpeechInputBubble.xib', 'app/nibs/TabView.xib', 'app/nibs/TaskManager.xib', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index f403878..9954cd0 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1963,7 +1963,6 @@ 'browser/ui/views/crypto_module_password_dialog_view_unittest.cc', 'browser/ui/views/extensions/browser_action_drag_data_unittest.cc', 'browser/ui/views/first_run_bubble_unittest.cc', - 'browser/ui/views/first_run_search_engine_view_unittest.cc', 'browser/ui/views/generic_info_view_unittest.cc', 'browser/ui/views/reload_button_unittest.cc', 'browser/ui/views/select_file_dialog_extension_unittest.cc', diff --git a/chrome/installer/util/master_preferences_constants.cc b/chrome/installer/util/master_preferences_constants.cc index f5a9066..9dc6197 100644 --- a/chrome/installer/util/master_preferences_constants.cc +++ b/chrome/installer/util/master_preferences_constants.cc @@ -34,9 +34,6 @@ namespace master_preferences { const char kMsi[] = "msi"; const char kMultiInstall[] = "multi_install"; const char kRequireEula[] = "require_eula"; - const char kSearchEngineExperimentPref[] = "search_engine_experiment"; - const char kSearchEngineExperimentRandomizePref[] = - "search_engine_experiment_randomize"; const char kSystemLevel[] = "system_level"; const char kVerboseLogging[] = "verbose_logging"; const char kExtensionsBlock[] = "extensions.settings"; diff --git a/chrome/installer/util/master_preferences_constants.h b/chrome/installer/util/master_preferences_constants.h index a0eaf19..4f6af3e 100644 --- a/chrome/installer/util/master_preferences_constants.h +++ b/chrome/installer/util/master_preferences_constants.h @@ -71,10 +71,6 @@ extern const char kMsi[]; extern const char kMultiInstall[]; // Boolean. Show EULA dialog before install. extern const char kRequireEula[]; -// Boolean. Use experimental search engine selection dialog. -extern const char kSearchEngineExperimentPref[]; -// Boolean. Randomize logos in experimental search engine selection dialog. -extern const char kSearchEngineExperimentRandomizePref[]; // Boolean. Install Chrome to system wise location. Cmd line override present. extern const char kSystemLevel[]; // Boolean. Run installer in verbose mode. Cmd line override present. diff --git a/chrome/installer/util/master_preferences_unittest.cc b/chrome/installer/util/master_preferences_unittest.cc index c322476..a6738a6 100644 --- a/chrome/installer/util/master_preferences_unittest.cc +++ b/chrome/installer/util/master_preferences_unittest.cc @@ -61,8 +61,7 @@ TEST_F(MasterPreferencesTest, ParseDistroParams) { " \"require_eula\": true,\n" " \"alternate_shortcut_text\": true,\n" " \"chrome_shortcut_icon_index\": 1,\n" - " \"ping_delay\": 40,\n" - " \"search_engine_experiment\": true\n" + " \"ping_delay\": 40\n" " },\n" " \"blah\": {\n" " \"import_history\": false\n" @@ -87,7 +86,6 @@ TEST_F(MasterPreferencesTest, ParseDistroParams) { installer::master_preferences::kVerboseLogging, installer::master_preferences::kRequireEula, installer::master_preferences::kAltShortcutText, - installer::master_preferences::kSearchEngineExperimentPref, }; for (int i = 0; i < arraysize(expected_true); ++i) { |