OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // Redefine '$' here rather than including 'cr.js', since this is | 5 // Redefine '$' here rather than including 'cr.js', since this is |
6 // the only function needed. This allows this file to be loaded | 6 // the only function needed. This allows this file to be loaded |
7 // in a browser directly for layout and some testing purposes. | 7 // in a browser directly for layout and some testing purposes. |
8 var $ = function(id) { return document.getElementById(id); }; | 8 var $ = function(id) { return document.getElementById(id); }; |
9 | 9 |
10 /** | 10 /** |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 ]; | 454 ]; |
455 | 455 |
456 return new GeneralConfig(FLING_TITLE, FLING_PREFIX, FLING_FIELDS); | 456 return new GeneralConfig(FLING_TITLE, FLING_PREFIX, FLING_FIELDS); |
457 } | 457 } |
458 | 458 |
459 | 459 |
460 /** | 460 /** |
461 * WebUI instance for configuring gesture.* and overscroll.* preference values | 461 * WebUI instance for configuring gesture.* and overscroll.* preference values |
462 * used by Chrome's gesture recognition system. | 462 * used by Chrome's gesture recognition system. |
463 */ | 463 */ |
464 var gesture_config = (function() { | 464 var gesture_config = { |
465 | |
466 /** | 465 /** |
467 * Build and initialize the gesture configuration form. | 466 * Build and initialize the gesture configuration form. |
468 */ | 467 */ |
469 function initialize() { | 468 initialize: function() { |
470 var g = GestureConfig(); | 469 var g = GestureConfig(); |
471 g.buildAll(); | 470 g.buildAll(); |
472 | 471 |
473 var o = OverscrollConfig(); | 472 var o = OverscrollConfig(); |
474 o.buildAll(); | 473 o.buildAll(); |
475 | 474 |
476 var f = FlingConfig(); | 475 var f = FlingConfig(); |
477 f.buildAll(); | 476 f.buildAll(); |
478 | 477 |
479 var c = WorkspaceCyclerConfig(); | 478 var c = WorkspaceCyclerConfig(); |
480 c.buildAll(); | 479 c.buildAll(); |
481 | 480 |
482 $('reset-button').onclick = function() { | 481 $('reset-button').onclick = function() { |
483 g.onReset(); | 482 g.onReset(); |
484 o.onReset(); | 483 o.onReset(); |
485 f.onReset(); | 484 f.onReset(); |
486 c.onReset(); | 485 c.onReset(); |
487 }; | 486 }; |
488 } | 487 }, |
489 | 488 |
490 /** | 489 /** |
491 * Handle callback from call to getPreferenceValue. | 490 * Handle callback from call to getPreferenceValue. |
492 * @param {string} prefName The name of the requested preference value. | 491 * @param {string} prefName The name of the requested preference value. |
493 * @param {value} value The current value associated with prefName. | 492 * @param {value} value The current value associated with prefName. |
494 */ | 493 */ |
495 function getPreferenceValueResult(prefName, value) { | 494 getPreferenceValueResult: function(prefName, value) { |
496 prefName = prefName.substring(prefName.indexOf('.') + 1); | 495 prefName = prefName.substring(prefName.indexOf('.') + 1); |
497 $(prefName).value = value; | 496 $(prefName).value = value; |
498 } | 497 }, |
499 | 498 }; |
500 return { | |
501 initialize: initialize, | |
502 getPreferenceValueResult: getPreferenceValueResult | |
503 }; | |
504 })(); | |
505 | 499 |
506 document.addEventListener('DOMContentLoaded', gesture_config.initialize); | 500 document.addEventListener('DOMContentLoaded', gesture_config.initialize); |
OLD | NEW |