Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Unified Diff: chrome/browser/search_engines/ui_thread_search_terms_data.cc

Issue 345803002: Move GoogleImageSearchSource() from template_url.cc to UIThreadSearchTermsData (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;
« no previous file with comments | « chrome/browser/search_engines/ui_thread_search_terms_data.h ('k') | components/search_engines/search_terms_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698