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 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var Page = cr.ui.pageManager.Page; | 7 var Page = cr.ui.pageManager.Page; |
8 var PageManager = cr.ui.pageManager.PageManager; | 8 var PageManager = cr.ui.pageManager.PageManager; |
9 var ArrayDataModel = cr.ui.ArrayDataModel; | 9 var ArrayDataModel = cr.ui.ArrayDataModel; |
10 var RepeatingButton = cr.ui.RepeatingButton; | 10 var RepeatingButton = cr.ui.RepeatingButton; |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 * @return {Object} A profile info object. | 1338 * @return {Object} A profile info object. |
1339 * @private | 1339 * @private |
1340 */ | 1340 */ |
1341 getCurrentProfile_: function() { | 1341 getCurrentProfile_: function() { |
1342 for (var i = 0; i < $('profiles-list').dataModel.length; i++) { | 1342 for (var i = 0; i < $('profiles-list').dataModel.length; i++) { |
1343 var profile = $('profiles-list').dataModel.item(i); | 1343 var profile = $('profiles-list').dataModel.item(i); |
1344 if (profile.isCurrentProfile) | 1344 if (profile.isCurrentProfile) |
1345 return profile; | 1345 return profile; |
1346 } | 1346 } |
1347 | 1347 |
1348 assert(false, | 1348 assertNotReached('There should always be a current profile.'); |
1349 'There should always be a current profile, but none found.'); | |
1350 }, | 1349 }, |
1351 | 1350 |
1352 /** | 1351 /** |
1353 * Propmpts user to confirm deletion of the profile for this browser | 1352 * Propmpts user to confirm deletion of the profile for this browser |
1354 * window. | 1353 * window. |
1355 * @private | 1354 * @private |
1356 */ | 1355 */ |
1357 deleteCurrentProfile_: function() { | 1356 deleteCurrentProfile_: function() { |
1358 ManageProfileOverlay.showDeleteDialog(this.getCurrentProfile_()); | 1357 ManageProfileOverlay.showDeleteDialog(this.getCurrentProfile_()); |
1359 }, | 1358 }, |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1883 BrowserOptions.getLoggedInUsername = function() { | 1882 BrowserOptions.getLoggedInUsername = function() { |
1884 return BrowserOptions.getInstance().username_; | 1883 return BrowserOptions.getInstance().username_; |
1885 }; | 1884 }; |
1886 } | 1885 } |
1887 | 1886 |
1888 // Export | 1887 // Export |
1889 return { | 1888 return { |
1890 BrowserOptions: BrowserOptions | 1889 BrowserOptions: BrowserOptions |
1891 }; | 1890 }; |
1892 }); | 1891 }); |
OLD | NEW |