| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // BrowserOptions class | 6 // BrowserOptions class |
| 7 // Encapsulated handling of browser options page. | 7 // Encapsulated handling of browser options page. |
| 8 // | 8 // |
| 9 function BrowserOptions() { | 9 function BrowserOptions() { |
| 10 OptionsPage.call(this, 'browser', templateData.browserPage, 'browserPage'); | 10 OptionsPage.call(this, 'browser', templateData.browserPage, 'browserPage'); |
| 11 } | 11 } |
| 12 | 12 |
| 13 cr.addSingletonGetter(BrowserOptions); | 13 cr.addSingletonGetter(BrowserOptions); |
| 14 | 14 |
| 15 BrowserOptions.prototype = { | 15 BrowserOptions.prototype = { |
| 16 // Inherit BrowserOptions from OptionsPage. | 16 // Inherit BrowserOptions from OptionsPage. |
| 17 __proto__: OptionsPage.prototype, | 17 __proto__: OptionsPage.prototype, |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * Initialize BrowserOptions page. | 20 * Initialize BrowserOptions page. |
| 21 */ | 21 */ |
| 22 initializePage: function() { | 22 initializePage: function() { |
| 23 // Call base class implementation to start preference initialization. | 23 // Call base class implementation to start preference initialization. |
| 24 OptionsPage.prototype.initializePage.call(this); | 24 OptionsPage.prototype.initializePage.call(this); |
| 25 | 25 |
| 26 // Wire up buttons. | 26 // Wire up buttons. |
| 27 $('startupAddButton').onclick = function(event) { | 27 $('startupAddButton').onclick = function(event) { |
| 28 // TODO(stuartmorgan): Spawn add sub-dialog. | 28 OptionsPage.showOverlay('addStartupPageOverlay'); |
| 29 }; | 29 }; |
| 30 $('startupRemoveButton').onclick = function(event) { | 30 $('startupRemoveButton').onclick = function(event) { |
| 31 // TODO(stuartmorgan): Remove selected element(s). | 31 // TODO(stuartmorgan): Remove selected element(s). |
| 32 }; | 32 }; |
| 33 $('startupUseCurrentButton').onclick = function(event) { | 33 $('startupUseCurrentButton').onclick = function(event) { |
| 34 // TODO(stuartmorgan): Add all open tabs (except this one). | 34 // TODO(stuartmorgan): Add all open tabs (except this one). |
| 35 }; | 35 }; |
| 36 $('defaultSearchManageEnginesButton').onclick = function(event) { | 36 $('defaultSearchManageEnginesButton').onclick = function(event) { |
| 37 // TODO(stuartmorgan): Spawn search engine management sub-dialog. | 37 // TODO(stuartmorgan): Spawn search engine management sub-dialog. |
| 38 }; | 38 }; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 BrowserOptions.updateDefaultBrowserState = function(statusString, isDefault) { | 110 BrowserOptions.updateDefaultBrowserState = function(statusString, isDefault) { |
| 111 BrowserOptions.getInstance().updateDefaultBrowserState_(statusString, | 111 BrowserOptions.getInstance().updateDefaultBrowserState_(statusString, |
| 112 isDefault); | 112 isDefault); |
| 113 } | 113 } |
| 114 | 114 |
| 115 BrowserOptions.updateSearchEngines = function(engines, defaultValue) { | 115 BrowserOptions.updateSearchEngines = function(engines, defaultValue) { |
| 116 BrowserOptions.getInstance().updateSearchEngines_(engines, defaultValue); | 116 BrowserOptions.getInstance().updateSearchEngines_(engines, defaultValue); |
| 117 } | 117 } |
| OLD | NEW |