| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 const cr = (function() { | 5 const cr = (function() { |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Whether we are using a Mac or not. | 8 * Whether we are using a Mac or not. |
| 9 * @type {boolean} | 9 * @type {boolean} |
| 10 */ | 10 */ |
| 11 const isMac = /Mac/.test(navigator.platform); | 11 const isMac = /Mac/.test(navigator.platform); |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Whether this is on the Windows platform or not. | 14 * Whether this is on the Windows platform or not. |
| 15 * @type {boolean} | 15 * @type {boolean} |
| 16 */ | 16 */ |
| 17 const isWindows = /Win/.test(navigator.platform); | 17 const isWindows = /Win/.test(navigator.platform); |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * Whether this is on chromeOS or not. | 20 * Whether this is on chromeOS or not. |
| 21 * @type {boolean} | 21 * @type {boolean} |
| 22 */ | 22 */ |
| 23 const isChromeOS = /CrOS/.test(navigator.userAgent); | 23 const isChromeOS = /CrOS/.test(navigator.userAgent); |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * Whether this is on touchui build or not. | |
| 27 * @type {boolean} | |
| 28 */ | |
| 29 const isTouch = /Touch/.test(navigator.userAgent); | |
| 30 | |
| 31 /** | |
| 32 * Whether this is on vanilla Linux (not chromeOS). | 26 * Whether this is on vanilla Linux (not chromeOS). |
| 33 * @type {boolean} | 27 * @type {boolean} |
| 34 */ | 28 */ |
| 35 const isLinux = /Linux/.test(navigator.userAgent); | 29 const isLinux = /Linux/.test(navigator.userAgent); |
| 36 | 30 |
| 37 /** | 31 /** |
| 38 * Whether this uses GTK or not. | 32 * Whether this uses GTK or not. |
| 39 * @type {boolean} | 33 * @type {boolean} |
| 40 */ | 34 */ |
| 41 const isGTK = /GTK/.test(chrome.toolkit); | 35 const isGTK = /GTK/.test(chrome.toolkit); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 }; | 345 }; |
| 352 } | 346 } |
| 353 | 347 |
| 354 return { | 348 return { |
| 355 addSingletonGetter: addSingletonGetter, | 349 addSingletonGetter: addSingletonGetter, |
| 356 isChromeOS: isChromeOS, | 350 isChromeOS: isChromeOS, |
| 357 isMac: isMac, | 351 isMac: isMac, |
| 358 isWindows: isWindows, | 352 isWindows: isWindows, |
| 359 isLinux: isLinux, | 353 isLinux: isLinux, |
| 360 isViews: isViews, | 354 isViews: isViews, |
| 361 isTouch: isTouch, | |
| 362 enablePlatformSpecificCSSRules: enablePlatformSpecificCSSRules, | 355 enablePlatformSpecificCSSRules: enablePlatformSpecificCSSRules, |
| 363 define: define, | 356 define: define, |
| 364 defineProperty: defineProperty, | 357 defineProperty: defineProperty, |
| 365 PropertyKind: PropertyKind, | 358 PropertyKind: PropertyKind, |
| 366 createUid: createUid, | 359 createUid: createUid, |
| 367 getUid: getUid, | 360 getUid: getUid, |
| 368 dispatchSimpleEvent: dispatchSimpleEvent, | 361 dispatchSimpleEvent: dispatchSimpleEvent, |
| 369 dispatchPropertyChange: dispatchPropertyChange, | 362 dispatchPropertyChange: dispatchPropertyChange, |
| 370 | 363 |
| 371 /** | 364 /** |
| 372 * The document that we are currently using. | 365 * The document that we are currently using. |
| 373 * @type {!Document} | 366 * @type {!Document} |
| 374 */ | 367 */ |
| 375 get doc() { | 368 get doc() { |
| 376 return doc; | 369 return doc; |
| 377 }, | 370 }, |
| 378 withDoc: withDoc, | 371 withDoc: withDoc, |
| 379 Event: CrEvent | 372 Event: CrEvent |
| 380 }; | 373 }; |
| 381 })(); | 374 })(); |
| OLD | NEW |