| 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_UI_LOGIN_LOGIN_PROMPT_H_ | 5 #ifndef CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_ |
| 6 #define CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_ | 6 #define CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const base::WeakPtr<LoginInterstitialDelegate> delegate) { | 62 const base::WeakPtr<LoginInterstitialDelegate> delegate) { |
| 63 interstitial_delegate_ = delegate; | 63 interstitial_delegate_ = delegate; |
| 64 } | 64 } |
| 65 | 65 |
| 66 // ResourceDispatcherHostLoginDelegate implementation: | 66 // ResourceDispatcherHostLoginDelegate implementation: |
| 67 void OnRequestCancelled() override; | 67 void OnRequestCancelled() override; |
| 68 | 68 |
| 69 // Use this to build a view with password manager support. |password_manager| | 69 // Use this to build a view with password manager support. |password_manager| |
| 70 // must not be null. | 70 // must not be null. |
| 71 void BuildViewWithPasswordManager( | 71 void BuildViewWithPasswordManager( |
| 72 const base::string16& authority, |
| 72 const base::string16& explanation, | 73 const base::string16& explanation, |
| 73 password_manager::PasswordManager* password_manager, | 74 password_manager::PasswordManager* password_manager, |
| 74 const autofill::PasswordForm& observed_form); | 75 const autofill::PasswordForm& observed_form); |
| 75 | 76 |
| 76 // Use this to build a view without password manager support. | 77 // Use this to build a view without password manager support. |
| 77 void BuildViewWithoutPasswordManager(const base::string16& explanation); | 78 void BuildViewWithoutPasswordManager(const base::string16& authority, |
| 79 const base::string16& explanation); |
| 78 | 80 |
| 79 // Returns the WebContents that needs authentication. | 81 // Returns the WebContents that needs authentication. |
| 80 content::WebContents* GetWebContentsForLogin() const; | 82 content::WebContents* GetWebContentsForLogin() const; |
| 81 | 83 |
| 82 // Returns the PasswordManager for the web contents that needs login. | 84 // Returns the PasswordManager for the web contents that needs login. |
| 83 password_manager::PasswordManager* GetPasswordManagerForLogin(); | 85 password_manager::PasswordManager* GetPasswordManagerForLogin(); |
| 84 | 86 |
| 85 // Resend the request with authentication credentials. | 87 // Resend the request with authentication credentials. |
| 86 // This function can be called from either thread. | 88 // This function can be called from either thread. |
| 87 void SetAuth(const base::string16& username, const base::string16& password); | 89 void SetAuth(const base::string16& username, const base::string16& password); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 103 | 105 |
| 104 // Returns whether authentication had been handled (SetAuth or CancelAuth). | 106 // Returns whether authentication had been handled (SetAuth or CancelAuth). |
| 105 bool WasAuthHandled() const; | 107 bool WasAuthHandled() const; |
| 106 | 108 |
| 107 protected: | 109 protected: |
| 108 ~LoginHandler() override; | 110 ~LoginHandler() override; |
| 109 | 111 |
| 110 // Implement this to initialize the underlying platform specific view. If | 112 // Implement this to initialize the underlying platform specific view. If |
| 111 // |login_model_data| is not null, the contained LoginModel and PasswordForm | 113 // |login_model_data| is not null, the contained LoginModel and PasswordForm |
| 112 // can be used to register the view. | 114 // can be used to register the view. |
| 113 virtual void BuildViewImpl(const base::string16& explanation, | 115 virtual void BuildViewImpl(const base::string16& authority, |
| 116 const base::string16& explanation, |
| 114 LoginModelData* login_model_data) = 0; | 117 LoginModelData* login_model_data) = 0; |
| 115 | 118 |
| 116 // Sets |model_data.model| as |login_model_| and registers |this| as an | 119 // Sets |model_data.model| as |login_model_| and registers |this| as an |
| 117 // observer for |model_data.form|-related events. | 120 // observer for |model_data.form|-related events. |
| 118 void SetModel(LoginModelData model_data); | 121 void SetModel(LoginModelData model_data); |
| 119 | 122 |
| 120 // Clears |login_model_| and removes |this| as an observer. | 123 // Clears |login_model_| and removes |this| as an observer. |
| 121 void ResetModel(); | 124 void ResetModel(); |
| 122 | 125 |
| 123 // Notify observers that authentication is needed. | 126 // Notify observers that authentication is needed. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // caller must invoke OnRequestCancelled() on this LoginHandler before | 253 // caller must invoke OnRequestCancelled() on this LoginHandler before |
| 251 // destroying the net::URLRequest. | 254 // destroying the net::URLRequest. |
| 252 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, | 255 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, |
| 253 net::URLRequest* request); | 256 net::URLRequest* request); |
| 254 | 257 |
| 255 // Get the signon_realm under which the identity should be saved. | 258 // Get the signon_realm under which the identity should be saved. |
| 256 std::string GetSignonRealm(const GURL& url, | 259 std::string GetSignonRealm(const GURL& url, |
| 257 const net::AuthChallengeInfo& auth_info); | 260 const net::AuthChallengeInfo& auth_info); |
| 258 | 261 |
| 259 #endif // CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_ | 262 #endif // CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_ |
| OLD | NEW |