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" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 #endif | 159 #endif |
160 } | 160 } |
161 | 161 |
162 std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { | 162 std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { |
163 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || | 163 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || |
164 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 164 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
165 #if defined(OS_ANDROID) | 165 #if defined(OS_ANDROID) |
166 sync_pb::SyncEnums::DeviceType device_type = | 166 sync_pb::SyncEnums::DeviceType device_type = |
167 browser_sync::DeviceInfo::GetLocalDeviceType(); | 167 browser_sync::DeviceInfo::GetLocalDeviceType(); |
168 if (device_type == sync_pb::SyncEnums_DeviceType_TYPE_PHONE) { | 168 if (device_type == sync_pb::SyncEnums_DeviceType_TYPE_PHONE) { |
169 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 169 if (CommandLine::ForCurrentProcess()->HasSwitch( |
170 switches::kEnableAnswersInSuggest)) { | 170 switches::kEnableAnswersInSuggest)) { |
171 return "chrome-mobile-ext-ansg"; | 171 return "chrome-mobile-ext-ansg"; |
172 } else { | 172 } else { |
173 return "chrome-mobile-ext"; | 173 return "chrome-mobile-ext"; |
174 } | 174 } |
175 } | 175 } |
176 return "chrome-ext"; | 176 return "chrome-ext"; |
177 #else | 177 #else |
178 return "chrome-ext"; | 178 return "chrome-ext"; |
179 #endif | 179 #endif |
(...skipping 16 matching lines...) Expand all Loading... |
196 #endif // defined(ENABLE_THEMES) | 196 #endif // defined(ENABLE_THEMES) |
197 | 197 |
198 return std::string(); | 198 return std::string(); |
199 } | 199 } |
200 | 200 |
201 // static | 201 // static |
202 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { | 202 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { |
203 delete google_base_url_; | 203 delete google_base_url_; |
204 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); | 204 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); |
205 } | 205 } |
OLD | NEW |