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

Unified Diff: chrome/common/form_factor_ios.mm

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: 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/common/form_factor_ios.mm
diff --git a/chrome/common/form_factor_ios.mm b/chrome/common/form_factor_ios.mm
new file mode 100644
index 0000000000000000000000000000000000000000..15f72ca22e48ec19c27fc19dd11a1a5c050c9779
--- /dev/null
+++ b/chrome/common/form_factor_ios.mm
@@ -0,0 +1,11 @@
+// Copyright
+
+#include "form_factor.h"
+
+Study_FormFactor GetFormFactor() {
+ UIUserInterfaceIdiom idiom = [[UIDevice currentDevice] userInterfaceIdiom];
Alexei Svitkine (slow) 2013/10/29 15:26:21 This probably needs some include. You can probably
yao 2013/10/29 19:21:57 Done.
+ if (idiom == UIUserInterfaceIdiomPad) {
+ return Study_FormFactor_TABLET;
+ }
+ return Study_FormFactor_PHONE;
+}
« chrome/common/form_factor_android.cc ('K') | « chrome/common/form_factor_desktop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698