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 * @fileoverview Base class for dialogs that require saving preferences on | 6 * @fileoverview Base class for dialogs that require saving preferences on |
7 * confirm and resetting preference inputs on cancel. | 7 * confirm and resetting preference inputs on cancel. |
8 */ | 8 */ |
9 | 9 |
10 cr.define('options', function() { | 10 cr.define('options', function() { |
11 /** @const */ var Page = cr.ui.pageManager.Page; | 11 /** @const */ var Page = cr.ui.pageManager.Page; |
12 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 12 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
13 | 13 |
14 /** | 14 /** |
15 * Base class for settings dialogs. | 15 * Base class for settings dialogs. |
16 * @constructor | 16 * @constructor |
17 * @param {string} name See Page constructor. | 17 * @param {string} name See Page constructor. |
18 * @param {string} title See Page constructor. | 18 * @param {string} title See Page constructor. |
19 * @param {string} pageDivName See Page constructor. | 19 * @param {string} pageDivName See Page constructor. |
20 * @param {HTMLInputElement} okButton The confirmation button element. | 20 * @param {HTMLInputElement} okButton The confirmation button element. |
21 * @param {HTMLInputElement} cancelButton The cancellation button element. | 21 * @param {HTMLInputElement} cancelButton The cancellation button element. |
22 * @extends {Page} | 22 * @extends {cr.ui.pageManager.Page} |
23 */ | 23 */ |
24 function SettingsDialog(name, title, pageDivName, okButton, cancelButton) { | 24 function SettingsDialog(name, title, pageDivName, okButton, cancelButton) { |
25 Page.call(this, name, title, pageDivName); | 25 Page.call(this, name, title, pageDivName); |
26 this.okButton = okButton; | 26 this.okButton = okButton; |
27 this.cancelButton = cancelButton; | 27 this.cancelButton = cancelButton; |
28 } | 28 } |
29 | 29 |
30 SettingsDialog.prototype = { | 30 SettingsDialog.prototype = { |
31 __proto__: Page.prototype, | 31 __proto__: Page.prototype, |
32 | 32 |
(...skipping 29 matching lines...) Expand all Loading... |
62 if (els[i].pref) | 62 if (els[i].pref) |
63 prefs.rollbackPref(els[i].pref); | 63 prefs.rollbackPref(els[i].pref); |
64 } | 64 } |
65 }, | 65 }, |
66 }; | 66 }; |
67 | 67 |
68 return { | 68 return { |
69 SettingsDialog: SettingsDialog | 69 SettingsDialog: SettingsDialog |
70 }; | 70 }; |
71 }); | 71 }); |
OLD | NEW |