OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 // shutdown because otherwise we can't be sure the user has finished | 1233 // shutdown because otherwise we can't be sure the user has finished |
1234 // selecting a search engine through the dialog reached from the first run | 1234 // selecting a search engine through the dialog reached from the first run |
1235 // bubble link. | 1235 // bubble link. |
1236 if (FirstRun::InSearchExperimentLocale() && record_search_engine) { | 1236 if (FirstRun::InSearchExperimentLocale() && record_search_engine) { |
1237 const TemplateURL* default_search_engine = | 1237 const TemplateURL* default_search_engine = |
1238 profile->GetTemplateURLModel()->GetDefaultSearchProvider(); | 1238 profile->GetTemplateURLModel()->GetDefaultSearchProvider(); |
1239 // Record the search engine chosen. | 1239 // Record the search engine chosen. |
1240 if (master_prefs.run_search_engine_experiment) { | 1240 if (master_prefs.run_search_engine_experiment) { |
1241 UMA_HISTOGRAM_ENUMERATION( | 1241 UMA_HISTOGRAM_ENUMERATION( |
1242 "Chrome.SearchSelectExperiment", | 1242 "Chrome.SearchSelectExperiment", |
1243 TemplateURLPrepopulateData::GetSearchEngineType( | 1243 default_search_engine->search_engine_type(), |
1244 default_search_engine), | |
1245 TemplateURLPrepopulateData::SEARCH_ENGINE_MAX); | 1244 TemplateURLPrepopulateData::SEARCH_ENGINE_MAX); |
1246 // If the selection has been randomized, also record the winner by slot. | 1245 // If the selection has been randomized, also record the winner by slot. |
1247 if (master_prefs.randomize_search_engine_experiment) { | 1246 if (master_prefs.randomize_search_engine_experiment) { |
1248 size_t engine_pos = profile->GetTemplateURLModel()-> | 1247 size_t engine_pos = profile->GetTemplateURLModel()-> |
1249 GetSearchEngineDialogSlot(); | 1248 GetSearchEngineDialogSlot(); |
1250 if (engine_pos < 4) { | 1249 if (engine_pos < 4) { |
1251 std::string experiment_type = "Chrome.SearchSelectExperimentSlot"; | 1250 std::string experiment_type = "Chrome.SearchSelectExperimentSlot"; |
1252 // Nicer in UMA if slots are 1-based. | 1251 // Nicer in UMA if slots are 1-based. |
1253 experiment_type.push_back('1' + engine_pos); | 1252 experiment_type.push_back('1' + engine_pos); |
1254 UMA_HISTOGRAM_ENUMERATION( | 1253 UMA_HISTOGRAM_ENUMERATION( |
1255 experiment_type, | 1254 experiment_type, |
1256 TemplateURLPrepopulateData::GetSearchEngineType( | 1255 default_search_engine->search_engine_type(), |
1257 default_search_engine), | |
1258 TemplateURLPrepopulateData::SEARCH_ENGINE_MAX); | 1256 TemplateURLPrepopulateData::SEARCH_ENGINE_MAX); |
1259 } else { | 1257 } else { |
1260 NOTREACHED() << "Invalid search engine selection slot."; | 1258 NOTREACHED() << "Invalid search engine selection slot."; |
1261 } | 1259 } |
1262 } | 1260 } |
1263 } else { | 1261 } else { |
1264 UMA_HISTOGRAM_ENUMERATION( | 1262 UMA_HISTOGRAM_ENUMERATION( |
1265 "Chrome.SearchSelectExempt", | 1263 "Chrome.SearchSelectExempt", |
1266 TemplateURLPrepopulateData::GetSearchEngineType( | 1264 default_search_engine->search_engine_type(), |
1267 default_search_engine), | |
1268 TemplateURLPrepopulateData::SEARCH_ENGINE_MAX); | 1265 TemplateURLPrepopulateData::SEARCH_ENGINE_MAX); |
1269 } | 1266 } |
1270 } | 1267 } |
1271 #endif | 1268 #endif |
1272 | 1269 |
1273 chrome_browser_net_websocket_experiment::WebSocketExperimentRunner::Stop(); | 1270 chrome_browser_net_websocket_experiment::WebSocketExperimentRunner::Stop(); |
1274 | 1271 |
1275 process_singleton.Cleanup(); | 1272 process_singleton.Cleanup(); |
1276 | 1273 |
1277 metrics->Stop(); | 1274 metrics->Stop(); |
1278 | 1275 |
1279 // browser_shutdown takes care of deleting browser_process, so we need to | 1276 // browser_shutdown takes care of deleting browser_process, so we need to |
1280 // release it. | 1277 // release it. |
1281 ignore_result(browser_process.release()); | 1278 ignore_result(browser_process.release()); |
1282 browser_shutdown::Shutdown(); | 1279 browser_shutdown::Shutdown(); |
1283 | 1280 |
1284 return result_code; | 1281 return result_code; |
1285 } | 1282 } |
OLD | NEW |