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

Unified Diff: chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc

Issue 50603005: Add cross-platform API to get the form factor of the device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make functions under namespace ui Created 7 years, 1 month 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
Index: chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc
diff --git a/chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc b/chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc
index 6a1affccfb4ef8e2998b3a9f2911113581d7e612..fec28cfbead7526d9dae225fe5f74686e062f73c 100644
--- a/chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc
+++ b/chrome/browser/ui/webui/ntp/android/ntp_resource_cache_android.cc
@@ -19,6 +19,7 @@
#include "content/public/browser/render_process_host.h"
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
+#include "ui/base/device_form_factor.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/webui/jstemplate_builder.h"
@@ -132,7 +133,7 @@ void NTPResourceCache::CreateNewTabHTML() {
GetRawDataResource(IDR_NEW_TAB_ANDROID_HTML));
localized_strings.SetString(
"device",
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI) ?
+ ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET ?
"tablet" : "phone");
bool bookmark_shortcuts_allowed = false;

Powered by Google App Engine
This is Rietveld 408576698