Chromium Code Reviews| Index: chrome/browser/resources/options/handler_options.js |
| diff --git a/chrome/browser/resources/options/handler_options.js b/chrome/browser/resources/options/handler_options.js |
| index df2732ec43e9fdeb0455b718ffc13d0f51becbb0..202133b32e84d4e3d856cf61235a055d2f9a5cbb 100644 |
| --- a/chrome/browser/resources/options/handler_options.js |
| +++ b/chrome/browser/resources/options/handler_options.js |
| @@ -2,6 +2,18 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +/** |
| + * @typedef {{ |
| + * default_handler: number, |
| + * handlers: Array, |
| + * has_policy_recommendations: boolean, |
| + * is_default_handler_set_by_user: boolean, |
| + * protocol: string |
| + * }} |
| + * @see chrome/browser/ui/webui/options/handler_options_handler.cc |
| + */ |
| +var HandlersValue; |
|
Dan Beam
2014/09/11 21:42:48
nit: Handlers
Vitaly Pavlenko
2014/09/11 23:16:50
Done.
|
| + |
| cr.define('options', function() { |
| /** @const */ var Page = cr.ui.pageManager.Page; |
| /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
| @@ -12,6 +24,7 @@ cr.define('options', function() { |
| /** |
| * Encapsulated handling of handler options page. |
| * @constructor |
| + * @extends {cr.ui.pageManager.Page} |
| */ |
| function HandlerOptions() { |
| this.activeNavTab = null; |
| @@ -48,19 +61,22 @@ cr.define('options', function() { |
| * @private |
| */ |
| createHandlersList_: function() { |
| - this.handlersList_ = $('handlers-list'); |
| - options.HandlersList.decorate(this.handlersList_); |
| + var handlersList = $('handlers-list'); |
| + options.HandlersList.decorate(handlersList); |
| + this.handlersList_ = assertInstanceof(handlersList, options.HandlersList); |
| this.handlersList_.autoExpands = true; |
| - this.ignoredHandlersList_ = $('ignored-handlers-list'); |
| - options.IgnoredHandlersList.decorate(this.ignoredHandlersList_); |
| + var ignoredHandlersList = $('ignored-handlers-list'); |
| + options.IgnoredHandlersList.decorate(ignoredHandlersList); |
| + this.ignoredHandlersList_ = assertInstanceof(ignoredHandlersList, |
| + options.HandlersList); |
| this.ignoredHandlersList_.autoExpands = true; |
| }, |
| }; |
| /** |
| * Sets the list of handlers shown by the view. |
| - * @param {Array} handlers Handlers to be shown in the view. |
| + * @param {Array.<HandlersValue>} handlers Handlers to be shown in the view. |
| */ |
| HandlerOptions.setHandlers = function(handlers) { |
| $('handlers-list').setHandlers(handlers); |