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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h

Issue 8773046: [cros] Display emails of users are stored in a separate dictionary in Local State. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Logging cleanup Created 9 years 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_ACCOUNTS_OPTIONS_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_ACCOUNTS_OPTIONS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_ACCOUNTS_OPTIONS_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_ACCOUNTS_OPTIONS_HANDLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "chrome/browser/ui/webui/options/options_ui.h" 10 #include "chrome/browser/ui/webui/options/options_ui.h"
11 11
12 namespace chromeos { 12 namespace chromeos {
13 13
14 class UserCrosSettingsProvider; 14 class UserCrosSettingsProvider;
15 15
16 // ChromeOS accounts options page handler. 16 // ChromeOS accounts options page handler.
17 class AccountsOptionsHandler : public OptionsPageUIHandler { 17 class AccountsOptionsHandler : public OptionsPageUIHandler {
18 public: 18 public:
19 AccountsOptionsHandler(); 19 AccountsOptionsHandler();
20 virtual ~AccountsOptionsHandler(); 20 virtual ~AccountsOptionsHandler();
21 21
22 // WebUIMessageHandler implementation. 22 // WebUIMessageHandler implementation.
23 virtual void RegisterMessages() OVERRIDE; 23 virtual void RegisterMessages() OVERRIDE;
24 24
25 // OptionsPageUIHandler implementation. 25 // OptionsPageUIHandler implementation.
26 virtual void GetLocalizedValues( 26 virtual void GetLocalizedValues(
27 base::DictionaryValue* localized_strings) OVERRIDE; 27 base::DictionaryValue* localized_strings) OVERRIDE;
28 28
29 // Creates a user info dictionary to be stored in the |ListValue| that is
30 // passed to Javascript for the |kAccountsPrefUsers| preference.
31 static base::DictionaryValue* CreateUserInfo(const std::string& username,
32 const std::string& display_email,
33 const std::string& display_name);
34
29 private: 35 private:
30 // Javascript callbacks to whitelist/unwhitelist user. 36 // Javascript callbacks to whitelist/unwhitelist user.
31 void WhitelistUser(const base::ListValue* args); 37 void HandleWhitelistUser(const base::ListValue* args);
32 void UnwhitelistUser(const base::ListValue* args); 38 void HandleUnwhitelistUser(const base::ListValue* args);
33 39
34 // Javascript callback to auto add existing users to white list. 40 // Javascript callback to auto add existing users to white list.
35 void WhitelistExistingUsers(const base::ListValue* args); 41 void HandleWhitelistExistingUsers(const base::ListValue* args);
42
43 // Adds specified user to the whitelist. Returns false if that user is already
44 // in the whitelist.
45 bool WhitelistUser(const std::string& username);
46
47 // Returns true if |username| is the logged-in owner.
48 static bool IsLoggedInOwner(const std::string& username);
36 49
37 DISALLOW_COPY_AND_ASSIGN(AccountsOptionsHandler); 50 DISALLOW_COPY_AND_ASSIGN(AccountsOptionsHandler);
38 }; 51 };
39 52
40 } // namespace chromeos 53 } // namespace chromeos
41 54
42 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_ACCOUNTS_OPTIONS_HANDLER_H_ 55 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_ACCOUNTS_OPTIONS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698