| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
| 6 * The global object. | 6 * The global object. |
| 7 * @type {!Object} | 7 * @type {!Object} |
| 8 * @const | 8 * @const |
| 9 */ | 9 */ |
| 10 var global = this; | 10 var global = this; |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 * Whether this is on chromeOS or not. | 320 * Whether this is on chromeOS or not. |
| 321 */ | 321 */ |
| 322 cr.isChromeOS = /CrOS/.test(navigator.userAgent); | 322 cr.isChromeOS = /CrOS/.test(navigator.userAgent); |
| 323 | 323 |
| 324 /** | 324 /** |
| 325 * Whether this is on vanilla Linux (not chromeOS). | 325 * Whether this is on vanilla Linux (not chromeOS). |
| 326 */ | 326 */ |
| 327 cr.isLinux = /Linux/.test(navigator.userAgent); | 327 cr.isLinux = /Linux/.test(navigator.userAgent); |
| 328 | 328 |
| 329 /** | 329 /** |
| 330 * Whether this uses GTK or not. | |
| 331 */ | |
| 332 cr.isGTK = typeof chrome.getVariableValue == 'function' && | |
| 333 /GTK/.test(chrome.getVariableValue('toolkit')); | |
| 334 | |
| 335 /** | |
| 336 * Whether this uses the views toolkit or not. | 330 * Whether this uses the views toolkit or not. |
| 337 */ | 331 */ |
| 338 cr.isViews = typeof chrome.getVariableValue == 'function' && | 332 cr.isViews = typeof chrome.getVariableValue == 'function' && |
| 339 /views/.test(chrome.getVariableValue('toolkit')); | 333 /views/.test(chrome.getVariableValue('toolkit')); |
| 340 } | 334 } |
| 341 | 335 |
| 342 return { | 336 return { |
| 343 addSingletonGetter: addSingletonGetter, | 337 addSingletonGetter: addSingletonGetter, |
| 344 createUid: createUid, | 338 createUid: createUid, |
| 345 define: define, | 339 define: define, |
| 346 defineProperty: defineProperty, | 340 defineProperty: defineProperty, |
| 347 dispatchPropertyChange: dispatchPropertyChange, | 341 dispatchPropertyChange: dispatchPropertyChange, |
| 348 dispatchSimpleEvent: dispatchSimpleEvent, | 342 dispatchSimpleEvent: dispatchSimpleEvent, |
| 349 getUid: getUid, | 343 getUid: getUid, |
| 350 initialize: initialize, | 344 initialize: initialize, |
| 351 PropertyKind: PropertyKind | 345 PropertyKind: PropertyKind |
| 352 }; | 346 }; |
| 353 })(); | 347 })(); |
| 354 | 348 |
| 355 | 349 |
| 356 /** | 350 /** |
| 357 * TODO(kgr): Move this to another file which is to be loaded last. | 351 * TODO(kgr): Move this to another file which is to be loaded last. |
| 358 * This will be done as part of future work to make this code pre-compilable. | 352 * This will be done as part of future work to make this code pre-compilable. |
| 359 */ | 353 */ |
| 360 cr.initialize(); | 354 cr.initialize(); |
| OLD | NEW |