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

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: No ChromeSearchTermsData, remove DCHECK, add comment 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 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_;
« 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