| 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" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 #endif // defined(ENABLE_THEMES) | 171 #endif // defined(ENABLE_THEMES) |
| 172 | 172 |
| 173 return std::string(); | 173 return std::string(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 // It's acutally OK to call this method on any thread, but it's currently placed | 176 // It's acutally OK to call this method on any thread, but it's currently placed |
| 177 // in UIThreadSearchTermsData since SearchTermsData cannot depend on | 177 // in UIThreadSearchTermsData since SearchTermsData cannot depend on |
| 178 // VersionInfo. | 178 // VersionInfo. |
| 179 std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { | 179 std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { |
| 180 chrome::VersionInfo version_info; | 180 chrome::VersionInfo version_info; |
| 181 if (version_info.is_valid()) { | 181 std::string version(version_info.Name() + " " + version_info.Version()); |
| 182 std::string version(version_info.Name() + " " + version_info.Version()); | 182 if (version_info.IsOfficialBuild()) |
| 183 if (version_info.IsOfficialBuild()) | 183 version += " (Official)"; |
| 184 version += " (Official)"; | 184 version += " " + version_info.OSType(); |
| 185 version += " " + version_info.OSType(); | 185 std::string modifier(version_info.GetVersionStringModifier()); |
| 186 std::string modifier(version_info.GetVersionStringModifier()); | 186 if (!modifier.empty()) |
| 187 if (!modifier.empty()) | 187 version += " " + modifier; |
| 188 version += " " + modifier; | 188 return version; |
| 189 return version; | |
| 190 } | |
| 191 return "unknown"; | |
| 192 } | 189 } |
| 193 | 190 |
| 194 // static | 191 // static |
| 195 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { | 192 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { |
| 196 delete google_base_url_; | 193 delete google_base_url_; |
| 197 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); | 194 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); |
| 198 } | 195 } |
| OLD | NEW |