Chromium Code Reviews| Index: chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| diff --git a/chrome/browser/search_engines/ui_thread_search_terms_data.cc b/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| index 9313fe04746c315fdef401ff89b93cbe02e29275..bb24fc07b22e190be30aefabe7e1f6c36873d864 100644 |
| --- a/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| +++ b/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| @@ -15,7 +15,6 @@ |
| #include "chrome/browser/search/instant_service.h" |
| #include "chrome/browser/search/instant_service_factory.h" |
| #include "chrome/browser/search/search.h" |
| -#include "chrome/browser/sync/glue/device_info.h" |
| #include "chrome/browser/themes/theme_service.h" |
| #include "chrome/browser/themes/theme_service_factory.h" |
| #include "chrome/common/chrome_switches.h" |
| @@ -25,7 +24,7 @@ |
| #include "components/omnibox/omnibox_field_trial.h" |
| #include "components/search/search.h" |
| #include "content/public/browser/browser_thread.h" |
| -#include "sync/protocol/sync.pb.h" |
| +#include "ui/base/device_form_factor.h" |
| #include "url/gurl.h" |
| #if defined(ENABLE_RLZ) |
| @@ -103,10 +102,9 @@ std::string UIThreadSearchTermsData::GetSuggestClient() const { |
| DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || |
| BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| #if defined(OS_ANDROID) |
| - sync_pb::SyncEnums::DeviceType device_type = |
| - browser_sync::DeviceInfo::GetLocalDeviceType(); |
| - return device_type == sync_pb::SyncEnums_DeviceType_TYPE_PHONE ? |
| - "chrome" : "chrome-omni"; |
| + return ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_PHONE |
| + ? "chrome" |
| + : "chrome-omni"; |
|
Peter Kasting
2014/09/23 04:06:31
Nit: Please wrap the ?: like the old code did
stanisc
2014/09/23 21:30:32
Done. By the way this formatting was done by runni
|
| #else |
| return chrome::IsInstantExtendedAPIEnabled() ? "chrome-omni" : "chrome"; |
| #endif |
| @@ -116,9 +114,7 @@ std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { |
| DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || |
| BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| #if defined(OS_ANDROID) |
| - sync_pb::SyncEnums::DeviceType device_type = |
| - browser_sync::DeviceInfo::GetLocalDeviceType(); |
| - if (device_type == sync_pb::SyncEnums_DeviceType_TYPE_PHONE) { |
| + if (ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_PHONE) { |
| return OmniboxFieldTrial::EnableAnswersInSuggest() ? |
| "chrome-mobile-ext-ansg" : "chrome-mobile-ext"; |
| } |