| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_UI_USER_MANAGER_H_ |
| 6 #define CHROME_BROWSER_UI_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_UI_USER_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "chrome/browser/profiles/profile_window.h" | 10 #include "chrome/browser/profiles/profile_window.h" |
| 11 #include "components/signin/core/browser/signin_metrics.h" | 11 #include "components/signin/core/browser/signin_metrics.h" |
| 12 #include "content/public/browser/web_contents_delegate.h" |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 class FilePath; | 15 class FilePath; |
| 15 } | 16 } |
| 16 | 17 |
| 17 // Cross-platform methods for displaying the user manager. | 18 // Cross-platform methods for displaying the user manager. |
| 18 class UserManager { | 19 class UserManager { |
| 19 public: | 20 public: |
| 20 // Shows the User Manager or re-activates an existing one, focusing the | 21 // Shows the User Manager or re-activates an existing one, focusing the |
| 21 // profile given by |profile_path_to_focus|; passing an empty base::FilePath | 22 // profile given by |profile_path_to_focus|; passing an empty base::FilePath |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Dimensions of the reauth dialog displaying the old-style signin flow with | 63 // Dimensions of the reauth dialog displaying the old-style signin flow with |
| 63 // the username and password challenge on the same form. | 64 // the username and password challenge on the same form. |
| 64 static const int kPasswordCombinedReauthDialogHeight = 440; | 65 static const int kPasswordCombinedReauthDialogHeight = 440; |
| 65 static const int kPasswordCombinedReauthDialogWidth = 360; | 66 static const int kPasswordCombinedReauthDialogWidth = 360; |
| 66 | 67 |
| 67 // Dimensions of the reauth dialog displaying the password-separated signin | 68 // Dimensions of the reauth dialog displaying the password-separated signin |
| 68 // flow. | 69 // flow. |
| 69 static const int kReauthDialogHeight = 512; | 70 static const int kReauthDialogHeight = 512; |
| 70 static const int kReauthDialogWidth = 448; | 71 static const int kReauthDialogWidth = 448; |
| 71 | 72 |
| 72 // This class observes the WebUI used in the UserManager to perform online | 73 // Abstract base class for performing online reauthentication of profiles in |
| 73 // reauthentication of locked profiles. It is concretely implemented in | 74 // the User Manager. It is concretely implemented in UserManagerMac and |
| 74 // UserManagerMac and UserManagerView to specialize the closing of the UI's | 75 // UserManagerView to specialize the closing of the UI's dialog widgets. |
| 75 // dialog widget. | 76 class BaseReauthDialogDelegate : public content::WebContentsDelegate { |
| 76 class ReauthDialogObserver : public content::WebContentsObserver { | |
| 77 public: | 77 public: |
| 78 ReauthDialogObserver(content::WebContents* web_contents, | 78 BaseReauthDialogDelegate(); |
| 79 const std::string& email_address); | 79 |
| 80 // content::WebContentsDelegate: |
| 81 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
| 82 |
| 83 // content::WebContentsDelegate: |
| 84 void LoadingStateChanged(content::WebContents* source, |
| 85 bool to_different_document) override; |
| 80 | 86 |
| 81 private: | 87 private: |
| 82 // content::WebContentsObserver: | |
| 83 void DidStopLoading() override; | |
| 84 | |
| 85 virtual void CloseReauthDialog() = 0; | 88 virtual void CloseReauthDialog() = 0; |
| 86 | 89 |
| 87 const std::string email_address_; | 90 // WebContents of the embedded WebView. |
| 91 content::WebContents* guest_web_contents_; |
| 88 | 92 |
| 89 DISALLOW_COPY_AND_ASSIGN(ReauthDialogObserver); | 93 DISALLOW_COPY_AND_ASSIGN(BaseReauthDialogDelegate); |
| 90 }; | 94 }; |
| 91 | 95 |
| 92 private: | 96 private: |
| 93 DISALLOW_COPY_AND_ASSIGN(UserManager); | 97 DISALLOW_COPY_AND_ASSIGN(UserManager); |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 #endif // CHROME_BROWSER_UI_USER_MANAGER_H_ | 100 #endif // CHROME_BROWSER_UI_USER_MANAGER_H_ |
| OLD | NEW |