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..56bab00321ed5d313e3a420156dc8c446563d83b 100644 |
--- a/chrome/browser/web_resource/notification_promo.cc |
+++ b/chrome/browser/web_resource/notification_promo.cc |
@@ -24,13 +24,9 @@ |
#include "components/user_prefs/pref_registry_syncable.h" |
#include "content/public/browser/user_metrics.h" |
#include "net/base/url_util.h" |
+#include "ui/base/device_form_factor.h" |
#include "url/gurl.h" |
-#if defined(OS_ANDROID) |
-#include "base/command_line.h" |
-#include "chrome/common/chrome_switches.h" |
-#endif // defined(OS_ANDROID) |
- |
using content::UserMetricsAction; |
namespace { |
@@ -63,8 +59,9 @@ std::string PlatformString() { |
return "win"; |
#elif defined(OS_IOS) |
// TODO(noyau): add iOS-specific implementation |
- const bool isTablet = false; |
- return std::string("ios-") + (isTablet ? "tablet" : "phone"); |
+ DeviceFormFactor form_factor = GetDeviceFormFactor(); |
+ return std::string("ios-") + |
+ (form_factor == DEVICE_FORM_FACTOR_TABLET ? "tablet" : "phone"); |
#elif defined(OS_MACOSX) |
return "mac"; |
#elif defined(OS_CHROMEOS) |
@@ -72,9 +69,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 form_factor = GetDeviceFormFactor(); |
+ return (std::string("android-") + |
+ (form_factor == DEVICE_FORM_FACTOR_TABLET ? "tablet" : "phone")); |
#else |
return "none"; |
#endif |