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

Side by Side Diff: chrome/browser/chromeos/login/signin_screen_controller.h

Issue 2568973002: chromeos: Replace user image notifications with observer (Closed)
Patch Set: rebase Created 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CHROMEOS_LOGIN_SIGNIN_SCREEN_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_SCREEN_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_SCREEN_CONTROLLER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_SCREEN_CONTROLLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/chromeos/login/screens/gaia_screen.h" 9 #include "chrome/browser/chromeos/login/screens/gaia_screen.h"
10 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" 10 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h"
11 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 11 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
12 #include "components/user_manager/remove_user_delegate.h" 12 #include "components/user_manager/remove_user_delegate.h"
13 #include "components/user_manager/user.h" 13 #include "components/user_manager/user.h"
14 #include "components/user_manager/user_manager.h"
14 #include "content/public/browser/notification_observer.h" 15 #include "content/public/browser/notification_observer.h"
15 #include "content/public/browser/notification_registrar.h" 16 #include "content/public/browser/notification_registrar.h"
16 17
17 class AccountId; 18 class AccountId;
18 19
19 namespace chromeos { 20 namespace chromeos {
20 21
21 class LoginDisplayWebUIHandler; 22 class LoginDisplayWebUIHandler;
22 class OobeUI; 23 class OobeUI;
23 24
24 // Class that manages control flow between wizard screens. Wizard controller 25 // Class that manages control flow between wizard screens. Wizard controller
25 // interacts with screen controllers to move the user between screens. 26 // interacts with screen controllers to move the user between screens.
26 // 27 //
27 // This class is allocated when the signin or lock screen is actually visible to 28 // This class is allocated when the signin or lock screen is actually visible to
28 // the user. It is a 'per-session' class; SignInScreenHandler, in comparsion, is 29 // the user. It is a 'per-session' class; SignInScreenHandler, in comparsion, is
29 // tied to the WebContents lifetime and therefore may live beyond this class. 30 // tied to the WebContents lifetime and therefore may live beyond this class.
30 class SignInScreenController : public user_manager::RemoveUserDelegate, 31 class SignInScreenController : public user_manager::RemoveUserDelegate,
32 public user_manager::UserManager::Observer,
31 public content::NotificationObserver { 33 public content::NotificationObserver {
32 public: 34 public:
33 SignInScreenController(OobeUI* oobe_ui, 35 SignInScreenController(OobeUI* oobe_ui,
34 LoginDisplay::Delegate* login_display_delegate); 36 LoginDisplay::Delegate* login_display_delegate);
35 ~SignInScreenController() override; 37 ~SignInScreenController() override;
36 38
37 // Returns the default wizard controller if it has been created. 39 // Returns the default wizard controller if it has been created.
38 static SignInScreenController* Get() { return instance_; } 40 static SignInScreenController* Get() { return instance_; }
39 41
40 void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler); 42 void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler);
(...skipping 13 matching lines...) Expand all
54 56
55 // Query to remove user with specified id. 57 // Query to remove user with specified id.
56 // TODO(antrim): move to user selection screen handler. 58 // TODO(antrim): move to user selection screen handler.
57 void RemoveUser(const AccountId& account_id); 59 void RemoveUser(const AccountId& account_id);
58 60
59 private: 61 private:
60 // user_manager::RemoveUserDelegate implementation: 62 // user_manager::RemoveUserDelegate implementation:
61 void OnBeforeUserRemoved(const AccountId& account_id) override; 63 void OnBeforeUserRemoved(const AccountId& account_id) override;
62 void OnUserRemoved(const AccountId& account_id) override; 64 void OnUserRemoved(const AccountId& account_id) override;
63 65
66 // user_manager::UserManager::Observer implementation:
67 void OnUserImageChanged(const user_manager::User& user) override;
68
64 // content::NotificationObserver implementation. 69 // content::NotificationObserver implementation.
65 void Observe(int type, 70 void Observe(int type,
66 const content::NotificationSource& source, 71 const content::NotificationSource& source,
67 const content::NotificationDetails& details) override; 72 const content::NotificationDetails& details) override;
68 73
69 static SignInScreenController* instance_; 74 static SignInScreenController* instance_;
70 75
71 OobeUI* oobe_ui_ = nullptr; 76 OobeUI* oobe_ui_ = nullptr;
72 77
73 // Reference to the WebUI handling layer for the login screen 78 // Reference to the WebUI handling layer for the login screen
74 LoginDisplayWebUIHandler* webui_handler_ = nullptr; 79 LoginDisplayWebUIHandler* webui_handler_ = nullptr;
75 80
76 std::unique_ptr<GaiaScreen> gaia_screen_; 81 std::unique_ptr<GaiaScreen> gaia_screen_;
77 std::unique_ptr<UserSelectionScreen> user_selection_screen_; 82 std::unique_ptr<UserSelectionScreen> user_selection_screen_;
78 83
79 // Used for notifications during the login process. 84 // Used for notifications during the login process.
80 content::NotificationRegistrar registrar_; 85 content::NotificationRegistrar registrar_;
81 86
82 DISALLOW_COPY_AND_ASSIGN(SignInScreenController); 87 DISALLOW_COPY_AND_ASSIGN(SignInScreenController);
83 }; 88 };
84 89
85 } // namespace chromeos 90 } // namespace chromeos
86 91
87 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_SCREEN_CONTROLLER_H_ 92 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_SCREEN_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screens/user_image_screen.cc ('k') | chrome/browser/chromeos/login/signin_screen_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698