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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/supervised_user_creation_screen_handler.h

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_CHROMEOS_LOGIN_SUPERVISED_USER_CREATION_SCREEN_H ANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SUPERVISED_USER_CREATION_SCREEN_H ANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SUPERVISED_USER_CREATION_SCREEN_H ANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SUPERVISED_USER_CREATION_SCREEN_H ANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" 12 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
13 #include "components/user_manager/user_image/default_user_images.h" 13 #include "components/user_manager/user_image/default_user_images.h"
14 #include "content/public/browser/web_ui.h" 14 #include "content/public/browser/web_ui.h"
15 15
16 namespace base { 16 namespace base {
17 class ListValue; 17 class ListValue;
18 } 18 }
19 19
20 namespace user_manager {
21 class UserID;
22 }
23
20 namespace chromeos { 24 namespace chromeos {
21 25
22 class SupervisedUserCreationScreenHandler : public BaseScreenHandler { 26 class SupervisedUserCreationScreenHandler : public BaseScreenHandler {
23 public: 27 public:
24 class Delegate { 28 class Delegate {
25 public: 29 public:
26 virtual ~Delegate() {} 30 virtual ~Delegate() {}
27 31
28 // This method is called, when actor is being destroyed. Note, if Delegate 32 // This method is called, when actor is being destroyed. Note, if Delegate
29 // is destroyed earlier then it has to call SetDelegate(NULL). 33 // is destroyed earlier then it has to call SetDelegate(NULL).
30 virtual void OnActorDestroyed( 34 virtual void OnActorDestroyed(
31 SupervisedUserCreationScreenHandler* actor) = 0; 35 SupervisedUserCreationScreenHandler* actor) = 0;
32 36
33 // Starts supervised user creation flow, with manager identified by 37 // Starts supervised user creation flow, with manager identified by
34 // |manager_id| and |manager_password|. 38 // |manager_id| and |manager_password|.
35 virtual void AuthenticateManager(const std::string& manager_id, 39 virtual void AuthenticateManager(const user_manager::UserID& manager_id,
36 const std::string& manager_password) = 0; 40 const std::string& manager_password) = 0;
37 41
38 // Starts supervised user creation flow, with supervised user that would 42 // Starts supervised user creation flow, with supervised user that would
39 // have |display_name| and authenticated by the |supervised_user_password|. 43 // have |display_name| and authenticated by the |supervised_user_password|.
40 virtual void CreateSupervisedUser( 44 virtual void CreateSupervisedUser(
41 const base::string16& display_name, 45 const base::string16& display_name,
42 const std::string& supervised_user_password) = 0; 46 const std::string& supervised_user_password) = 0;
43 47
44 // Look up if user with name |display_name| already exist and can be 48 // Look up if user with name |display_name| already exist and can be
45 // imported. Returns user ID in |out_id|. Returns true if user was found, 49 // imported. Returns user ID in |out_id|. Returns true if user was found,
46 // false otherwise. 50 // false otherwise.
47 virtual bool FindUserByDisplayName(const base::string16& display_name, 51 virtual bool FindUserByDisplayName(const base::string16& display_name,
48 std::string *out_id) const = 0; 52 std::string *out_id) const = 0;
49 53
50 // Starts supervised user import flow for user identified with |user_id|. 54 // Starts supervised user import flow for user identified with |user_id|.
51 virtual void ImportSupervisedUser(const std::string& user_id) = 0; 55 virtual void ImportSupervisedUser(const user_manager::UserID& user_id) = 0;
52 // Starts supervised user import flow for user identified with |user_id| and 56 // Starts supervised user import flow for user identified with |user_id| and
53 // additional |password|. 57 // additional |password|.
54 virtual void ImportSupervisedUserWithPassword( 58 virtual void ImportSupervisedUserWithPassword(
55 const std::string& user_id, const std::string& password) = 0; 59 const user_manager::UserID& user_id, const std::string& password) = 0;
56 60
57 virtual void AbortFlow() = 0; 61 virtual void AbortFlow() = 0;
58 virtual void FinishFlow() = 0; 62 virtual void FinishFlow() = 0;
59 virtual void HideFlow() = 0; 63 virtual void HideFlow() = 0;
60 64
61 virtual void OnPhotoTaken(const std::string& raw_data) = 0; 65 virtual void OnPhotoTaken(const std::string& raw_data) = 0;
62 virtual void OnImageSelected(const std::string& image_url, 66 virtual void OnImageSelected(const std::string& image_url,
63 const std::string& image_type) = 0; 67 const std::string& image_type) = 0;
64 virtual void OnImageAccepted() = 0; 68 virtual void OnImageAccepted() = 0;
65 virtual void OnPageSelected(const std::string& page) = 0; 69 virtual void OnPageSelected(const std::string& page) = 0;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void UpdateText(const std::string& element_id, const base::string16& text); 137 void UpdateText(const std::string& element_id, const base::string16& text);
134 138
135 Delegate* delegate_; 139 Delegate* delegate_;
136 140
137 DISALLOW_COPY_AND_ASSIGN(SupervisedUserCreationScreenHandler); 141 DISALLOW_COPY_AND_ASSIGN(SupervisedUserCreationScreenHandler);
138 }; 142 };
139 143
140 } // namespace chromeos 144 } // namespace chromeos
141 145
142 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SUPERVISED_USER_CREATION_SCREE N_HANDLER_H_ 146 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SUPERVISED_USER_CREATION_SCREE N_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698