| 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 CONTENT_BROWSER_SSL_SSL_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_SSL_SSL_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_SSL_SSL_MANAGER_H_ | 6 #define CONTENT_BROWSER_SSL_SSL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "content/browser/ssl/ssl_policy_backend.h" | 13 #include "content/browser/ssl/ssl_policy_backend.h" |
| 14 #include "content/browser/ssl/ssl_error_handler.h" | 14 #include "content/browser/ssl/ssl_error_handler.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "content/public/browser/global_request_id.h" | 16 #include "content/public/browser/global_request_id.h" |
| 17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 #include "net/base/cert_status_flags.h" | 20 #include "net/base/cert_status_flags.h" |
| 21 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
| 22 | 22 |
| 23 class NavigationControllerImpl; | |
| 24 class SSLPolicy; | 23 class SSLPolicy; |
| 25 | 24 |
| 26 namespace content { | 25 namespace content { |
| 27 class NavigationEntryImpl; | 26 class NavigationEntryImpl; |
| 27 class NavigationControllerImpl; |
| 28 struct LoadFromMemoryCacheDetails; | 28 struct LoadFromMemoryCacheDetails; |
| 29 struct ResourceRedirectDetails; | 29 struct ResourceRedirectDetails; |
| 30 struct ResourceRequestDetails; | 30 struct ResourceRequestDetails; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace net { | 33 namespace net { |
| 34 class SSLInfo; | 34 class SSLInfo; |
| 35 } | 35 } |
| 36 | 36 |
| 37 // The SSLManager SSLManager controls the SSL UI elements in a WebContents. It | 37 // The SSLManager SSLManager controls the SSL UI elements in a WebContents. It |
| (...skipping 18 matching lines...) Expand all Loading... |
| 56 ResourceType::Type resource_type, | 56 ResourceType::Type resource_type, |
| 57 const GURL& url, | 57 const GURL& url, |
| 58 int render_process_id, | 58 int render_process_id, |
| 59 int render_view_id, | 59 int render_view_id, |
| 60 const net::SSLInfo& ssl_info, | 60 const net::SSLInfo& ssl_info, |
| 61 bool fatal); | 61 bool fatal); |
| 62 | 62 |
| 63 // Called when SSL state for a host or tab changes. Broadcasts the | 63 // Called when SSL state for a host or tab changes. Broadcasts the |
| 64 // SSL_INTERNAL_STATE_CHANGED notification. | 64 // SSL_INTERNAL_STATE_CHANGED notification. |
| 65 static void NotifySSLInternalStateChanged( | 65 static void NotifySSLInternalStateChanged( |
| 66 NavigationControllerImpl* controller); | 66 content::NavigationControllerImpl* controller); |
| 67 | 67 |
| 68 // Construct an SSLManager for the specified tab. | 68 // Construct an SSLManager for the specified tab. |
| 69 // If |delegate| is NULL, SSLPolicy::GetDefaultPolicy() is used. | 69 // If |delegate| is NULL, SSLPolicy::GetDefaultPolicy() is used. |
| 70 explicit SSLManager(NavigationControllerImpl* controller); | 70 explicit SSLManager(content::NavigationControllerImpl* controller); |
| 71 virtual ~SSLManager(); | 71 virtual ~SSLManager(); |
| 72 | 72 |
| 73 SSLPolicy* policy() { return policy_.get(); } | 73 SSLPolicy* policy() { return policy_.get(); } |
| 74 SSLPolicyBackend* backend() { return &backend_; } | 74 SSLPolicyBackend* backend() { return &backend_; } |
| 75 | 75 |
| 76 // The navigation controller associated with this SSLManager. The | 76 // The navigation controller associated with this SSLManager. The |
| 77 // NavigationController is guaranteed to outlive the SSLManager. | 77 // NavigationController is guaranteed to outlive the SSLManager. |
| 78 NavigationControllerImpl* controller() { return controller_; } | 78 content::NavigationControllerImpl* controller() { return controller_; } |
| 79 | 79 |
| 80 // This entry point is called directly (instead of via the notification | 80 // This entry point is called directly (instead of via the notification |
| 81 // service) because we need more precise control of the order in which folks | 81 // service) because we need more precise control of the order in which folks |
| 82 // are notified of this event. | 82 // are notified of this event. |
| 83 void DidCommitProvisionalLoad(const content::NotificationDetails& details); | 83 void DidCommitProvisionalLoad(const content::NotificationDetails& details); |
| 84 | 84 |
| 85 // Insecure content entry point. | 85 // Insecure content entry point. |
| 86 void DidRunInsecureContent(const std::string& security_origin); | 86 void DidRunInsecureContent(const std::string& security_origin); |
| 87 | 87 |
| 88 // Entry point for navigation. This function begins the process of updating | 88 // Entry point for navigation. This function begins the process of updating |
| (...skipping 18 matching lines...) Expand all Loading... |
| 107 void UpdateEntry(content::NavigationEntryImpl* entry); | 107 void UpdateEntry(content::NavigationEntryImpl* entry); |
| 108 | 108 |
| 109 // The backend for the SSLPolicy to actuate its decisions. | 109 // The backend for the SSLPolicy to actuate its decisions. |
| 110 SSLPolicyBackend backend_; | 110 SSLPolicyBackend backend_; |
| 111 | 111 |
| 112 // The SSLPolicy instance for this manager. | 112 // The SSLPolicy instance for this manager. |
| 113 scoped_ptr<SSLPolicy> policy_; | 113 scoped_ptr<SSLPolicy> policy_; |
| 114 | 114 |
| 115 // The NavigationController that owns this SSLManager. We are responsible | 115 // The NavigationController that owns this SSLManager. We are responsible |
| 116 // for the security UI of this tab. | 116 // for the security UI of this tab. |
| 117 NavigationControllerImpl* controller_; | 117 content::NavigationControllerImpl* controller_; |
| 118 | 118 |
| 119 // Handles registering notifications with the NotificationService. | 119 // Handles registering notifications with the NotificationService. |
| 120 content::NotificationRegistrar registrar_; | 120 content::NotificationRegistrar registrar_; |
| 121 | 121 |
| 122 DISALLOW_COPY_AND_ASSIGN(SSLManager); | 122 DISALLOW_COPY_AND_ASSIGN(SSLManager); |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 #endif // CONTENT_BROWSER_SSL_SSL_MANAGER_H_ | 125 #endif // CONTENT_BROWSER_SSL_SSL_MANAGER_H_ |
| OLD | NEW |