Chromium Code Reviews| Index: chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| diff --git a/chrome/browser/search_engines/ui_thread_search_terms_data.cc b/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| index 2532bee9dab320bc85c983dd7e6dc28b63c26ae5..5e8f4c625dd7b710c61415026337f1e92ec53663 100644 |
| --- a/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| +++ b/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| @@ -18,6 +18,7 @@ |
| #include "chrome/browser/themes/theme_service.h" |
| #include "chrome/browser/themes/theme_service_factory.h" |
| #include "chrome/common/chrome_switches.h" |
| +#include "chrome/common/chrome_version_info.h" |
| #include "chrome/common/pref_names.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "sync/protocol/sync.pb.h" |
| @@ -146,6 +147,24 @@ std::string UIThreadSearchTermsData::NTPIsThemedParam() const { |
| return std::string(); |
| } |
| +// It's acutally OK to call this method on any threads, but it's currently |
|
Peter Kasting
2014/06/20 00:33:03
Nit: threads -> thread
hashimoto
2014/06/20 05:09:28
Done.
|
| +// placed in UIThreadSearchTermsData since SearchTermsData cannot depend on |
| +// VersionInfo. |
| +std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { |
| + chrome::VersionInfo version_info; |
| + if (version_info.is_valid()) { |
| + std::string version(version_info.Name() + " " + version_info.Version()); |
| + if (version_info.IsOfficialBuild()) |
| + version += " (Official)"; |
| + version += " " + version_info.OSType(); |
| + std::string modifier(version_info.GetVersionStringModifier()); |
| + if (!modifier.empty()) |
| + version += " " + modifier; |
| + return version; |
| + } |
| + return "unknown"; |
| +} |
| + |
| // static |
| void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { |
| delete google_base_url_; |