| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "chrome/browser/profiles/profile_metrics.h" | 14 #include "chrome/browser/profiles/profile_metrics.h" |
| 15 #include "chrome/browser/signin/screenlock_bridge.h" | 15 #include "chrome/browser/signin/signin_screen_bridge.h" |
| 16 #include "chrome/browser/ui/host_desktop.h" | 16 #include "chrome/browser/ui/host_desktop.h" |
| 17 #include "content/public/browser/web_ui_message_handler.h" | 17 #include "content/public/browser/web_ui_message_handler.h" |
| 18 #include "google_apis/gaia/gaia_auth_consumer.h" | 18 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 19 | 19 |
| 20 class GaiaAuthFetcher; | 20 class GaiaAuthFetcher; |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 class DictionaryValue; | 23 class DictionaryValue; |
| 24 class FilePath; | 24 class FilePath; |
| 25 class ListValue; | 25 class ListValue; |
| 26 } | 26 } |
| 27 | 27 |
| 28 class UserManagerScreenHandler : public content::WebUIMessageHandler, | 28 class UserManagerScreenHandler : public content::WebUIMessageHandler, |
| 29 public ScreenlockBridge::LockHandler, | 29 public SigninScreenBridge::LockHandler, |
| 30 public GaiaAuthConsumer { | 30 public GaiaAuthConsumer { |
| 31 public: | 31 public: |
| 32 UserManagerScreenHandler(); | 32 UserManagerScreenHandler(); |
| 33 virtual ~UserManagerScreenHandler(); | 33 virtual ~UserManagerScreenHandler(); |
| 34 | 34 |
| 35 // WebUIMessageHandler implementation. | 35 // WebUIMessageHandler implementation. |
| 36 virtual void RegisterMessages() OVERRIDE; | 36 virtual void RegisterMessages() OVERRIDE; |
| 37 | 37 |
| 38 void GetLocalizedValues(base::DictionaryValue* localized_strings); | 38 void GetLocalizedValues(base::DictionaryValue* localized_strings); |
| 39 | 39 |
| 40 // ScreenlockBridge::LockHandler implementation. | 40 // SigninScreenBridge::LockHandler implementation. |
| 41 virtual void ShowBannerMessage(const base::string16& message) OVERRIDE; | 41 virtual void ShowBannerMessage(const base::string16& message) OVERRIDE; |
| 42 virtual void ShowUserPodCustomIcon( | 42 virtual void ShowUserPodCustomIcon( |
| 43 const std::string& user_email, | 43 const std::string& user_email, |
| 44 const ScreenlockBridge::UserPodCustomIconOptions& icon_options) OVERRIDE; | 44 const SigninScreenBridge::UserPodCustomIconOptions& icon_options) |
| 45 OVERRIDE; |
| 45 virtual void HideUserPodCustomIcon(const std::string& user_email) OVERRIDE; | 46 virtual void HideUserPodCustomIcon(const std::string& user_email) OVERRIDE; |
| 46 virtual void EnableInput() OVERRIDE; | 47 virtual void EnableInput() OVERRIDE; |
| 47 virtual void SetAuthType(const std::string& user_email, | 48 virtual void SetAuthType(const std::string& user_email, |
| 48 ScreenlockBridge::LockHandler::AuthType auth_type, | 49 SigninScreenBridge::LockHandler::AuthType auth_type, |
| 49 const base::string16& auth_value) OVERRIDE; | 50 const base::string16& auth_value) OVERRIDE; |
| 50 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType( | 51 virtual SigninScreenBridge::LockHandler::AuthType GetAuthType( |
| 51 const std::string& user_email) const OVERRIDE; | 52 const std::string& user_email) const OVERRIDE; |
| 52 virtual void Unlock(const std::string& user_email) OVERRIDE; | 53 virtual void Unlock(const std::string& user_email) OVERRIDE; |
| 53 virtual void AttemptUserClickLogin(const std::string& user_email, | 54 virtual void AttemptUserClickLogin(const std::string& user_email, |
| 54 const std::string& secret, | 55 const std::string& secret, |
| 55 const std::string& key_label) OVERRIDE; | 56 const std::string& key_label) OVERRIDE; |
| 56 | 57 |
| 57 private: | 58 private: |
| 58 // An observer for any changes to Profiles in the ProfileInfoCache so that | 59 // An observer for any changes to Profiles in the ProfileInfoCache so that |
| 59 // all the visible user manager screens can be updated. | 60 // all the visible user manager screens can be updated. |
| 60 class ProfileUpdateObserver; | 61 class ProfileUpdateObserver; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 89 | 90 |
| 90 // Authenticator used when local-auth fails. | 91 // Authenticator used when local-auth fails. |
| 91 scoped_ptr<GaiaAuthFetcher> client_login_; | 92 scoped_ptr<GaiaAuthFetcher> client_login_; |
| 92 | 93 |
| 93 // The index of the profile currently being authenticated. | 94 // The index of the profile currently being authenticated. |
| 94 size_t authenticating_profile_index_; | 95 size_t authenticating_profile_index_; |
| 95 | 96 |
| 96 // Login password, held during on-line auth for saving later if correct. | 97 // Login password, held during on-line auth for saving later if correct. |
| 97 std::string password_attempt_; | 98 std::string password_attempt_; |
| 98 | 99 |
| 99 typedef std::map<std::string, ScreenlockBridge::LockHandler::AuthType> | 100 typedef std::map<std::string, SigninScreenBridge::LockHandler::AuthType> |
| 100 UserAuthTypeMap; | 101 UserAuthTypeMap; |
| 101 UserAuthTypeMap user_auth_type_map_; | 102 UserAuthTypeMap user_auth_type_map_; |
| 102 | 103 |
| 103 DISALLOW_COPY_AND_ASSIGN(UserManagerScreenHandler); | 104 DISALLOW_COPY_AND_ASSIGN(UserManagerScreenHandler); |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ | 107 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ |
| OLD | NEW |