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

Unified Diff: third_party/document_image_extractor/third_party/closure-library/closure/goog/labs/useragent/engine.js

Issue 1138123002: Update third_party/document_image_extractor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: third_party/document_image_extractor/third_party/closure-library/closure/goog/labs/useragent/engine.js
diff --git a/third_party/document_image_extractor/third_party/closure-library/closure/goog/labs/useragent/engine.js b/third_party/document_image_extractor/third_party/closure-library/closure/goog/labs/useragent/engine.js
deleted file mode 100644
index bea9b694da815f86312babdd9f4f88574cffe20f..0000000000000000000000000000000000000000
--- a/third_party/document_image_extractor/third_party/closure-library/closure/goog/labs/useragent/engine.js
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright 2013 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/**
- * @fileoverview Closure user agent detection.
- * @see http://en.wikipedia.org/wiki/User_agent
- * For more information on browser brand, platform, or device see the other
- * sub-namespaces in goog.labs.userAgent (browser, platform, and device).
- *
- */
-
-goog.provide('goog.labs.userAgent.engine');
-
-goog.require('goog.array');
-goog.require('goog.labs.userAgent.util');
-goog.require('goog.string');
-
-
-/**
- * @return {boolean} Whether the rendering engine is Presto.
- */
-goog.labs.userAgent.engine.isPresto = function() {
- return goog.labs.userAgent.util.matchUserAgent('Presto');
-};
-
-
-/**
- * @return {boolean} Whether the rendering engine is Trident.
- */
-goog.labs.userAgent.engine.isTrident = function() {
- // IE only started including the Trident token in IE8.
- return goog.labs.userAgent.util.matchUserAgent('Trident') ||
- goog.labs.userAgent.util.matchUserAgent('MSIE');
-};
-
-
-/**
- * @return {boolean} Whether the rendering engine is Edge.
- */
-goog.labs.userAgent.engine.isEdge = function() {
- return goog.labs.userAgent.util.matchUserAgent('Edge');
-};
-
-
-/**
- * @return {boolean} Whether the rendering engine is WebKit.
- */
-goog.labs.userAgent.engine.isWebKit = function() {
- return goog.labs.userAgent.util.matchUserAgentIgnoreCase('WebKit') &&
- !goog.labs.userAgent.engine.isEdge();
-};
-
-
-/**
- * @return {boolean} Whether the rendering engine is Gecko.
- */
-goog.labs.userAgent.engine.isGecko = function() {
- return goog.labs.userAgent.util.matchUserAgent('Gecko') &&
- !goog.labs.userAgent.engine.isWebKit() &&
- !goog.labs.userAgent.engine.isTrident() &&
- !goog.labs.userAgent.engine.isEdge();
-};
-
-
-/**
- * @return {string} The rendering engine's version or empty string if version
- * can't be determined.
- */
-goog.labs.userAgent.engine.getVersion = function() {
- var userAgentString = goog.labs.userAgent.util.getUserAgent();
- if (userAgentString) {
- var tuples = goog.labs.userAgent.util.extractVersionTuples(
- userAgentString);
-
- var engineTuple = goog.labs.userAgent.engine.getEngineTuple_(tuples);
- if (engineTuple) {
- // In Gecko, the version string is either in the browser info or the
- // Firefox version. See Gecko user agent string reference:
- // http://goo.gl/mULqa
- if (engineTuple[0] == 'Gecko') {
- return goog.labs.userAgent.engine.getVersionForKey_(
- tuples, 'Firefox');
- }
-
- return engineTuple[1];
- }
-
- // MSIE has only one version identifier, and the Trident version is
- // specified in the parenthetical. IE Edge is covered in the engine tuple
- // detection.
- var browserTuple = tuples[0];
- var info;
- if (browserTuple && (info = browserTuple[2])) {
- var match = /Trident\/([^\s;]+)/.exec(info);
- if (match) {
- return match[1];
- }
- }
- }
- return '';
-};
-
-
-/**
- * @param {!Array.<!Array.<string>>} tuples Extracted version tuples.
- * @return {!Array.<string>|undefined} The engine tuple or undefined if not
- * found.
- * @private
- */
-goog.labs.userAgent.engine.getEngineTuple_ = function(tuples) {
- if (!goog.labs.userAgent.engine.isEdge()) {
- return tuples[1];
- }
- for (var i = 0; i < tuples.length; i++) {
- var tuple = tuples[i];
- if (tuple[0] == 'Edge') {
- return tuple;
- }
- }
-};
-
-
-/**
- * @param {string|number} version The version to check.
- * @return {boolean} Whether the rendering engine version is higher or the same
- * as the given version.
- */
-goog.labs.userAgent.engine.isVersionOrHigher = function(version) {
- return goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),
- version) >= 0;
-};
-
-
-/**
- * @param {!Array<!Array<string>>} tuples Version tuples.
- * @param {string} key The key to look for.
- * @return {string} The version string of the given key, if present.
- * Otherwise, the empty string.
- * @private
- */
-goog.labs.userAgent.engine.getVersionForKey_ = function(tuples, key) {
- // TODO(nnaze): Move to util if useful elsewhere.
-
- var pair = goog.array.find(tuples, function(pair) {
- return key == pair[0];
- });
-
- return pair && pair[1] || '';
-};

Powered by Google App Engine
This is Rietveld 408576698