Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/browser/resources/options/handler_options.js

Issue 7033018: Handler settings page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed errant /* */ Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('options', function() {
6 const OptionsPage = options.OptionsPage;
7
8 /////////////////////////////////////////////////////////////////////////////
9 // HandlerOptions class:
10
11 /**
12 * Encapsulated handling of handler options page.
13 * @constructor
14 */
15 function HandlerOptions() {
16 this.activeNavTab = null;
17 OptionsPage.call(this,
18 'handlers',
19 templateData.handlersPageTabTitle,
20 'handler-options');
21 }
22
23 cr.addSingletonGetter(HandlerOptions);
24
25 HandlerOptions.prototype = {
26 __proto__: OptionsPage.prototype,
27
28 /**
29 * The handlers list.
30 * @type {DeletableItemList}
31 * @private
32 */
33 handlersList_: null,
34
35 /** @inheritDoc */
36 initializePage: function() {
37 OptionsPage.prototype.initializePage.call(this);
38
39 this.createHandlersList_();
40 },
41
42 /**
43 * Creates, decorates and initializes the handlers list.
44 * @private
45 */
46 createHandlersList_: function() {
47 this.handlersList_ = $('handlers-list');
48 options.HandlersList.decorate(this.handlersList_);
49 this.handlersList_.autoExpands = true;
50 },
51 };
52
53 /**
54 * Call to remove a handler.
Evan Stade 2011/05/19 17:08:42 describe what the function does ("Call to remove a
koz (OOO until 15th September) 2011/05/19 21:07:52 Done.
55 * @param rowIndex indicating the row to remove.
56 */
57 HandlerOptions.removeHandler = function(index, handler) {
58 chrome.send('removeHandler', [handler]);
59 };
60
61 HandlerOptions.setDefault = function(handler) {
Evan Stade 2011/05/19 17:08:42 function comment
koz (OOO until 15th September) 2011/05/19 21:07:52 I inilned this function as well.
62 chrome.send('setDefault', [handler]);
63 };
64
65 /**
66 * Sets the list of handlers shown by the view.
67 * @param handlers to be shown in the view.
68 */
69 HandlerOptions.setHandlers = function(handlers) {
70 $('handlers-list').setHandlers(handlers);
71 };
72
73 // Export
74 return {
75 HandlerOptions: HandlerOptions
76 };
77
78 });
79
Evan Stade 2011/05/19 17:08:42 remove excess newline
koz (OOO until 15th September) 2011/05/19 21:07:52 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698