| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/search_engines/ui_thread_search_terms_data.h" | 5 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/google/google_brand.h" | 12 #include "chrome/browser/google/google_brand.h" |
| 13 #include "chrome/browser/google/google_url_tracker_factory.h" | 13 #include "chrome/browser/google/google_url_tracker_factory.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/search/instant_service.h" | 15 #include "chrome/browser/search/instant_service.h" |
| 16 #include "chrome/browser/search/instant_service_factory.h" | 16 #include "chrome/browser/search/instant_service_factory.h" |
| 17 #include "chrome/browser/search/search.h" | 17 #include "chrome/browser/search/search.h" |
| 18 #include "chrome/browser/themes/theme_service.h" | |
| 19 #include "chrome/browser/themes/theme_service_factory.h" | |
| 20 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
| 22 #include "components/google/core/browser/google_url_tracker.h" | 20 #include "components/google/core/browser/google_url_tracker.h" |
| 23 #include "components/google/core/browser/google_util.h" | 21 #include "components/google/core/browser/google_util.h" |
| 24 #include "components/omnibox/omnibox_field_trial.h" | 22 #include "components/omnibox/omnibox_field_trial.h" |
| 25 #include "components/search/search.h" | 23 #include "components/search/search.h" |
| 26 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 27 #include "ui/base/device_form_factor.h" | 25 #include "ui/base/device_form_factor.h" |
| 28 #include "url/gurl.h" | 26 #include "url/gurl.h" |
| 29 | 27 |
| 30 #if defined(ENABLE_RLZ) | 28 #if defined(ENABLE_RLZ) |
| 31 #include "chrome/browser/rlz/rlz.h" | 29 #include "chrome/browser/rlz/rlz.h" |
| 32 #endif | 30 #endif |
| 33 | 31 |
| 32 #if defined(ENABLE_THEMES) |
| 33 #include "chrome/browser/themes/theme_service.h" |
| 34 #include "chrome/browser/themes/theme_service_factory.h" |
| 35 #endif |
| 36 |
| 34 using content::BrowserThread; | 37 using content::BrowserThread; |
| 35 | 38 |
| 36 // static | 39 // static |
| 37 std::string* UIThreadSearchTermsData::google_base_url_ = NULL; | 40 std::string* UIThreadSearchTermsData::google_base_url_ = NULL; |
| 38 | 41 |
| 39 UIThreadSearchTermsData::UIThreadSearchTermsData(Profile* profile) | 42 UIThreadSearchTermsData::UIThreadSearchTermsData(Profile* profile) |
| 40 : profile_(profile) { | 43 : profile_(profile) { |
| 41 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || | 44 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || |
| 42 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 45 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 43 } | 46 } |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 if (!modifier.empty()) | 189 if (!modifier.empty()) |
| 187 version += " " + modifier; | 190 version += " " + modifier; |
| 188 return version; | 191 return version; |
| 189 } | 192 } |
| 190 | 193 |
| 191 // static | 194 // static |
| 192 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { | 195 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { |
| 193 delete google_base_url_; | 196 delete google_base_url_; |
| 194 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); | 197 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); |
| 195 } | 198 } |
| OLD | NEW |