| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "content/browser/ssl/ssl_policy_backend.h" | 14 #include "content/browser/ssl/ssl_policy_backend.h" |
| 15 #include "content/browser/ssl/ssl_error_handler.h" | 15 #include "content/browser/ssl/ssl_error_handler.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "content/public/browser/global_request_id.h" | 17 #include "content/public/browser/global_request_id.h" |
| 18 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
| 21 #include "net/base/cert_status_flags.h" | 21 #include "net/base/cert_status_flags.h" |
| 22 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
| 23 | 23 |
| 24 class LoadFromMemoryCacheDetails; | |
| 25 class NavigationControllerImpl; | 24 class NavigationControllerImpl; |
| 26 class SSLPolicy; | 25 class SSLPolicy; |
| 27 | 26 |
| 28 namespace content { | 27 namespace content { |
| 29 class NavigationEntryImpl; | 28 class NavigationEntryImpl; |
| 29 struct LoadFromMemoryCacheDetails; |
| 30 struct ResourceRedirectDetails; | 30 struct ResourceRedirectDetails; |
| 31 struct ResourceRequestDetails; | 31 struct ResourceRequestDetails; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace net { | 34 namespace net { |
| 35 class SSLInfo; | 35 class SSLInfo; |
| 36 } | 36 } |
| 37 | 37 |
| 38 // The SSLManager SSLManager controls the SSL UI elements in a WebContents. It | 38 // The SSLManager SSLManager controls the SSL UI elements in a WebContents. It |
| 39 // listens for various events that influence when these elements should or | 39 // listens for various events that influence when these elements should or |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // Called on the UI thread. | 92 // Called on the UI thread. |
| 93 virtual void Observe(int type, | 93 virtual void Observe(int type, |
| 94 const content::NotificationSource& source, | 94 const content::NotificationSource& source, |
| 95 const content::NotificationDetails& details) OVERRIDE; | 95 const content::NotificationDetails& details) OVERRIDE; |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 // Entry points for notifications to which we subscribe. Note that | 98 // Entry points for notifications to which we subscribe. Note that |
| 99 // DidCommitProvisionalLoad uses the abstract NotificationDetails type since | 99 // DidCommitProvisionalLoad uses the abstract NotificationDetails type since |
| 100 // the type we need is in NavigationController which would create a circular | 100 // the type we need is in NavigationController which would create a circular |
| 101 // header file dependency. | 101 // header file dependency. |
| 102 void DidLoadFromMemoryCache(LoadFromMemoryCacheDetails* details); | 102 void DidLoadFromMemoryCache(content::LoadFromMemoryCacheDetails* details); |
| 103 void DidStartResourceResponse(content::ResourceRequestDetails* details); | 103 void DidStartResourceResponse(content::ResourceRequestDetails* details); |
| 104 void DidReceiveResourceRedirect(content::ResourceRedirectDetails* details); | 104 void DidReceiveResourceRedirect(content::ResourceRedirectDetails* details); |
| 105 void DidChangeSSLInternalState(); | 105 void DidChangeSSLInternalState(); |
| 106 | 106 |
| 107 // Update the NavigationEntry with our current state. | 107 // Update the NavigationEntry with our current state. |
| 108 void UpdateEntry(content::NavigationEntryImpl* entry); | 108 void UpdateEntry(content::NavigationEntryImpl* entry); |
| 109 | 109 |
| 110 // The backend for the SSLPolicy to actuate its decisions. | 110 // The backend for the SSLPolicy to actuate its decisions. |
| 111 SSLPolicyBackend backend_; | 111 SSLPolicyBackend backend_; |
| 112 | 112 |
| 113 // The SSLPolicy instance for this manager. | 113 // The SSLPolicy instance for this manager. |
| 114 scoped_ptr<SSLPolicy> policy_; | 114 scoped_ptr<SSLPolicy> policy_; |
| 115 | 115 |
| 116 // The NavigationController that owns this SSLManager. We are responsible | 116 // The NavigationController that owns this SSLManager. We are responsible |
| 117 // for the security UI of this tab. | 117 // for the security UI of this tab. |
| 118 NavigationControllerImpl* controller_; | 118 NavigationControllerImpl* controller_; |
| 119 | 119 |
| 120 // Handles registering notifications with the NotificationService. | 120 // Handles registering notifications with the NotificationService. |
| 121 content::NotificationRegistrar registrar_; | 121 content::NotificationRegistrar registrar_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(SSLManager); | 123 DISALLOW_COPY_AND_ASSIGN(SSLManager); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 #endif // CONTENT_BROWSER_SSL_SSL_MANAGER_H_ | 126 #endif // CONTENT_BROWSER_SSL_SSL_MANAGER_H_ |
| OLD | NEW |