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

Unified Diff: chrome/browser/web_resource/notification_promo.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/web_resource/notification_promo.cc
diff --git a/chrome/browser/web_resource/notification_promo.cc b/chrome/browser/web_resource/notification_promo.cc
index 101643f7817cdee1906bcc8cd6bcee0746b4dc10..bbf36377614c8ee2f03308a0a3ba0859714f9023 100644
--- a/chrome/browser/web_resource/notification_promo.cc
+++ b/chrome/browser/web_resource/notification_promo.cc
@@ -27,8 +27,7 @@
#include "url/gurl.h"
#if defined(OS_ANDROID)
Alexei Svitkine (slow) 2013/10/31 14:52:32 Same comment as for device_info.cc.
yao 2013/11/01 14:37:59 Done.
-#include "base/command_line.h"
-#include "chrome/common/chrome_switches.h"
+#include "chrome/common/device_form_factor.h"
#endif // defined(OS_ANDROID)
using content::UserMetricsAction;
@@ -72,9 +71,9 @@ std::string PlatformString() {
#elif defined(OS_LINUX)
return "linux";
#elif defined(OS_ANDROID)
- const bool isTablet =
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI);
- return std::string("android-") + (isTablet ? "tablet" : "phone");
+ DeviceFormFactor device = GetDeviceFormFactor();
Alexei Svitkine (slow) 2013/10/31 14:52:32 Nit: remove to |form_factor|.
yao 2013/11/01 14:37:59 Done.
+ return (std::string("android-") +
+ (device == DEVICE_FORM_FACTOR_TABLET? "tablet" : "phone"));
Alexei Svitkine (slow) 2013/10/31 14:52:32 Nit: Space before ?
yao 2013/11/01 14:37:59 Done.
#else
return "none";
#endif

Powered by Google App Engine
This is Rietveld 408576698