Index: chrome/browser/resources/options2/browser_options.js |
diff --git a/chrome/browser/resources/options2/browser_options.js b/chrome/browser/resources/options2/browser_options.js |
index 9495aaed659d7a446b5f88a17c6c93a51689cd26..b18647dd8bf8a1488580811a2c86b0081a9e1b2e 100644 |
--- a/chrome/browser/resources/options2/browser_options.js |
+++ b/chrome/browser/resources/options2/browser_options.js |
@@ -237,9 +237,7 @@ cr.define('options', function() { |
chrome.send('createProfile'); |
}; |
$('profiles-manage').onclick = function(event) { |
- var selectedProfile = self.getSelectedProfileItem_(); |
- if (selectedProfile) |
- ManageProfileOverlay.showManageDialog(selectedProfile); |
+ ManageProfileOverlay.showManageDialog(); |
}; |
$('profiles-delete').onclick = function(event) { |
var selectedProfile = self.getSelectedProfileItem_(); |
@@ -1008,11 +1006,35 @@ cr.define('options', function() { |
// add it to the list, even if the list is hidden so we can access it |
// later. |
$('profiles-list').dataModel = new ArrayDataModel(profiles); |
- // We got new data, close the open overlay if it's open. |
- ManageProfileOverlay.getInstance().visible = false; |
+ |
+ // Received new data. If showing the "manage" overlay, keep it up to |
+ // date. If showing the "delete" overlay, close it. |
+ if (ManageProfileOverlay.getInstance().visible && |
+ !$('manage-profile-overlay-manage').hidden) { |
+ ManageProfileOverlay.showManageDialog(); |
+ } else { |
+ ManageProfileOverlay.getInstance().visible = false; |
+ } |
+ |
this.setProfileViewButtonsStatus_(); |
}, |
+ /** |
+ * Returns the currently active profile for this browser window. |
+ * @return {Object} A profile info object. |
Dan Beam
2012/06/20 02:25:19
{?Object} if you can return null, or remove the re
Evan Stade
2012/06/20 22:10:06
you're commenting on an old patch
|
+ * @private |
+ */ |
+ getCurrentProfile_: function() { |
+ for (var i = 0; i < $('profiles-list').dataModel.length; i++) { |
+ var profile = $('profiles-list').dataModel.item(i); |
+ if (profile.isCurrentProfile) |
Dan Beam
2012/06/20 02:25:19
indent -2\s
Evan Stade
2012/06/20 22:10:06
Done.
|
+ return profile; |
+ } |
+ |
+ assert(false); |
Dan Beam
2012/06/20 02:25:19
Y U NO MSG?
Evan Stade
2012/06/20 22:10:06
Done.
|
+ return null; |
Dan Beam
2012/06/20 02:25:19
doesn't assert() throw right here?
Evan Stade
2012/06/20 22:10:06
you're commenting on an old patch
|
+ }, |
+ |
setGtkThemeButtonEnabled_: function(enabled) { |
if (!cr.isChromeOS && navigator.platform.match(/linux|BSD/i)) |
$('themes-GTK-button').disabled = !enabled; |
@@ -1359,6 +1381,7 @@ cr.define('options', function() { |
//Forward public APIs to private implementations. |
[ |
'addBluetoothDevice', |
+ 'getCurrentProfile', |
'getStartStopSyncButton', |
'hideBluetoothSettings', |
'removeCloudPrintConnectorSection', |