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

Side by Side Diff: chrome/browser/resources/options/chromeos_accounts_add_user_overlay.js

Issue 2868067: Implement new mock for user options page per chromium-os:5028 (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: per arv's comments #2 Created 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 ///////////////////////////////////////////////////////////////////////////////
6 // AddUserOverlay class:
7
8 /**
9 * Encapsulated handling of ChromeOS accounts add user overlay page.
10 * @constructor
11 */
12 function AddUserOverlay(model) {
13 OptionsPage.call(this, 'addUserOverlay', localStrings.getString('add_user'),
14 'addUserOverlayPage');
15 }
16
17 AddUserOverlay.getInstance = function() {
18 if (!AddUserOverlay.instance_) {
19 AddUserOverlay.instance_ = new AddUserOverlay(null);
20 }
21 return AddUserOverlay.instance_;
22 };
23
24 AddUserOverlay.prototype = {
25 // Inherit AddUserOverlay from OptionsPage.
26 __proto__: OptionsPage.prototype,
27
28 /**
29 * Initializes AddUserOverlay page.
30 * Calls base class implementation to starts preference initialization.
31 */
32 initializePage: function() {
33 // Call base class implementation to starts preference initialization.
34 OptionsPage.prototype.initializePage.call(this);
35
36 // Set up the page.
37 $('addUserOkButton').onclick = function(e) {
38 var newUserEmail = $('userEmailEdit').value;
39 if (newUserEmail)
40 userList.addUser({'email': newUserEmail});
41
42 OptionsPage.clearOverlays();
43 };
44
45 $('addUserCancelButton').onclick = function(e) {
46 OptionsPage.clearOverlays();
47 };
48
49 this.addEventListener('visibleChange',
50 cr.bind(this.handleVisibleChange_, this));
51 },
52
53 /**
54 * Handler for OptionsPage's visible property change event.
55 * @param {Event} e Property change event.
56 */
57 handleVisibleChange_: function() {
58 $('userEmailEdit').focus();
59 }
60 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698