OLD | NEW |
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_url_tracker.h" | 12 #include "chrome/browser/google/google_url_tracker.h" |
13 #include "chrome/browser/google/google_util.h" | 13 #include "chrome/browser/google/google_util.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/search/search.h" | 15 #include "chrome/browser/search/search.h" |
16 #include "chrome/browser/sync/glue/device_info.h" | 16 #include "chrome/browser/sync/glue/device_info.h" |
17 #include "chrome/browser/themes/theme_service.h" | 17 #include "chrome/browser/themes/theme_service.h" |
18 #include "chrome/browser/themes/theme_service_factory.h" | 18 #include "chrome/browser/themes/theme_service_factory.h" |
19 #include "chrome/common/chrome_switches.h" | |
20 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
21 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
22 #include "sync/protocol/sync.pb.h" | 21 #include "sync/protocol/sync.pb.h" |
23 #include "url/gurl.h" | 22 #include "url/gurl.h" |
24 | 23 |
25 #if defined(ENABLE_RLZ) | 24 #if defined(ENABLE_RLZ) |
26 #include "chrome/browser/rlz/rlz.h" | 25 #include "chrome/browser/rlz/rlz.h" |
27 #endif | 26 #endif |
28 | 27 |
29 using content::BrowserThread; | 28 using content::BrowserThread; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 #endif | 158 #endif |
160 } | 159 } |
161 | 160 |
162 std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { | 161 std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { |
163 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || | 162 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || |
164 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 163 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
165 #if defined(OS_ANDROID) | 164 #if defined(OS_ANDROID) |
166 sync_pb::SyncEnums::DeviceType device_type = | 165 sync_pb::SyncEnums::DeviceType device_type = |
167 browser_sync::DeviceInfo::GetLocalDeviceType(); | 166 browser_sync::DeviceInfo::GetLocalDeviceType(); |
168 if (device_type == sync_pb::SyncEnums_DeviceType_TYPE_PHONE) { | 167 if (device_type == sync_pb::SyncEnums_DeviceType_TYPE_PHONE) { |
169 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 168 if (chrome::IsAnswersInSuggestEnabled()) { |
170 switches::kEnableAnswersInSuggest)) { | |
171 return "chrome-mobile-ext-ansg"; | 169 return "chrome-mobile-ext-ansg"; |
172 } else { | 170 } else { |
173 return "chrome-mobile-ext"; | 171 return "chrome-mobile-ext"; |
174 } | 172 } |
175 } | 173 } |
176 return "chrome-ext"; | 174 return "chrome-ext"; |
177 #else | 175 #else |
178 return "chrome-ext"; | 176 return "chrome-ext"; |
179 #endif | 177 #endif |
180 } | 178 } |
(...skipping 15 matching lines...) Expand all Loading... |
196 #endif // defined(ENABLE_THEMES) | 194 #endif // defined(ENABLE_THEMES) |
197 | 195 |
198 return std::string(); | 196 return std::string(); |
199 } | 197 } |
200 | 198 |
201 // static | 199 // static |
202 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { | 200 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { |
203 delete google_base_url_; | 201 delete google_base_url_; |
204 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); | 202 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); |
205 } | 203 } |
OLD | NEW |