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

Side by Side Diff: chrome/browser/resources/options/managed_user_create_confirm.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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 Page = cr.ui.pageManager.Page;
7 var PageManager = cr.ui.pageManager.PageManager;
7 8
8 /** 9 /**
9 * ManagedUserCreateConfirm class. 10 * ManagedUserCreateConfirm class.
10 * Encapsulated handling of the confirmation overlay page when creating a 11 * Encapsulated handling of the confirmation overlay page when creating a
11 * managed user. 12 * managed user.
12 * @constructor 13 * @constructor
13 * @class 14 * @class
14 */ 15 */
15 function ManagedUserCreateConfirmOverlay() { 16 function ManagedUserCreateConfirmOverlay() {
16 OptionsPage.call(this, 'managedUserCreateConfirm', 17 Page.call(this, 'managedUserCreateConfirm',
17 '', // The title will be based on the new profile name. 18 '', // The title will be based on the new profile name.
18 'managed-user-created'); 19 'managed-user-created');
19 }; 20 };
20 21
21 cr.addSingletonGetter(ManagedUserCreateConfirmOverlay); 22 cr.addSingletonGetter(ManagedUserCreateConfirmOverlay);
22 23
23 ManagedUserCreateConfirmOverlay.prototype = { 24 ManagedUserCreateConfirmOverlay.prototype = {
24 // Inherit from OptionsPage. 25 // Inherit from Page.
25 __proto__: OptionsPage.prototype, 26 __proto__: Page.prototype,
26 27
27 // Info about the newly created profile. 28 // Info about the newly created profile.
28 profileInfo_: null, 29 profileInfo_: null,
29 30
30 /** 31 /**
31 * Initialize the page. 32 * Initialize the page.
32 */ 33 */
33 initializePage: function() { 34 initializePage: function() {
34 OptionsPage.prototype.initializePage.call(this); 35 Page.prototype.initializePage.call(this);
35 36
36 $('managed-user-created-done').onclick = function(event) { 37 $('managed-user-created-done').onclick = function(event) {
37 OptionsPage.closeOverlay(); 38 PageManager.closeOverlay();
38 }; 39 };
39 40
40 var self = this; 41 var self = this;
41 42
42 $('managed-user-created-switch').onclick = function(event) { 43 $('managed-user-created-switch').onclick = function(event) {
43 OptionsPage.closeOverlay(); 44 PageManager.closeOverlay();
44 chrome.send('switchToProfile', [self.profileInfo_.filePath]); 45 chrome.send('switchToProfile', [self.profileInfo_.filePath]);
45 }; 46 };
46 }, 47 },
47 48
48 /** @override */ 49 /** @override */
49 didShowPage: function() { 50 didShowPage: function() {
50 $('managed-user-created-switch').focus(); 51 $('managed-user-created-switch').focus();
51 }, 52 },
52 53
53 /** 54 /**
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 var instance = ManagedUserCreateConfirmOverlay.getInstance(); 97 var instance = ManagedUserCreateConfirmOverlay.getInstance();
97 return instance[name + '_'].apply(instance, arguments); 98 return instance[name + '_'].apply(instance, arguments);
98 }; 99 };
99 }); 100 });
100 101
101 // Export 102 // Export
102 return { 103 return {
103 ManagedUserCreateConfirmOverlay: ManagedUserCreateConfirmOverlay, 104 ManagedUserCreateConfirmOverlay: ManagedUserCreateConfirmOverlay,
104 }; 105 };
105 }); 106 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698