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

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

Issue 8840003: Replace ProfileManagerObserver with callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: weakptr 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_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // If |delegate_| is NULL that does mean that LoginPerformer instance 45 // If |delegate_| is NULL that does mean that LoginPerformer instance
46 // is waiting for successful online login or blocked on online login failure. 46 // is waiting for successful online login or blocked on online login failure.
47 // In case of failure password/captcha 47 // In case of failure password/captcha
48 // input & error messages display is dedicated to ScreenLocker instance. 48 // input & error messages display is dedicated to ScreenLocker instance.
49 // 49 //
50 // 2 things make LoginPerfrormer instance exist longer: 50 // 2 things make LoginPerfrormer instance exist longer:
51 // 1. ScreenLock active (pending correct new password input) 51 // 1. ScreenLock active (pending correct new password input)
52 // 2. Pending online auth request. 52 // 2. Pending online auth request.
53 class LoginPerformer : public LoginStatusConsumer, 53 class LoginPerformer : public LoginStatusConsumer,
54 public content::NotificationObserver, 54 public content::NotificationObserver,
55 public ProfileManagerObserver { 55 public base::SupportsWeakPtr<LoginUtilsImpl> {
Robert Sesek 2011/12/07 16:36:13 This class already holds a WeakPtrFactory weak_fac
sail 2011/12/07 17:18:13 Done.
56 public: 56 public:
57 // Delegate class to get notifications from the LoginPerformer. 57 // Delegate class to get notifications from the LoginPerformer.
58 class Delegate : public LoginStatusConsumer { 58 class Delegate : public LoginStatusConsumer {
59 public: 59 public:
60 virtual ~Delegate() {} 60 virtual ~Delegate() {}
61 virtual void WhiteListCheckFailed(const std::string& email) = 0; 61 virtual void WhiteListCheckFailed(const std::string& email) = 0;
62 }; 62 };
63 63
64 explicit LoginPerformer(Delegate* delegate); 64 explicit LoginPerformer(Delegate* delegate);
65 virtual ~LoginPerformer(); 65 virtual ~LoginPerformer();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 AUTH_MODE_EXTENSION 119 AUTH_MODE_EXTENSION
120 } AuthorizationMode; 120 } AuthorizationMode;
121 AuthorizationMode auth_mode() const { return auth_mode_; } 121 AuthorizationMode auth_mode() const { return auth_mode_; }
122 122
123 private: 123 private:
124 // content::NotificationObserver implementation: 124 // content::NotificationObserver implementation:
125 virtual void Observe(int type, 125 virtual void Observe(int type,
126 const content::NotificationSource& source, 126 const content::NotificationSource& source,
127 const content::NotificationDetails& details) OVERRIDE; 127 const content::NotificationDetails& details) OVERRIDE;
128 128
129 // ProfileManagerObserver implementation: 129 // Callback for asynchronous profile creation.
130 virtual void OnProfileCreated(Profile* profile, Status status) OVERRIDE; 130 void OnProfileCreated(Profile* profile,
131 Profile::CreateStatus status);
131 132
132 // Requests screen lock and subscribes to screen lock notifications. 133 // Requests screen lock and subscribes to screen lock notifications.
133 void RequestScreenLock(); 134 void RequestScreenLock();
134 135
135 // Requests screen unlock. 136 // Requests screen unlock.
136 void RequestScreenUnlock(); 137 void RequestScreenUnlock();
137 138
138 // Resolves initial LoginFailure::NETWORK_AUTH_FAILED error i.e. 139 // Resolves initial LoginFailure::NETWORK_AUTH_FAILED error i.e.
139 // when screen is not locked yet. 140 // when screen is not locked yet.
140 void ResolveInitialNetworkAuthFailure(); 141 void ResolveInitialNetworkAuthFailure();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 bool using_oauth_; 208 bool using_oauth_;
208 209
209 base::WeakPtrFactory<LoginPerformer> weak_factory_; 210 base::WeakPtrFactory<LoginPerformer> weak_factory_;
210 211
211 DISALLOW_COPY_AND_ASSIGN(LoginPerformer); 212 DISALLOW_COPY_AND_ASSIGN(LoginPerformer);
212 }; 213 };
213 214
214 } // namespace chromeos 215 } // namespace chromeos
215 216
216 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_ 217 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_PERFORMER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/login_performer.cc » ('j') | chrome/browser/profiles/profile_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698