summaryrefslogtreecommitdiff
path: root/assets/viz/2/goog/useragent/useragent.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/viz/2/goog/useragent/useragent.js')
-rw-r--r--assets/viz/2/goog/useragent/useragent.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/assets/viz/2/goog/useragent/useragent.js b/assets/viz/2/goog/useragent/useragent.js
index 1ab49c4..6fc5ff1 100644
--- a/assets/viz/2/goog/useragent/useragent.js
+++ b/assets/viz/2/goog/useragent/useragent.js
@@ -27,6 +27,7 @@ goog.require('goog.labs.userAgent.browser');
goog.require('goog.labs.userAgent.engine');
goog.require('goog.labs.userAgent.platform');
goog.require('goog.labs.userAgent.util');
+goog.require('goog.reflect');
goog.require('goog.string');
@@ -98,7 +99,7 @@ goog.userAgent.getUserAgentString = function() {
/**
* TODO(nnaze): Change type to "Navigator" and update compilation targets.
- * @return {Object} The native navigator object.
+ * @return {?Object} The native navigator object.
*/
goog.userAgent.getNavigator = function() {
// Need a local navigator reference instead of using the global one,
@@ -385,6 +386,15 @@ goog.userAgent.IPOD = goog.userAgent.PLATFORM_KNOWN_ ?
/**
+ * Whether the user agent is running on iOS.
+ * @type {boolean}
+ */
+goog.userAgent.IOS = goog.userAgent.PLATFORM_KNOWN_ ?
+ (goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD ||
+ goog.userAgent.ASSUME_IPOD) :
+ goog.labs.userAgent.platform.isIos();
+
+/**
* @return {string} The string that describes the version number of the user
* agent.
* @private
@@ -508,9 +518,11 @@ goog.userAgent.isVersionOrHigherCache_ = {};
*/
goog.userAgent.isVersionOrHigher = function(version) {
return goog.userAgent.ASSUME_ANY_VERSION ||
- goog.userAgent.isVersionOrHigherCache_[version] ||
- (goog.userAgent.isVersionOrHigherCache_[version] =
- goog.string.compareVersions(goog.userAgent.VERSION, version) >= 0);
+ goog.reflect.cache(
+ goog.userAgent.isVersionOrHigherCache_, version, function() {
+ return goog.string.compareVersions(
+ goog.userAgent.VERSION, version) >= 0;
+ });
};