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

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: Applied form factor API to other files Created 7 years, 2 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
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..56590f6fb6e8899cd0a3b00661e1bc6353ec18db 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
@@ -14,6 +14,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
+#include "chrome/common/device_form_factor.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
@@ -132,7 +133,7 @@ void NTPResourceCache::CreateNewTabHTML() {
GetRawDataResource(IDR_NEW_TAB_ANDROID_HTML));
localized_strings.SetString(
"device",
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI) ?
+ GetDeviceFormFactor() == DEVICE_FORM_FACTOR_TABLET ?
"tablet" : "phone");
bool bookmark_shortcuts_allowed = false;

Powered by Google App Engine
This is Rietveld 408576698