Create WebContentsObserver callbacks for notifications, remove notifications from SSLManager.
BUG=82582,170921
TEST=no functional change
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/23947003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221342 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index f0abbf2..db344d9 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2179,8 +2179,8 @@
const GURL& source_url,
const GURL& target_url) {
// TODO(creis): Remove this method and have the pre-rendering code listen to
- // the ResourceDispatcherHost's RESOURCE_RECEIVED_REDIRECT notification
- // instead. See http://crbug.com/78512.
+ // WebContentsObserver::DidGetRedirectForResourceRequest instead.
+ // See http://crbug.com/78512.
GURL validated_source_url(source_url);
GURL validated_target_url(target_url);
RenderProcessHost* render_process_host =
@@ -2279,6 +2279,12 @@
url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method,
mime_type, resource_type);
+ controller_.ssl_manager()->DidLoadFromMemoryCache(details);
+
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ DidLoadResourceFromMemoryCache(details));
+
+ // TODO(avi): Remove. http://crbug.com/170921
NotificationService::current()->Notify(
NOTIFICATION_LOAD_FROM_MEMORY_CACHE,
Source<NavigationController>(&controller_),
@@ -2939,6 +2945,34 @@
FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh));
}
+void WebContentsImpl::DidGetResourceResponseStart(
+ const ResourceRequestDetails& details) {
+ controller_.ssl_manager()->DidStartResourceResponse(details);
+
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ DidGetResourceResponseStart(details));
+
+ // TODO(avi): Remove. http://crbug.com/170921
+ NotificationService::current()->Notify(
+ NOTIFICATION_RESOURCE_RESPONSE_STARTED,
+ Source<WebContents>(this),
+ Details<const ResourceRequestDetails>(&details));
+}
+
+void WebContentsImpl::DidGetRedirectForResourceRequest(
+ const ResourceRedirectDetails& details) {
+ controller_.ssl_manager()->DidReceiveResourceRedirect(details);
+
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ DidGetRedirectForResourceRequest(details));
+
+ // TODO(avi): Remove. http://crbug.com/170921
+ NotificationService::current()->Notify(
+ NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
+ Source<WebContents>(this),
+ Details<const ResourceRedirectDetails>(&details));
+}
+
void WebContentsImpl::DidNavigate(
RenderViewHost* rvh,
const ViewHostMsg_FrameNavigate_Params& params) {