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

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

Issue 2935011: Initial accounts options page. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: use ListItem directly for now per arv Created 10 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 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 // AccountsOptions class:
7
8 /**
9 * Encapsulated handling of ChromeOS accounts options page.
10 * @constructor
11 */
12 function AccountsOptions(model) {
13 OptionsPage.call(this, 'accounts', localStrings.getString('accountsPage'),
14 'accountsPage');
15 }
16
17 AccountsOptions.getInstance = function() {
18 if (!AccountsOptions.instance_) {
19 AccountsOptions.instance_ = new AccountsOptions(null);
20 }
21 return AccountsOptions.instance_;
22 };
23
24 AccountsOptions.prototype = {
25 // Inherit AccountsOptions from OptionsPage.
26 __proto__: OptionsPage.prototype,
27
28 /**
29 * Initializes AccountsOptions page.
30 */
31 initializePage: function() {
32 // Call base class implementation to starts preference initialization.
33 OptionsPage.prototype.initializePage.call(this);
34
35 // Set up accounts page.
36 $('addUserButton').onclick = function(e) {
37 OptionsPage.showOverlay('addUserOverlay');
38 };
39 $('removeUserButton').onclick = function(e) {
40 $('userList').removeSelectedUser();
41 };
42
43 options.accounts.UserList.decorate($('userList'));
44
45 this.addEventListener('visibleChange',
46 cr.bind(this.handleVisibleChange_, this));
47
48 // Setup add user overlay page.
49 OptionsPage.registerOverlay(AddUserOverlay.getInstance());
50 },
51
52 userListInitalized_: false,
53
54 /**
55 * Handler for OptionsPage's visible property change event.
56 * @param {Event} e Property change event.
57 */
58 handleVisibleChange_ : function(e) {
59 if (!this.userListInitalized_ && this.visible) {
60 this.userListInitalized_ = true;
61 userList.redraw();
62 }
63 }
64 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698