OLD | NEW |
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 117 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
118 #if defined(OS_ANDROID) | 118 #if defined(OS_ANDROID) |
119 sync_pb::SyncEnums::DeviceType device_type = | 119 sync_pb::SyncEnums::DeviceType device_type = |
120 browser_sync::DeviceInfo::GetLocalDeviceType(); | 120 browser_sync::DeviceInfo::GetLocalDeviceType(); |
121 if (device_type == sync_pb::SyncEnums_DeviceType_TYPE_PHONE) { | 121 if (device_type == sync_pb::SyncEnums_DeviceType_TYPE_PHONE) { |
122 return OmniboxFieldTrial::EnableAnswersInSuggest() ? | 122 return OmniboxFieldTrial::EnableAnswersInSuggest() ? |
123 "chrome-mobile-ext-ansg" : "chrome-mobile-ext"; | 123 "chrome-mobile-ext-ansg" : "chrome-mobile-ext"; |
124 } | 124 } |
125 return OmniboxFieldTrial::EnableAnswersInSuggest() ? | 125 return OmniboxFieldTrial::EnableAnswersInSuggest() ? |
126 "chrome-ext-ansg" : "chrome-ext"; | 126 "chrome-ext-ansg" : "chrome-ext"; |
| 127 #elif defined(OS_IOS) |
| 128 return OmniboxFieldTrial::EnableAnswersInSuggest() ? |
| 129 "chrome-ext-ansg" : "chrome-ext"; |
127 #else | 130 #else |
128 return "chrome-ext"; | 131 return "chrome-ext"; |
129 #endif | 132 #endif |
130 } | 133 } |
131 | 134 |
132 bool UIThreadSearchTermsData::EnableAnswersInSuggest() const { | 135 bool UIThreadSearchTermsData::EnableAnswersInSuggest() const { |
133 return OmniboxFieldTrial::EnableAnswersInSuggest(); | 136 return OmniboxFieldTrial::EnableAnswersInSuggest(); |
134 } | 137 } |
135 | 138 |
136 bool UIThreadSearchTermsData::IsShowingSearchTermsOnSearchResultsPages() const { | 139 bool UIThreadSearchTermsData::IsShowingSearchTermsOnSearchResultsPages() const { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 return version; | 194 return version; |
192 } | 195 } |
193 return "unknown"; | 196 return "unknown"; |
194 } | 197 } |
195 | 198 |
196 // static | 199 // static |
197 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { | 200 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { |
198 delete google_base_url_; | 201 delete google_base_url_; |
199 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); |
200 } | 203 } |
OLD | NEW |