diff options
author | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 00:41:18 +0000 |
---|---|---|
committer | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 00:41:18 +0000 |
commit | de5a45de018d8388f7479da3adb6472b991bf4f3 (patch) | |
tree | a1a9eda2cf54940ad59284c811416d45a7cb7ed3 /chrome/browser/first_run | |
parent | 8ec2c7e81ab2e1f5bcfa93e3655263d5e27d90cf (diff) | |
download | chromium_src-de5a45de018d8388f7479da3adb6472b991bf4f3.zip chromium_src-de5a45de018d8388f7479da3adb6472b991bf4f3.tar.gz chromium_src-de5a45de018d8388f7479da3adb6472b991bf4f3.tar.bz2 |
Removed code duplication on test for search engine selector on first run.
Also fixes the test logic on the mac, which currently is ignoring
SearchEngineSelectorDisallowed() if the default search provider is not managed,
which is the most common case.
BUG=None
TEST=The search engine selection dialog shows on first run, except when the default search provider is managed by policy or the dialog is disallowed.
Review URL: http://codereview.chromium.org/7936009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101877 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r-- | chrome/browser/first_run/first_run.cc | 6 | ||||
-rw-r--r-- | chrome/browser/first_run/first_run.h | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index f73f179..3cc08bda 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -462,6 +462,12 @@ bool FirstRun::SearchEngineSelectorDisallowed() { } // static +bool FirstRun::ShouldShowSearchEngineSelector(const TemplateURLService* model) { + return !SearchEngineSelectorDisallowed() && + model && !model->is_default_search_managed(); +} + +// static bool FirstRun::SetOEMFirstRunBubblePref() { PrefService* local_state = g_browser_process->local_state(); if (!local_state) diff --git a/chrome/browser/first_run/first_run.h b/chrome/browser/first_run/first_run.h index 35c82ac0..235754c 100644 --- a/chrome/browser/first_run/first_run.h +++ b/chrome/browser/first_run/first_run.h @@ -17,10 +17,11 @@ class CommandLine; class FilePath; class GURL; -class Profile; -class ProcessSingleton; class ImporterHost; class ImporterList; +class Profile; +class ProcessSingleton; +class TemplateURLService; // This class contains the chrome first-run installation actions needed to // fully test the custom installer. It also contains the opposite actions to @@ -131,6 +132,9 @@ class FirstRun { // being shown. static bool SearchEngineSelectorDisallowed(); + // Whether the search engine selection dialog should be shown on first run. + static bool ShouldShowSearchEngineSelector(const TemplateURLService* model); + // -- Platform-specific functions -- // Imports settings. This may be done in a separate process depending on the |