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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 /** @const */ var OptionsPage = options.OptionsPage; | 6 /** @const */ var Page = cr.ui.pageManager.Page; |
| 7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
7 | 8 |
8 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
9 // HandlerOptions class: | 10 // HandlerOptions class: |
10 | 11 |
11 /** | 12 /** |
12 * Encapsulated handling of handler options page. | 13 * Encapsulated handling of handler options page. |
13 * @constructor | 14 * @constructor |
14 */ | 15 */ |
15 function HandlerOptions() { | 16 function HandlerOptions() { |
16 this.activeNavTab = null; | 17 this.activeNavTab = null; |
17 OptionsPage.call(this, | 18 Page.call(this, |
18 'handlers', | 19 'handlers', |
19 loadTimeData.getString('handlersPageTabTitle'), | 20 loadTimeData.getString('handlersPageTabTitle'), |
20 'handler-options'); | 21 'handler-options'); |
21 } | 22 } |
22 | 23 |
23 cr.addSingletonGetter(HandlerOptions); | 24 cr.addSingletonGetter(HandlerOptions); |
24 | 25 |
25 HandlerOptions.prototype = { | 26 HandlerOptions.prototype = { |
26 __proto__: OptionsPage.prototype, | 27 __proto__: Page.prototype, |
27 | 28 |
28 /** | 29 /** |
29 * The handlers list. | 30 * The handlers list. |
30 * @type {options.HandlersList} | 31 * @type {options.HandlersList} |
31 * @private | 32 * @private |
32 */ | 33 */ |
33 handlersList_: null, | 34 handlersList_: null, |
34 | 35 |
35 /** @override */ | 36 /** @override */ |
36 initializePage: function() { | 37 initializePage: function() { |
37 OptionsPage.prototype.initializePage.call(this); | 38 Page.prototype.initializePage.call(this); |
38 | 39 |
39 this.createHandlersList_(); | 40 this.createHandlersList_(); |
40 | 41 |
41 $('handler-options-overlay-confirm').onclick = | 42 $('handler-options-overlay-confirm').onclick = |
42 OptionsPage.closeOverlay.bind(OptionsPage); | 43 PageManager.closeOverlay.bind(PageManager); |
43 }, | 44 }, |
44 | 45 |
45 /** | 46 /** |
46 * Creates, decorates and initializes the handlers list. | 47 * Creates, decorates and initializes the handlers list. |
47 * @private | 48 * @private |
48 */ | 49 */ |
49 createHandlersList_: function() { | 50 createHandlersList_: function() { |
50 this.handlersList_ = $('handlers-list'); | 51 this.handlersList_ = $('handlers-list'); |
51 options.HandlersList.decorate(this.handlersList_); | 52 options.HandlersList.decorate(this.handlersList_); |
52 this.handlersList_.autoExpands = true; | 53 this.handlersList_.autoExpands = true; |
(...skipping 18 matching lines...) Expand all Loading... |
71 */ | 72 */ |
72 HandlerOptions.setIgnoredHandlers = function(handlers) { | 73 HandlerOptions.setIgnoredHandlers = function(handlers) { |
73 $('ignored-handlers-section').hidden = handlers.length == 0; | 74 $('ignored-handlers-section').hidden = handlers.length == 0; |
74 $('ignored-handlers-list').setHandlers(handlers); | 75 $('ignored-handlers-list').setHandlers(handlers); |
75 }; | 76 }; |
76 | 77 |
77 return { | 78 return { |
78 HandlerOptions: HandlerOptions | 79 HandlerOptions: HandlerOptions |
79 }; | 80 }; |
80 }); | 81 }); |
OLD | NEW |