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

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

Issue 10579026: Fix edit profile link in NTP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: docs 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
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..65148a8138ac6e7469dd6ce61b87f6015a7b6156 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,33 @@ 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;
+
+ // We got new data. If we are showing the "manage" overlay, keep it up to
Dan Beam 2012/06/19 23:44:25 we use "we" three times, here. are we going to cha
Evan Stade 2012/06/20 02:04:31 Done.
+ // date. If we are 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/19 23:44:25 {?Object} unless you really can't return null.
+ * @private
+ */
+ getCurrentProfile_: function() {
+ for (var i = 0; i < $('profiles-list').dataModel.length; i++) {
+ if ($('profiles-list').dataModel.item(i).isCurrentProfile)
Dan Beam 2012/06/19 23:44:25 var profile = $('profiles-list').dataModel.item(i)
Evan Stade 2012/06/20 02:04:31 Done.
+ return $('profiles-list').dataModel.item(i);
+ }
+
+ return null;
Dan Beam 2012/06/19 23:44:25 assert(false, "couldn't find a default profile");
Evan Stade 2012/06/20 02:04:31 it's not default, it's current. done.
Dan Beam 2012/06/20 02:22:07 sorry, yeah, one was right, :)
+ },
+
setGtkThemeButtonEnabled_: function(enabled) {
if (!cr.isChromeOS && navigator.platform.match(/linux|BSD/i))
$('themes-GTK-button').disabled = !enabled;
@@ -1359,6 +1379,7 @@ cr.define('options', function() {
//Forward public APIs to private implementations.
[
'addBluetoothDevice',
+ 'getCurrentProfile',
'getStartStopSyncButton',
'hideBluetoothSettings',
'removeCloudPrintConnectorSection',

Powered by Google App Engine
This is Rietveld 408576698