OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_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 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1879 // Log the search engine chosen on first run. Do this at shutdown, after any | 1879 // Log the search engine chosen on first run. Do this at shutdown, after any |
1880 // changes are made from the first run bubble link, etc. | 1880 // changes are made from the first run bubble link, etc. |
1881 if (record_search_engine_) { | 1881 if (record_search_engine_) { |
1882 TemplateURLService* url_service = | 1882 TemplateURLService* url_service = |
1883 TemplateURLServiceFactory::GetForProfile(profile_); | 1883 TemplateURLServiceFactory::GetForProfile(profile_); |
1884 const TemplateURL* default_search_engine = | 1884 const TemplateURL* default_search_engine = |
1885 url_service->GetDefaultSearchProvider(); | 1885 url_service->GetDefaultSearchProvider(); |
1886 // The default engine can be NULL if the administrator has disabled | 1886 // The default engine can be NULL if the administrator has disabled |
1887 // default search. | 1887 // default search. |
1888 SearchEngineType search_engine_type = | 1888 SearchEngineType search_engine_type = |
1889 TemplateURLPrepopulateData::GetEngineType(default_search_engine ? | 1889 TemplateURLPrepopulateData::GetEngineType( |
1890 default_search_engine->url() : std::string()); | 1890 (default_search_engine && default_search_engine->url()) ? |
| 1891 default_search_engine->url()->url() : std::string()); |
1891 // Record the search engine chosen. | 1892 // Record the search engine chosen. |
1892 UMA_HISTOGRAM_ENUMERATION("Chrome.SearchSelectExempt", search_engine_type, | 1893 UMA_HISTOGRAM_ENUMERATION("Chrome.SearchSelectExempt", search_engine_type, |
1893 SEARCH_ENGINE_MAX); | 1894 SEARCH_ENGINE_MAX); |
1894 } | 1895 } |
1895 #endif | 1896 #endif |
1896 | 1897 |
1897 // Some tests don't set parameters.ui_task, so they started translate | 1898 // Some tests don't set parameters.ui_task, so they started translate |
1898 // language fetch that was never completed so we need to cleanup here | 1899 // language fetch that was never completed so we need to cleanup here |
1899 // otherwise it will be done by the destructor in a wrong thread. | 1900 // otherwise it will be done by the destructor in a wrong thread. |
1900 if (parameters().ui_task == NULL && translate_manager_ != NULL) | 1901 if (parameters().ui_task == NULL && translate_manager_ != NULL) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1963 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1963 uma_name += "_XP"; | 1964 uma_name += "_XP"; |
1964 | 1965 |
1965 uma_name += "_PreRead_"; | 1966 uma_name += "_PreRead_"; |
1966 uma_name += pre_read_percentage; | 1967 uma_name += pre_read_percentage; |
1967 AddPreReadHistogramTime(uma_name.c_str(), time); | 1968 AddPreReadHistogramTime(uma_name.c_str(), time); |
1968 } | 1969 } |
1969 #endif | 1970 #endif |
1970 #endif | 1971 #endif |
1971 } | 1972 } |
OLD | NEW |