Chromium Code Reviews| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 cr.isChromeOS = /CrOS/.test(navigator.userAgent); | 344 cr.isChromeOS = /CrOS/.test(navigator.userAgent); |
| 345 | 345 |
| 346 /** | 346 /** |
| 347 * Whether this is on vanilla Linux (not chromeOS). | 347 * Whether this is on vanilla Linux (not chromeOS). |
| 348 */ | 348 */ |
| 349 cr.isLinux = /Linux/.test(navigator.userAgent); | 349 cr.isLinux = /Linux/.test(navigator.userAgent); |
| 350 | 350 |
| 351 /** | 351 /** |
| 352 * Whether this uses GTK or not. | 352 * Whether this uses GTK or not. |
| 353 */ | 353 */ |
| 354 cr.isGTK = typeof chrome.getVariableValue == 'function' && | 354 cr.isGTK = typeof chrome !== 'undefined' && |
|
Ty Overby
2013/09/09 17:45:55
The reason for this check is that inside of a webu
scherkus (not reviewing)
2013/09/09 17:48:28
To elaborate, content-based browsers (e.g., conten
arv (Not doing code reviews)
2013/09/09 18:02:19
Please add chrome to your test instead.
Charlie Reis
2013/09/09 18:02:22
Can these thoughts be added as a comment in the co
Ty Overby
2013/09/09 18:28:13
See my comment in reply to your comment in main.js
| |
| 355 typeof chrome.getVariableValue == 'function' && | |
| 355 /GTK/.test(chrome.getVariableValue('toolkit')); | 356 /GTK/.test(chrome.getVariableValue('toolkit')); |
| 356 | 357 |
| 357 /** | 358 /** |
| 358 * Whether this uses the views toolkit or not. | 359 * Whether this uses the views toolkit or not. |
| 359 */ | 360 */ |
| 360 cr.isViews = typeof chrome.getVariableValue == 'function' && | 361 cr.isViews = typeof chrome !== 'undefined' && |
| 362 typeof chrome.getVariableValue == 'function' && | |
| 361 /views/.test(chrome.getVariableValue('toolkit')); | 363 /views/.test(chrome.getVariableValue('toolkit')); |
| 362 } | 364 } |
| 363 | 365 |
| 364 return { | 366 return { |
| 365 addSingletonGetter: addSingletonGetter, | 367 addSingletonGetter: addSingletonGetter, |
| 366 createUid: createUid, | 368 createUid: createUid, |
| 367 define: define, | 369 define: define, |
| 368 defineProperty: defineProperty, | 370 defineProperty: defineProperty, |
| 369 dispatchPropertyChange: dispatchPropertyChange, | 371 dispatchPropertyChange: dispatchPropertyChange, |
| 370 dispatchSimpleEvent: dispatchSimpleEvent, | 372 dispatchSimpleEvent: dispatchSimpleEvent, |
| 371 Event: Event, | 373 Event: Event, |
| 372 getUid: getUid, | 374 getUid: getUid, |
| 373 initialize: initialize, | 375 initialize: initialize, |
| 374 PropertyKind: PropertyKind | 376 PropertyKind: PropertyKind |
| 375 }; | 377 }; |
| 376 })(); | 378 })(); |
| 377 | 379 |
| 378 | 380 |
| 379 /** | 381 /** |
| 380 * TODO(kgr): Move this to another file which is to be loaded last. | 382 * TODO(kgr): Move this to another file which is to be loaded last. |
| 381 * This will be done as part of future work to make this code pre-compilable. | 383 * This will be done as part of future work to make this code pre-compilable. |
| 382 */ | 384 */ |
| 383 cr.initialize(); | 385 cr.initialize(); |
| OLD | NEW |