Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2251)

Unified Diff: chrome/browser/resources/options2/browser_options.js

Issue 10689084: Merge 143541 - Fix edit profile link in NTP (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/options2/manage_profile_overlay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options2/browser_options.js
===================================================================
--- chrome/browser/resources/options2/browser_options.js (revision 145236)
+++ chrome/browser/resources/options2/browser_options.js (working copy)
@@ -237,9 +237,7 @@
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 @@
// 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.
+ * @private
+ */
+ getCurrentProfile_: function() {
+ for (var i = 0; i < $('profiles-list').dataModel.length; i++) {
+ var profile = $('profiles-list').dataModel.item(i);
+ if (profile.isCurrentProfile)
+ return profile;
+ }
+
+ assert(false,
+ 'There should always be a current profile, but none found.');
+ },
+
setGtkThemeButtonEnabled_: function(enabled) {
if (!cr.isChromeOS && navigator.platform.match(/linux|BSD/i))
$('themes-GTK-button').disabled = !enabled;
@@ -1359,6 +1381,7 @@
//Forward public APIs to private implementations.
[
'addBluetoothDevice',
+ 'getCurrentProfile',
'getStartStopSyncButton',
'hideBluetoothSettings',
'removeCloudPrintConnectorSection',
« no previous file with comments | « no previous file | chrome/browser/resources/options2/manage_profile_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698