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

Side by Side Diff: chrome/browser/search_engines/ui_thread_search_terms_data.cc

Issue 634583003: Simplify VersionInfo code, avoid hitting sandbox IPC constantly on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linux include Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/protocol_manager_helper.cc ('k') | chrome/browser/signin/chrome_signin_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698