| 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" |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "components/password_manager/core/browser/password_manager.h" | 12 #include "components/password_manager/core/browser/password_manager.h" |
| 13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
| 14 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" | 14 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 class NavigationEntry; |
| 20 class NotificationRegistrar; |
| 19 class RenderViewHostDelegate; | 21 class RenderViewHostDelegate; |
| 20 class NotificationRegistrar; | |
| 21 } // namespace content | 22 } // namespace content |
| 22 | 23 |
| 23 namespace net { | 24 namespace net { |
| 24 class AuthChallengeInfo; | 25 class AuthChallengeInfo; |
| 25 class HttpNetworkSession; | 26 class HttpNetworkSession; |
| 27 class SSLInfo; |
| 26 class URLRequest; | 28 class URLRequest; |
| 27 } // namespace net | 29 } // namespace net |
| 28 | 30 |
| 29 // This is the base implementation for the OS-specific classes that route | 31 // This is the base implementation for the OS-specific classes that route |
| 30 // authentication info to the net::URLRequest that needs it. These functions | 32 // authentication info to the net::URLRequest that needs it. These functions |
| 31 // must be implemented in a thread safe manner. | 33 // must be implemented in a thread safe manner. |
| 32 class LoginHandler : public content::ResourceDispatcherHostLoginDelegate, | 34 class LoginHandler : public content::ResourceDispatcherHostLoginDelegate, |
| 33 public password_manager::LoginModelObserver, | 35 public password_manager::LoginModelObserver, |
| 34 public content::NotificationObserver { | 36 public content::NotificationObserver { |
| 35 public: | 37 public: |
| 36 LoginHandler(net::AuthChallengeInfo* auth_info, net::URLRequest* request); | 38 LoginHandler(net::AuthChallengeInfo* auth_info, net::URLRequest* request); |
| 37 | 39 |
| 38 // Builds the platform specific LoginHandler. Used from within | 40 // Builds the platform specific LoginHandler. Used from within |
| 39 // CreateLoginPrompt() which creates tasks. | 41 // CreateLoginPrompt() which creates tasks. |
| 40 static LoginHandler* Create(net::AuthChallengeInfo* auth_info, | 42 static LoginHandler* Create(net::AuthChallengeInfo* auth_info, |
| 41 net::URLRequest* request); | 43 net::URLRequest* request); |
| 42 | 44 |
| 45 static void UpdateSSLState(content::NavigationEntry* entry, |
| 46 content::WebContents* contents, |
| 47 const net::SSLInfo& ssl_info); |
| 48 |
| 43 // ResourceDispatcherHostLoginDelegate implementation: | 49 // ResourceDispatcherHostLoginDelegate implementation: |
| 44 virtual void OnRequestCancelled() OVERRIDE; | 50 virtual void OnRequestCancelled() OVERRIDE; |
| 45 | 51 |
| 46 // Initializes the underlying platform specific view. | 52 // Initializes the underlying platform specific view. |
| 47 virtual void BuildViewForPasswordManager( | 53 virtual void BuildViewForPasswordManager( |
| 48 password_manager::PasswordManager* manager, | 54 password_manager::PasswordManager* manager, |
| 49 const base::string16& explanation) = 0; | 55 const base::string16& explanation) = 0; |
| 50 | 56 |
| 51 // Sets information about the authentication type (|form|) and the | 57 // Sets information about the authentication type (|form|) and the |
| 52 // |password_manager| for this profile. | 58 // |password_manager| for this profile. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // Helper to remove the ref from an net::URLRequest to the LoginHandler. | 218 // Helper to remove the ref from an net::URLRequest to the LoginHandler. |
| 213 // Should only be called from the IO thread, since it accesses an | 219 // Should only be called from the IO thread, since it accesses an |
| 214 // net::URLRequest. | 220 // net::URLRequest. |
| 215 void ResetLoginHandlerForRequest(net::URLRequest* request); | 221 void ResetLoginHandlerForRequest(net::URLRequest* request); |
| 216 | 222 |
| 217 // Get the signon_realm under which the identity should be saved. | 223 // Get the signon_realm under which the identity should be saved. |
| 218 std::string GetSignonRealm(const GURL& url, | 224 std::string GetSignonRealm(const GURL& url, |
| 219 const net::AuthChallengeInfo& auth_info); | 225 const net::AuthChallengeInfo& auth_info); |
| 220 | 226 |
| 221 #endif // CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_ | 227 #endif // CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_ |
| OLD | NEW |