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

Unified Diff: ui/webui/resources/js/cr.js

Issue 2138183002: [ios] Added cr.isIOS function to use in WebUI pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr.js
diff --git a/ui/webui/resources/js/cr.js b/ui/webui/resources/js/cr.js
index 090cfd94f7d7067fbfeca0ed4e0a44c97294d7a9..cb1726bcddf13c65d6eca1de7b190e7495628c75 100644
--- a/ui/webui/resources/js/cr.js
+++ b/ui/webui/resources/js/cr.js
@@ -476,5 +476,10 @@ var cr = cr || function() {
get isAndroid() {
return /Android/.test(navigator.userAgent);
}
+
+ /** Whether this is on iOS. */
+ get isIOS() {
+ return navigator.platform === 'iPhone' || navigator.platform === 'iPad';
dpapad 2016/07/11 20:45:33 Can we make these comparisons a bit less fragile a
Eugene But (OOO till 7-30) 2016/07/11 21:43:12 Done.
+ }
};
}();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698