Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
| 7 const ArrayDataModel = cr.ui.ArrayDataModel; | 7 const ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 const ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 8 const ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 | 104 |
| 105 /** | 105 /** |
| 106 * Sets the value of the input field to the given string. | 106 * Sets the value of the input field to the given string. |
| 107 * @private | 107 * @private |
| 108 * @param {string} url String value to set the input field to. | 108 * @param {string} url String value to set the input field to. |
| 109 */ | 109 */ |
| 110 setInputFieldValue_: function(url) { | 110 setInputFieldValue_: function(url) { |
| 111 $('addStartupPageURL').value = url; | 111 $('addStartupPageURL').value = url; |
| 112 this.updateAddButtonState_(); | 112 this.updateAddButtonState_(); |
| 113 }, | 113 }, |
| 114 | |
| 115 /** @inheritDoc */ | |
| 116 canShowPage: function() { | |
| 117 return !$('startupAddButton').disabled; | |
|
stuartmorgan
2011/02/12 01:09:06
I'm not wild on using UI state for this. How about
Evan Stade
2011/02/12 03:06:42
There is already such a function, called shouldEna
| |
| 118 }, | |
| 114 }; | 119 }; |
| 115 | 120 |
| 116 AddStartupPageOverlay.updateRecentPageList = function(pages) { | 121 AddStartupPageOverlay.updateRecentPageList = function(pages) { |
| 117 AddStartupPageOverlay.getInstance().updateRecentPageList_(pages); | 122 AddStartupPageOverlay.getInstance().updateRecentPageList_(pages); |
| 118 }; | 123 }; |
| 119 | 124 |
| 120 AddStartupPageOverlay.setInputFieldValue = function(url) { | 125 AddStartupPageOverlay.setInputFieldValue = function(url) { |
| 121 AddStartupPageOverlay.getInstance().setInputFieldValue_(url); | 126 AddStartupPageOverlay.getInstance().setInputFieldValue_(url); |
| 122 }; | 127 }; |
| 123 | 128 |
| 124 // Export | 129 // Export |
| 125 return { | 130 return { |
| 126 AddStartupPageOverlay: AddStartupPageOverlay | 131 AddStartupPageOverlay: AddStartupPageOverlay |
| 127 }; | 132 }; |
| 128 | 133 |
| 129 }); | 134 }); |
| OLD | NEW |