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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 /** | 319 /** |
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 | |
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. | |
337 */ | |
338 cr.isViews = typeof chrome.getVariableValue == 'function' && | |
339 /views/.test(chrome.getVariableValue('toolkit')); | |
340 } | 328 } |
341 | 329 |
342 return { | 330 return { |
343 addSingletonGetter: addSingletonGetter, | 331 addSingletonGetter: addSingletonGetter, |
344 createUid: createUid, | 332 createUid: createUid, |
345 define: define, | 333 define: define, |
346 defineProperty: defineProperty, | 334 defineProperty: defineProperty, |
347 dispatchPropertyChange: dispatchPropertyChange, | 335 dispatchPropertyChange: dispatchPropertyChange, |
348 dispatchSimpleEvent: dispatchSimpleEvent, | 336 dispatchSimpleEvent: dispatchSimpleEvent, |
349 getUid: getUid, | 337 getUid: getUid, |
350 initialize: initialize, | 338 initialize: initialize, |
351 PropertyKind: PropertyKind | 339 PropertyKind: PropertyKind |
352 }; | 340 }; |
353 })(); | 341 })(); |
354 | 342 |
355 | 343 |
356 /** | 344 /** |
357 * TODO(kgr): Move this to another file which is to be loaded last. | 345 * 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. | 346 * This will be done as part of future work to make this code pre-compilable. |
359 */ | 347 */ |
360 cr.initialize(); | 348 cr.initialize(); |
OLD | NEW |