summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 19:53:38 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 19:53:38 +0000
commit6d87f0e61c2b6f1a1ce9bea468b910a0ddb9ebc2 (patch)
tree8a26111e25c0ee393af62ad8fc1252921d28a03e /chrome/browser
parent4d4bb12bad913e95bac1b285fdc4f3e405caef71 (diff)
downloadchromium_src-6d87f0e61c2b6f1a1ce9bea468b910a0ddb9ebc2.zip
chromium_src-6d87f0e61c2b6f1a1ce9bea468b910a0ddb9ebc2.tar.gz
chromium_src-6d87f0e61c2b6f1a1ce9bea468b910a0ddb9ebc2.tar.bz2
WebUI: Use the TOOLKIT_VIEWS define to determine the value of isViews.
This sets isViews correctly for non-Windows, non-CrOS Views builds. Fixes test failures from the previous commit which was reverted. BUG=none TEST=none Review URL: http://codereview.chromium.org/8114027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103966 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/resources/shared/js/cr.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/resources/shared/js/cr.js b/chrome/browser/resources/shared/js/cr.js
index 366f038..2a370a1 100644
--- a/chrome/browser/resources/shared/js/cr.js
+++ b/chrome/browser/resources/shared/js/cr.js
@@ -35,10 +35,16 @@ const cr = (function() {
const isLinux = /Linux/.test(navigator.userAgent);
/**
+ * Whether this uses GTK or not.
+ * @type {boolean}
+ */
+ const isGTK = /GTK/.test(chrome.toolkit);
+
+ /**
* Whether this uses the views toolkit or not.
* @type {boolean}
*/
- const isViews = isWindows || isChromeOS;
+ const isViews = /views/.test(chrome.toolkit);
/**
* Sets the os and toolkit attributes in the <html> element so that platform
@@ -51,10 +57,10 @@ const cr = (function() {
doc.documentElement.setAttribute('os', 'windows');
if (isChromeOS)
doc.documentElement.setAttribute('os', 'chromeos');
- if (isLinux) {
+ if (isLinux)
doc.documentElement.setAttribute('os', 'linux');
+ if (isGTK)
doc.documentElement.setAttribute('toolkit', 'gtk');
- }
if (isViews)
doc.documentElement.setAttribute('toolkit', 'views');
}