Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3982)

Unified Diff: chrome/browser/browser_main.cc

Issue 3847006: If default search is managed, we should not asked the user to choose it at Fi... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/first_run/first_run.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
===================================================================
--- chrome/browser/browser_main.cc (revision 63018)
+++ chrome/browser/browser_main.cc (working copy)
@@ -1506,11 +1506,16 @@
if (FirstRun::InSearchExperimentLocale() && record_search_engine) {
const TemplateURL* default_search_engine =
profile->GetTemplateURLModel()->GetDefaultSearchProvider();
+ // The default engine can be NULL if the administrator has disabled
+ // default search.
+ TemplateURLPrepopulateData::SearchEngineType search_engine_type =
+ default_search_engine ? default_search_engine->search_engine_type() :
+ TemplateURLPrepopulateData::SEARCH_ENGINE_OTHER;
// Record the search engine chosen.
if (master_prefs.run_search_engine_experiment) {
UMA_HISTOGRAM_ENUMERATION(
"Chrome.SearchSelectExperiment",
- default_search_engine->search_engine_type(),
+ search_engine_type,
TemplateURLPrepopulateData::SEARCH_ENGINE_MAX);
// If the selection has been randomized, also record the winner by slot.
if (master_prefs.randomize_search_engine_experiment) {
@@ -1522,7 +1527,7 @@
experiment_type.push_back('1' + engine_pos);
UMA_HISTOGRAM_ENUMERATION(
experiment_type,
- default_search_engine->search_engine_type(),
+ search_engine_type,
TemplateURLPrepopulateData::SEARCH_ENGINE_MAX);
} else {
NOTREACHED() << "Invalid search engine selection slot.";
@@ -1531,7 +1536,7 @@
} else {
UMA_HISTOGRAM_ENUMERATION(
"Chrome.SearchSelectExempt",
- default_search_engine->search_engine_type(),
+ search_engine_type,
TemplateURLPrepopulateData::SEARCH_ENGINE_MAX);
}
}
« no previous file with comments | « no previous file | chrome/browser/first_run/first_run.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698