| 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 // Used for observing function of the backend datasource for this page by |
| 6 // tests. |
| 7 var webui_responded_ = false; |
| 8 |
| 5 cr.define('options', function() { | 9 cr.define('options', function() { |
| 6 var OptionsPage = options.OptionsPage; | 10 var OptionsPage = options.OptionsPage; |
| 7 var ExtensionsList = options.ExtensionsList; | 11 var ExtensionsList = options.ExtensionsList; |
| 8 | 12 |
| 9 /** | 13 /** |
| 10 * ExtensionSettings class | 14 * ExtensionSettings class |
| 11 * Encapsulated handling of the 'Manage Extensions' page. | 15 * Encapsulated handling of the 'Manage Extensions' page. |
| 12 * @class | 16 * @class |
| 13 */ | 17 */ |
| 14 function ExtensionSettings() { | 18 function ExtensionSettings() { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 140 |
| 137 chrome.send('extensionSettingsToggleDeveloperMode', []); | 141 chrome.send('extensionSettingsToggleDeveloperMode', []); |
| 138 }, | 142 }, |
| 139 }; | 143 }; |
| 140 | 144 |
| 141 /** | 145 /** |
| 142 * Called by the dom_ui_ to re-populate the page with data representing | 146 * Called by the dom_ui_ to re-populate the page with data representing |
| 143 * the current state of installed extensions. | 147 * the current state of installed extensions. |
| 144 */ | 148 */ |
| 145 ExtensionSettings.returnExtensionsData = function(extensionsData) { | 149 ExtensionSettings.returnExtensionsData = function(extensionsData) { |
| 150 webui_responded_ = true; |
| 151 |
| 146 $('no-extensions').hidden = true; | 152 $('no-extensions').hidden = true; |
| 147 $('suggest-gallery').hidden = true; | 153 $('suggest-gallery').hidden = true; |
| 148 $('get-more-extensions-container').hidden = true; | 154 $('get-more-extensions-container').hidden = true; |
| 149 | 155 |
| 150 if (extensionsData.extensions.length > 0) { | 156 if (extensionsData.extensions.length > 0) { |
| 151 // Enforce order specified in the data or (if equal) then sort by | 157 // Enforce order specified in the data or (if equal) then sort by |
| 152 // extension name (case-insensitive). | 158 // extension name (case-insensitive). |
| 153 extensionsData.extensions.sort(function(a, b) { | 159 extensionsData.extensions.sort(function(a, b) { |
| 154 if (a.order == b.order) { | 160 if (a.order == b.order) { |
| 155 a = a.name.toLowerCase(); | 161 a = a.name.toLowerCase(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 170 | 176 |
| 171 var extensionList = $('extension-settings-list'); | 177 var extensionList = $('extension-settings-list'); |
| 172 ExtensionsList.decorate(extensionList); | 178 ExtensionsList.decorate(extensionList); |
| 173 } | 179 } |
| 174 | 180 |
| 175 // Export | 181 // Export |
| 176 return { | 182 return { |
| 177 ExtensionSettings: ExtensionSettings | 183 ExtensionSettings: ExtensionSettings |
| 178 }; | 184 }; |
| 179 }); | 185 }); |
| OLD | NEW |