OLD | NEW |
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_EXISTING_USER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
18 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 18 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
19 #include "chrome/browser/chromeos/login/login_utils.h" | 19 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
20 #include "chrome/browser/chromeos/login/ui/login_display.h" | 20 #include "chrome/browser/chromeos/login/ui/login_display.h" |
21 #include "chrome/browser/chromeos/settings/cros_settings.h" | 21 #include "chrome/browser/chromeos/settings/cros_settings.h" |
22 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 22 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
23 #include "chromeos/login/auth/login_performer.h" | 23 #include "chromeos/login/auth/login_performer.h" |
24 #include "chromeos/login/auth/user_context.h" | 24 #include "chromeos/login/auth/user_context.h" |
25 #include "components/user_manager/user.h" | 25 #include "components/user_manager/user.h" |
26 #include "content/public/browser/notification_observer.h" | 26 #include "content/public/browser/notification_observer.h" |
27 #include "content/public/browser/notification_registrar.h" | 27 #include "content/public/browser/notification_registrar.h" |
28 #include "ui/gfx/geometry/rect.h" | 28 #include "ui/gfx/geometry/rect.h" |
29 #include "url/gurl.h" | 29 #include "url/gurl.h" |
(...skipping 14 matching lines...) Expand all Loading... |
44 // ExistingUserController is used to handle login when someone has | 44 // ExistingUserController is used to handle login when someone has |
45 // already logged into the machine. | 45 // already logged into the machine. |
46 // To use ExistingUserController create an instance of it and invoke Init. | 46 // To use ExistingUserController create an instance of it and invoke Init. |
47 // When Init is called it creates LoginDisplay instance which encapsulates | 47 // When Init is called it creates LoginDisplay instance which encapsulates |
48 // all login UI implementation. | 48 // all login UI implementation. |
49 // ExistingUserController maintains it's own life cycle and deletes itself when | 49 // ExistingUserController maintains it's own life cycle and deletes itself when |
50 // the user logs in (or chooses to see other settings). | 50 // the user logs in (or chooses to see other settings). |
51 class ExistingUserController : public LoginDisplay::Delegate, | 51 class ExistingUserController : public LoginDisplay::Delegate, |
52 public content::NotificationObserver, | 52 public content::NotificationObserver, |
53 public LoginPerformer::Delegate, | 53 public LoginPerformer::Delegate, |
54 public LoginUtils::Delegate { | 54 public UserSessionManagerDelegate { |
55 public: | 55 public: |
56 // All UI initialization is deferred till Init() call. | 56 // All UI initialization is deferred till Init() call. |
57 explicit ExistingUserController(LoginDisplayHost* host); | 57 explicit ExistingUserController(LoginDisplayHost* host); |
58 ~ExistingUserController() override; | 58 ~ExistingUserController() override; |
59 | 59 |
60 // Returns the current existing user controller if it has been created. | 60 // Returns the current existing user controller if it has been created. |
61 static ExistingUserController* current_controller() { | 61 static ExistingUserController* current_controller() { |
62 return current_controller_; | 62 return current_controller_; |
63 } | 63 } |
64 | 64 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 // LoginPerformer::Delegate implementation: | 140 // LoginPerformer::Delegate implementation: |
141 void OnAuthFailure(const AuthFailure& error) override; | 141 void OnAuthFailure(const AuthFailure& error) override; |
142 void OnAuthSuccess(const UserContext& user_context) override; | 142 void OnAuthSuccess(const UserContext& user_context) override; |
143 void OnOffTheRecordAuthSuccess() override; | 143 void OnOffTheRecordAuthSuccess() override; |
144 void OnPasswordChangeDetected() override; | 144 void OnPasswordChangeDetected() override; |
145 void WhiteListCheckFailed(const std::string& email) override; | 145 void WhiteListCheckFailed(const std::string& email) override; |
146 void PolicyLoadFailed() override; | 146 void PolicyLoadFailed() override; |
147 void OnOnlineChecked(const std::string& username, bool success) override; | 147 void OnOnlineChecked(const std::string& username, bool success) override; |
148 | 148 |
149 // LoginUtils::Delegate implementation: | 149 // UserSessionManagerDelegate implementation: |
150 void OnProfilePrepared(Profile* profile, bool browser_launched) override; | 150 void OnProfilePrepared(Profile* profile, bool browser_launched) override; |
151 | 151 |
152 // Called when device settings change. | 152 // Called when device settings change. |
153 void DeviceSettingsChanged(); | 153 void DeviceSettingsChanged(); |
154 | 154 |
155 // Returns corresponding native window. | 155 // Returns corresponding native window. |
156 gfx::NativeWindow GetNativeWindow() const; | 156 gfx::NativeWindow GetNativeWindow() const; |
157 | 157 |
158 // Show error message. |error_id| error message ID in resources. | 158 // Show error message. |error_id| error message ID in resources. |
159 // If |details| string is not empty, it specify additional error text | 159 // If |details| string is not empty, it specify additional error text |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 // Factory of callbacks. | 309 // Factory of callbacks. |
310 base::WeakPtrFactory<ExistingUserController> weak_factory_; | 310 base::WeakPtrFactory<ExistingUserController> weak_factory_; |
311 | 311 |
312 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); | 312 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); |
313 }; | 313 }; |
314 | 314 |
315 } // namespace chromeos | 315 } // namespace chromeos |
316 | 316 |
317 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 317 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
OLD | NEW |