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

Unified Diff: chrome/browser/search_engines/ui_thread_search_terms_data.cc

Issue 594643003: Device info datatype should be moved to components/sync_driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/sync/glue/device_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f73ba4c67e02e8429afad1fe72f570984a604c74 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,8 @@ 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";
#else
return chrome::IsInstantExtendedAPIEnabled() ? "chrome-omni" : "chrome";
#endif
@@ -116,9 +113,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";
}
« no previous file with comments | « no previous file | chrome/browser/sync/glue/device_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698