Chromium Code Reviews| 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 "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/task/cancelable_task_tracker.h" | 15 #include "base/task/cancelable_task_tracker.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_metrics.h" | 17 #include "chrome/browser/profiles/profile_metrics.h" |
| 18 #include "chrome/browser/profiles/profile_statistics.h" | 18 #include "chrome/browser/profiles/profile_statistics.h" |
| 19 #include "chrome/browser/ui/host_desktop.h" | 19 #include "chrome/browser/ui/host_desktop.h" |
| 20 #include "components/proximity_auth/screenlock_bridge.h" | 20 #include "components/proximity_auth/screenlock_bridge.h" |
| 21 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 22 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 23 #include "content/public/browser/web_ui_message_handler.h" | 23 #include "content/public/browser/web_ui_message_handler.h" |
| 24 #include "google_apis/gaia/gaia_oauth_client.h" | 24 #include "google_apis/gaia/gaia_oauth_client.h" |
| 25 | 25 |
| 26 class AccountId; | |
| 26 class GaiaAuthFetcher; | 27 class GaiaAuthFetcher; |
| 27 | 28 |
| 28 namespace base { | 29 namespace base { |
| 29 class DictionaryValue; | 30 class DictionaryValue; |
| 30 class FilePath; | 31 class FilePath; |
| 31 class ListValue; | 32 class ListValue; |
| 32 } | 33 } |
| 33 | 34 |
| 34 class UserManagerScreenHandler | 35 class UserManagerScreenHandler |
| 35 : public content::WebUIMessageHandler, | 36 : public content::WebUIMessageHandler, |
| 36 public proximity_auth::ScreenlockBridge::LockHandler, | 37 public proximity_auth::ScreenlockBridge::LockHandler, |
| 37 public gaia::GaiaOAuthClient::Delegate, | 38 public gaia::GaiaOAuthClient::Delegate, |
| 38 public content::NotificationObserver { | 39 public content::NotificationObserver { |
| 39 public: | 40 public: |
| 40 UserManagerScreenHandler(); | 41 UserManagerScreenHandler(); |
| 41 ~UserManagerScreenHandler() override; | 42 ~UserManagerScreenHandler() override; |
| 42 | 43 |
| 44 void GetLocalizedValues(base::DictionaryValue* localized_strings); | |
| 45 | |
| 46 private: | |
| 43 // WebUIMessageHandler implementation. | 47 // WebUIMessageHandler implementation. |
| 44 void RegisterMessages() override; | 48 void RegisterMessages() override; |
| 45 | 49 |
| 46 void GetLocalizedValues(base::DictionaryValue* localized_strings); | |
| 47 | |
| 48 // content::NotificationObserver implementation: | 50 // content::NotificationObserver implementation: |
| 49 void Observe(int type, | 51 void Observe(int type, |
| 50 const content::NotificationSource& source, | 52 const content::NotificationSource& source, |
| 51 const content::NotificationDetails& details) override; | 53 const content::NotificationDetails& details) override; |
| 52 | 54 |
| 53 // proximity_auth::ScreenlockBridge::LockHandler implementation. | 55 // proximity_auth::ScreenlockBridge::LockHandler implementation. |
| 54 void ShowBannerMessage(const base::string16& message) override; | 56 void ShowBannerMessage(const base::string16& message) override; |
| 55 void ShowUserPodCustomIcon( | 57 void ShowUserPodCustomIcon( |
| 56 const std::string& user_email, | 58 const AccountId& account_id, |
| 57 const proximity_auth::ScreenlockBridge::UserPodCustomIconOptions& | 59 const proximity_auth::ScreenlockBridge::UserPodCustomIconOptions& |
| 58 icon_options) override; | 60 icon_options) override; |
| 59 void HideUserPodCustomIcon(const std::string& user_email) override; | 61 void HideUserPodCustomIcon(const AccountId& account_id) override; |
| 60 void EnableInput() override; | 62 void EnableInput() override; |
| 61 void SetAuthType( | 63 void SetAuthType( |
| 62 const std::string& user_email, | 64 const AccountId& account_id, |
| 63 proximity_auth::ScreenlockBridge::LockHandler::AuthType auth_type, | 65 proximity_auth::ScreenlockBridge::LockHandler::AuthType auth_type, |
| 64 const base::string16& auth_value) override; | 66 const base::string16& auth_value) override; |
| 65 AuthType GetAuthType(const std::string& user_email) const override; | 67 AuthType GetAuthType(const AccountId& account_id) const override; |
| 66 ScreenType GetScreenType() const override; | 68 ScreenType GetScreenType() const override; |
| 67 void Unlock(const std::string& user_email) override; | 69 void Unlock(const AccountId& account_id) override; |
| 68 void AttemptEasySignin(const std::string& user_email, | 70 void AttemptEasySignin(const AccountId& account_id, |
| 69 const std::string& secret, | 71 const std::string& secret, |
| 70 const std::string& key_label) override; | 72 const std::string& key_label) override; |
| 71 | 73 |
| 72 private: | |
| 73 // An observer for any changes to Profiles in the ProfileInfoCache so that | 74 // An observer for any changes to Profiles in the ProfileInfoCache so that |
| 74 // all the visible user manager screens can be updated. | 75 // all the visible user manager screens can be updated. |
| 75 class ProfileUpdateObserver; | 76 class ProfileUpdateObserver; |
|
achuithb
2015/12/04 20:23:39
Let's move this and the comment to right after pri
Alexander Alekseev
2015/12/05 05:20:07
Done.
| |
| 76 | 77 |
| 77 void HandleInitialize(const base::ListValue* args); | 78 void HandleInitialize(const base::ListValue* args); |
| 78 void HandleAddUser(const base::ListValue* args); | 79 void HandleAddUser(const base::ListValue* args); |
| 79 void HandleAuthenticatedLaunchUser(const base::ListValue* args); | 80 void HandleAuthenticatedLaunchUser(const base::ListValue* args); |
| 80 void HandleLaunchGuest(const base::ListValue* args); | 81 void HandleLaunchGuest(const base::ListValue* args); |
| 81 void HandleLaunchUser(const base::ListValue* args); | 82 void HandleLaunchUser(const base::ListValue* args); |
| 82 void HandleRemoveUser(const base::ListValue* args); | 83 void HandleRemoveUser(const base::ListValue* args); |
| 83 void HandleAttemptUnlock(const base::ListValue* args); | 84 void HandleAttemptUnlock(const base::ListValue* args); |
| 84 void HandleHardlockUserPod(const base::ListValue* args); | 85 void HandleHardlockUserPod(const base::ListValue* args); |
| 85 void HandleRemoveUserWarningLoadStats(const base::ListValue* args); | 86 void HandleRemoveUserWarningLoadStats(const base::ListValue* args); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 | 139 |
| 139 // The CancelableTaskTracker is currently used by GetProfileStatistics | 140 // The CancelableTaskTracker is currently used by GetProfileStatistics |
| 140 base::CancelableTaskTracker tracker_; | 141 base::CancelableTaskTracker tracker_; |
| 141 | 142 |
| 142 base::WeakPtrFactory<UserManagerScreenHandler> weak_ptr_factory_; | 143 base::WeakPtrFactory<UserManagerScreenHandler> weak_ptr_factory_; |
| 143 | 144 |
| 144 DISALLOW_COPY_AND_ASSIGN(UserManagerScreenHandler); | 145 DISALLOW_COPY_AND_ASSIGN(UserManagerScreenHandler); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ | 148 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_USER_MANAGER_SCREEN_HANDLER_H_ |
| OLD | NEW |