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

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: Addressed review comment 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..ab30bf9cc9ae6aed326951eb4e6e750187595f54 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 /(iPhone|iPad)/.test(navigator.platform);
Dan Beam 2016/07/11 21:49:05 why do you need capturing parens? /iPhone|iPad/ s
Dan Beam 2016/07/11 21:50:15 also, do we run on iPod? mine had that in it ;) h
Eugene But (OOO till 7-30) 2016/07/11 22:00:54 Done.
Eugene But (OOO till 7-30) 2016/07/11 22:00:54 Good catch.
+ }
};
}();
« 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