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

Unified Diff: chrome/browser/resources/options/manage_profile_overlay.js

Issue 410293004: Split OptionsPage into Page and PageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed feedback Created 6 years, 5 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/options/manage_profile_overlay.js
diff --git a/chrome/browser/resources/options/manage_profile_overlay.js b/chrome/browser/resources/options/manage_profile_overlay.js
index 723d6cd1cc8d7d3f5a6315ebff7abf1b5d6df3b6..a53202ce2ea47840aeebccc818a3c533dea254ad 100644
--- a/chrome/browser/resources/options/manage_profile_overlay.js
+++ b/chrome/browser/resources/options/manage_profile_overlay.js
@@ -3,7 +3,8 @@
// found in the LICENSE file.
cr.define('options', function() {
- var OptionsPage = options.OptionsPage;
+ var Page = cr.ui.pageManager.Page;
+ var PageManager = cr.ui.pageManager.PageManager;
var ArrayDataModel = cr.ui.ArrayDataModel;
/**
@@ -13,16 +14,16 @@ cr.define('options', function() {
* @class
*/
function ManageProfileOverlay() {
- OptionsPage.call(this, 'manageProfile',
- loadTimeData.getString('manageProfileTabTitle'),
- 'manage-profile-overlay');
+ Page.call(this, 'manageProfile',
+ loadTimeData.getString('manageProfileTabTitle'),
+ 'manage-profile-overlay');
};
cr.addSingletonGetter(ManageProfileOverlay);
ManageProfileOverlay.prototype = {
- // Inherit from OptionsPage.
- __proto__: OptionsPage.prototype,
+ // Inherit from Page.
+ __proto__: Page.prototype,
// Info about the currently managed/deleted profile.
profileInfo_: null,
@@ -45,8 +46,7 @@ cr.define('options', function() {
* Initialize the page.
*/
initializePage: function() {
- // Call base class implementation to start preference initialization.
- OptionsPage.prototype.initializePage.call(this);
+ Page.prototype.initializePage.call(this);
var self = this;
options.ProfilesIconGrid.decorate($('manage-profile-icon-grid'));
@@ -69,10 +69,10 @@ cr.define('options', function() {
$('manage-profile-cancel').onclick =
$('disconnect-managed-profile-cancel').onclick =
$('delete-profile-cancel').onclick = function(event) {
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
};
$('delete-profile-ok').onclick = function(event) {
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
if (BrowserOptions.getCurrentProfile().isManaged)
return;
chrome.send('deleteProfile', [self.profileInfo_.filePath]);
@@ -86,14 +86,14 @@ cr.define('options', function() {
};
$('disconnect-managed-profile-ok').onclick = function(event) {
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
chrome.send('deleteProfile',
[BrowserOptions.getCurrentProfile().filePath]);
}
$('create-profile-managed-signed-in-learn-more-link').onclick =
function(event) {
- OptionsPage.navigateToPage('managedUserLearnMore');
+ PageManager.showPageByName('managedUserLearnMore');
return false;
};
@@ -103,12 +103,12 @@ cr.define('options', function() {
// TODO(pamg): Move the sync-setup overlay to a higher layer so this one
// can stay open under it, after making sure that doesn't break anything
// else.
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
SyncSetupOverlay.startSignIn();
};
$('create-profile-managed-sign-in-again-link').onclick = function(event) {
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
SyncSetupOverlay.showSetupUI();
};
@@ -117,7 +117,7 @@ cr.define('options', function() {
// is shown again when the import overlay loads. TODO(akuegel): Remove
// this temporary fix when crbug/246304 is resolved.
$('import-existing-managed-user-link').hidden = true;
- OptionsPage.navigateToPage('managedUserImport');
+ PageManager.showPageByName('managedUserImport');
};
},
@@ -167,7 +167,7 @@ cr.define('options', function() {
self.onNameChanged_(mode);
};
$(mode + '-profile-ok').onclick = function(event) {
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
submitFunction();
};
},
@@ -252,7 +252,7 @@ cr.define('options', function() {
// But the C++ handler calls this method directly on ManageProfileOverlay,
// so check the pageDiv to also include its subclasses (in particular
// CreateProfileOverlay, which has higher sub-overlays).
- if (OptionsPage.getTopmostVisiblePage().pageDiv == this.pageDiv) {
+ if (PageManager.getTopmostVisiblePage().pageDiv == this.pageDiv) {
// This will only have an effect if the 'create-profile-name' element
// is visible, i.e. if the overlay is in create mode.
$('create-profile-name').focus();
@@ -375,7 +375,7 @@ cr.define('options', function() {
function getImportHandler(managedUser, nameIsUnique) {
return function() {
if (managedUser.needAvatar || !nameIsUnique) {
- OptionsPage.navigateToPage('managedUserImport');
+ PageManager.showPageByName('managedUserImport');
} else {
self.hideErrorBubble_('create');
CreateProfileOverlay.updateCreateInProgress(true);
@@ -518,7 +518,7 @@ cr.define('options', function() {
*/
showManageDialog_: function() {
this.prepareForManageDialog_();
- OptionsPage.navigateToPage('manageProfile');
+ PageManager.showPageByName('manageProfile');
},
/**
@@ -544,7 +544,7 @@ cr.define('options', function() {
// Because this dialog isn't useful when refreshing or as part of the
// history, don't create a history entry for it when showing.
- OptionsPage.showPageByName('manageProfile', false);
+ PageManager.showPageByName('manageProfile', false);
},
/**
@@ -564,7 +564,7 @@ cr.define('options', function() {
// Because this dialog isn't useful when refreshing or as part of the
// history, don't create a history entry for it when showing.
- OptionsPage.showPageByName('manageProfile', false);
+ PageManager.showPageByName('manageProfile', false);
},
/**
@@ -572,7 +572,7 @@ cr.define('options', function() {
* @private
*/
showCreateDialog_: function() {
- OptionsPage.navigateToPage('createProfile');
+ PageManager.showPageByName('createProfile');
},
};
@@ -596,7 +596,7 @@ cr.define('options', function() {
});
function CreateProfileOverlay() {
- OptionsPage.call(this, 'createProfile',
+ Page.call(this, 'createProfile',
loadTimeData.getString('createProfileTabTitle'),
'manage-profile-overlay');
};
@@ -698,7 +698,7 @@ cr.define('options', function() {
* @private
*/
cancelCreateProfile_: function() {
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
chrome.send('cancelCreateProfile');
this.hideErrorBubble_();
this.updateCreateInProgress_(false);
@@ -739,12 +739,12 @@ cr.define('options', function() {
*/
onSuccess_: function(profileInfo) {
this.updateCreateInProgress_(false);
- OptionsPage.closeOverlay();
+ PageManager.closeOverlay();
if (profileInfo.isManaged) {
options.ManagedUserListData.resetPromise();
profileInfo.custodianEmail = this.signedInEmail_;
ManagedUserCreateConfirmOverlay.setProfileInfo(profileInfo);
- OptionsPage.showPageByName('managedUserCreateConfirm', false);
+ PageManager.showPageByName('managedUserCreateConfirm', false);
BrowserOptions.updateManagesSupervisedUsers(true);
}
},

Powered by Google App Engine
This is Rietveld 408576698