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 Page = cr.ui.pageManager.Page; | 6 /** @const */ var Page = cr.ui.pageManager.Page; |
7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 ///////////////////////////////////////////////////////////////////////////// | 10 ///////////////////////////////////////////////////////////////////////////// |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 */ | 225 */ |
226 PasswordManager.removePasswordException = function(rowIndex) { | 226 PasswordManager.removePasswordException = function(rowIndex) { |
227 chrome.send('removePasswordException', [String(rowIndex)]); | 227 chrome.send('removePasswordException', [String(rowIndex)]); |
228 }; | 228 }; |
229 | 229 |
230 PasswordManager.requestShowPassword = function(index) { | 230 PasswordManager.requestShowPassword = function(index) { |
231 chrome.send('requestShowPassword', [index]); | 231 chrome.send('requestShowPassword', [index]); |
232 }; | 232 }; |
233 | 233 |
234 // Forward public APIs to private implementations on the singleton instance. | 234 // Forward public APIs to private implementations on the singleton instance. |
235 [ | 235 cr.makePublic(PasswordManager, [ |
236 'setSavedPasswordsList', | 236 'setSavedPasswordsList', |
237 'setPasswordExceptionsList', | 237 'setPasswordExceptionsList', |
238 'showPassword' | 238 'showPassword' |
239 ].forEach(function(name) { | 239 ]); |
240 PasswordManager[name] = function() { | |
241 var instance = PasswordManager.getInstance(); | |
242 return instance[name + '_'].apply(instance, arguments); | |
243 }; | |
244 }); | |
245 | 240 |
246 // Export | 241 // Export |
247 return { | 242 return { |
248 PasswordManager: PasswordManager | 243 PasswordManager: PasswordManager |
249 }; | 244 }; |
250 | 245 |
251 }); | 246 }); |
OLD | NEW |