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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
7 /** @const */ var SettingsDialog = options.SettingsDialog; | 7 /** @const */ var SettingsDialog = options.SettingsDialog; |
8 | 8 |
9 /** | 9 /** |
10 * StartupOverlay class | 10 * StartupOverlay class |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 * based on the whether the 'pages to restore on startup' pref is enabled. | 99 * based on the whether the 'pages to restore on startup' pref is enabled. |
100 */ | 100 */ |
101 updateControlStates: function() { | 101 updateControlStates: function() { |
102 this.setControlsDisabled( | 102 this.setControlsDisabled( |
103 this.startup_pages_pref_.disabled); | 103 this.startup_pages_pref_.disabled); |
104 }, | 104 }, |
105 | 105 |
106 /** | 106 /** |
107 * Handles change events of the preference | 107 * Handles change events of the preference |
108 * 'session.startup_urls'. | 108 * 'session.startup_urls'. |
109 * @param {event} preference changed event. | 109 * @param {event} event Preference changed event. |
Dan Beam
2014/09/06 01:52:56
shouldn't this be Event?
Vitaly Pavlenko
2014/09/06 18:43:10
Done. That was classified as error, that's why I s
| |
110 * @private | 110 * @private |
111 */ | 111 */ |
112 handleStartupPageListChange_: function(event) { | 112 handleStartupPageListChange_: function(event) { |
113 this.startup_pages_pref_.disabled = event.value.disabled; | 113 this.startup_pages_pref_.disabled = event.value.disabled; |
114 this.updateControlStates(); | 114 this.updateControlStates(); |
115 }, | 115 }, |
116 | 116 |
117 /** | 117 /** |
118 * Updates the startup pages list with the given entries. | 118 * Updates the startup pages list with the given entries. |
119 * @param {Array} pages List of startup pages. | 119 * @param {Array} pages List of startup pages. |
(...skipping 12 matching lines...) Expand all Loading... | |
132 * call updateAutocompleteSuggestions_. | 132 * call updateAutocompleteSuggestions_. |
133 * @param {string} query List of autocomplete suggestions. | 133 * @param {string} query List of autocomplete suggestions. |
134 * @private | 134 * @private |
135 */ | 135 */ |
136 requestAutocompleteSuggestions_: function(query) { | 136 requestAutocompleteSuggestions_: function(query) { |
137 chrome.send('requestAutocompleteSuggestionsForStartupPages', [query]); | 137 chrome.send('requestAutocompleteSuggestionsForStartupPages', [query]); |
138 }, | 138 }, |
139 | 139 |
140 /** | 140 /** |
141 * Updates the autocomplete suggestion list with the given entries. | 141 * Updates the autocomplete suggestion list with the given entries. |
142 * @param {Array} pages List of autocomplete suggestions. | 142 * @param {Array} suggestions List of autocomplete suggestions. |
143 * @private | 143 * @private |
144 */ | 144 */ |
145 updateAutocompleteSuggestions_: function(suggestions) { | 145 updateAutocompleteSuggestions_: function(suggestions) { |
146 var list = this.autocompleteList_; | 146 var list = this.autocompleteList_; |
147 // If the trigger for this update was a value being selected from the | 147 // If the trigger for this update was a value being selected from the |
148 // current list, do nothing. | 148 // current list, do nothing. |
149 if (list.targetInput && list.selectedItem && | 149 if (list.targetInput && list.selectedItem && |
150 list.selectedItem.url == list.targetInput.value) { | 150 list.selectedItem.url == list.targetInput.value) { |
151 return; | 151 return; |
152 } | 152 } |
(...skipping 10 matching lines...) Expand all Loading... | |
163 var instance = StartupOverlay.getInstance(); | 163 var instance = StartupOverlay.getInstance(); |
164 return instance[name + '_'].apply(instance, arguments); | 164 return instance[name + '_'].apply(instance, arguments); |
165 }; | 165 }; |
166 }); | 166 }); |
167 | 167 |
168 // Export | 168 // Export |
169 return { | 169 return { |
170 StartupOverlay: StartupOverlay | 170 StartupOverlay: StartupOverlay |
171 }; | 171 }; |
172 }); | 172 }); |
OLD | NEW |