Index: chrome/browser/ui/login/login_handler.h |
diff --git a/chrome/browser/ui/login/login_handler.h b/chrome/browser/ui/login/login_handler.h |
index 9e66547bd99179298af24b3f91b64d4b68f6113e..fb058fcf0d310e4ef2cb96c46487642524d48f6b 100644 |
--- a/chrome/browser/ui/login/login_handler.h |
+++ b/chrome/browser/ui/login/login_handler.h |
@@ -8,6 +8,7 @@ |
#include <memory> |
#include <string> |
+#include "base/gtest_prod_util.h" |
#include "base/macros.h" |
#include "base/memory/weak_ptr.h" |
#include "base/synchronization/lock.h" |
@@ -135,6 +136,10 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate, |
virtual void CloseDialog() = 0; |
private: |
+ friend LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, |
+ net::URLRequest* request); |
+ FRIEND_TEST_ALL_PREFIXES(LoginHandlerTest, Outputs); |
+ |
// Starts observing notifications from other LoginHandlers. |
void AddObservers(); |
@@ -166,6 +171,45 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate, |
// Closes the view_contents from the UI loop. |
void CloseContentsDeferred(); |
+ // Get the signon_realm under which this auth info should be stored. |
+ // |
+ // The format of the signon_realm for proxy auth is: |
+ // proxy-host:proxy-port/auth-realm |
+ // The format of the signon_realm for server auth is: |
+ // url-scheme://url-host[:url-port]/auth-realm |
+ // |
+ // Be careful when changing this function, since you could make existing |
+ // saved logins un-retrievable. |
+ static std::string GetSignonRealm(const GURL& url, |
+ const net::AuthChallengeInfo& auth_info); |
+ |
+ // Helper to create a PasswordForm for PasswordManager to start looking for |
+ // saved credentials. |
+ static autofill::PasswordForm MakeInputForPasswordManager( |
+ const GURL& url, |
+ const net::AuthChallengeInfo& auth_info); |
+ |
+ static void GetDialogStrings(const GURL& request_url, |
+ const net::AuthChallengeInfo& auth_info, |
+ base::string16* authority, |
+ base::string16* explanation); |
+ |
+ static void ShowLoginPrompt(const GURL& request_url, |
+ net::AuthChallengeInfo* auth_info, |
+ LoginHandler* handler); |
+ |
+ // This callback is run on the UI thread and creates a constrained window with |
+ // a LoginView to prompt the user. If the prompt is triggered because of a |
+ // cross origin navigation in the main frame, a blank interstitial is first |
+ // created which in turn creates the LoginView. Otherwise, a LoginView is |
+ // directly in this callback. In both cases, the response will be sent to |
meacer
2016/06/16 01:12:15
directly -> created directly
asanka
2016/06/16 16:25:47
Done.
|
+ // LoginHandler, which then routes it to the net::URLRequest on the I/O |
+ // thread. |
+ static void LoginDialogCallback(const GURL& request_url, |
+ net::AuthChallengeInfo* auth_info, |
+ LoginHandler* handler, |
+ bool is_main_frame); |
+ |
// True if we've handled auth (SetAuth or CancelAuth has been called). |
bool handled_auth_; |
mutable base::Lock handled_auth_lock_; |
@@ -180,8 +224,10 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate, |
// The HttpNetworkSession |request_| is associated with. |
const net::HttpNetworkSession* http_network_session_; |
- // The PasswordForm sent to the PasswordManager. This is so we can refer to it |
- // when later notifying the password manager if the credentials were accepted |
+ // The PasswordForm sent to the PasswordManager. This is so we can refer to |
vabr (Chromium)
2016/06/15 08:50:06
nit: Seems like these two lines could have stayed
asanka
2016/06/16 16:25:47
Reformatted.
|
+ // it |
+ // when later notifying the password manager if the credentials were |
+ // accepted |
// or rejected. |
// This should only be accessed on the UI loop. |
autofill::PasswordForm password_form_; |
@@ -256,8 +302,4 @@ class AuthSuppliedLoginNotificationDetails : public LoginNotificationDetails { |
LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, |
net::URLRequest* request); |
-// Get the signon_realm under which the identity should be saved. |
-std::string GetSignonRealm(const GURL& url, |
- const net::AuthChallengeInfo& auth_info); |
- |
#endif // CHROME_BROWSER_UI_LOGIN_LOGIN_HANDLER_H_ |