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

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

Issue 316963002: Move branding information out of google_util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for Windows 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/search_terms_data.h" 5 #include "chrome/browser/search_engines/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"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/google/google_brand.h"
12 #include "chrome/browser/google/google_profile_helper.h" 13 #include "chrome/browser/google/google_profile_helper.h"
13 #include "chrome/browser/google/google_url_tracker.h" 14 #include "chrome/browser/google/google_url_tracker.h"
14 #include "chrome/browser/google/google_util.h" 15 #include "chrome/browser/google/google_util.h"
15 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/search/search.h" 17 #include "chrome/browser/search/search.h"
17 #include "chrome/browser/sync/glue/device_info.h" 18 #include "chrome/browser/sync/glue/device_info.h"
18 #include "chrome/browser/themes/theme_service.h" 19 #include "chrome/browser/themes/theme_service.h"
19 #include "chrome/browser/themes/theme_service_factory.h" 20 #include "chrome/browser/themes/theme_service_factory.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 #if !defined(OS_ANDROID) 116 #if !defined(OS_ANDROID)
116 base::string16 UIThreadSearchTermsData::GetRlzParameterValue( 117 base::string16 UIThreadSearchTermsData::GetRlzParameterValue(
117 bool from_app_list) const { 118 bool from_app_list) const {
118 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || 119 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) ||
119 BrowserThread::CurrentlyOn(BrowserThread::UI)); 120 BrowserThread::CurrentlyOn(BrowserThread::UI));
120 base::string16 rlz_string; 121 base::string16 rlz_string;
121 #if defined(ENABLE_RLZ) 122 #if defined(ENABLE_RLZ)
122 // For organic brandcodes do not use rlz at all. Empty brandcode usually 123 // For organic brandcodes do not use rlz at all. Empty brandcode usually
123 // means a chromium install. This is ok. 124 // means a chromium install. This is ok.
124 std::string brand; 125 std::string brand;
125 if (google_util::GetBrand(&brand) && !brand.empty() && 126 if (google_brand::GetBrand(&brand) && !brand.empty() &&
126 !google_util::IsOrganic(brand)) { 127 !google_brand::IsOrganic(brand)) {
127 // This call will return false the first time(s) it is called until the 128 // This call will return false the first time(s) it is called until the
128 // value has been cached. This normally would mean that at most one omnibox 129 // value has been cached. This normally would mean that at most one omnibox
129 // search might not send the RLZ data but this is not really a problem. 130 // search might not send the RLZ data but this is not really a problem.
130 rlz_lib::AccessPoint access_point = RLZTracker::ChromeOmnibox(); 131 rlz_lib::AccessPoint access_point = RLZTracker::ChromeOmnibox();
131 #if !defined(OS_IOS) 132 #if !defined(OS_IOS)
132 if (from_app_list) 133 if (from_app_list)
133 access_point = RLZTracker::ChromeAppList(); 134 access_point = RLZTracker::ChromeAppList();
134 #endif 135 #endif
135 RLZTracker::GetAccessPointRlz(access_point, &rlz_string); 136 RLZTracker::GetAccessPointRlz(access_point, &rlz_string);
136 } 137 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 #endif // defined(ENABLE_THEMES) 199 #endif // defined(ENABLE_THEMES)
199 200
200 return std::string(); 201 return std::string();
201 } 202 }
202 203
203 // static 204 // static
204 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { 205 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) {
205 delete google_base_url_; 206 delete google_base_url_;
206 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); 207 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url);
207 } 208 }
OLDNEW
« no previous file with comments | « chrome/browser/rlz/rlz_unittest.cc ('k') | chrome/browser/search_engines/template_url_service_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698