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 e3b29f1ea0f64c504d0e775af6d37e9a7f17e76c..0b0e32a460eb68a4c148da1854ce74c88dd5c0ee 100644 |
--- a/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
+++ b/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
@@ -17,6 +17,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 "components/google/core/browser/google_util.h" |
#include "content/public/browser/browser_thread.h" |
@@ -146,6 +147,24 @@ std::string UIThreadSearchTermsData::NTPIsThemedParam() const { |
return std::string(); |
} |
+// It's acutally OK to call this method on any thread, but it's currently 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_; |