Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 181253003: Downgrade page security if an inline has invalid certificate. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated browser test & formatting fix. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/data/ssl/page_with_dynamic_insecure_content.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 if (browser_plugin_embedder_.get()) 1874 if (browser_plugin_embedder_.get())
1875 browser_plugin_embedder_->DragSourceMovedTo(client_x, client_y, 1875 browser_plugin_embedder_->DragSourceMovedTo(client_x, client_y,
1876 screen_x, screen_y); 1876 screen_x, screen_y);
1877 if (GetRenderViewHost()) 1877 if (GetRenderViewHost())
1878 GetRenderViewHostImpl()->DragSourceMovedTo(client_x, client_y, 1878 GetRenderViewHostImpl()->DragSourceMovedTo(client_x, client_y,
1879 screen_x, screen_y); 1879 screen_x, screen_y);
1880 } 1880 }
1881 1881
1882 void WebContentsImpl::DidGetResourceResponseStart( 1882 void WebContentsImpl::DidGetResourceResponseStart(
1883 const ResourceRequestDetails& details) { 1883 const ResourceRequestDetails& details) {
1884
1885 if (net::IsCertStatusError(details.ssl_cert_status))
1886 displayed_insecure_content_ = true;
Charlie Reis 2014/04/09 17:20:17 I think the main thing that confused me was that i
1887
1884 controller_.ssl_manager()->DidStartResourceResponse(details); 1888 controller_.ssl_manager()->DidStartResourceResponse(details);
1885 1889
1886 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 1890 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
1887 DidGetResourceResponseStart(details)); 1891 DidGetResourceResponseStart(details));
1888 1892
1889 // TODO(avi): Remove. http://crbug.com/170921 1893 // TODO(avi): Remove. http://crbug.com/170921
1890 NotificationService::current()->Notify( 1894 NotificationService::current()->Notify(
1891 NOTIFICATION_RESOURCE_RESPONSE_STARTED, 1895 NOTIFICATION_RESOURCE_RESPONSE_STARTED,
1892 Source<WebContents>(this), 1896 Source<WebContents>(this),
1893 Details<const ResourceRequestDetails>(&details)); 1897 Details<const ResourceRequestDetails>(&details));
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 int connection_status = 0; 2269 int connection_status = 0;
2266 SignedCertificateTimestampIDStatusList signed_certificate_timestamp_ids; 2270 SignedCertificateTimestampIDStatusList signed_certificate_timestamp_ids;
2267 DeserializeSecurityInfo(security_info, &cert_id, &cert_status, 2271 DeserializeSecurityInfo(security_info, &cert_id, &cert_status,
2268 &security_bits, &connection_status, 2272 &security_bits, &connection_status,
2269 &signed_certificate_timestamp_ids); 2273 &signed_certificate_timestamp_ids);
2270 // TODO(alcutter,eranm): Pass signed_certificate_timestamp_ids into details 2274 // TODO(alcutter,eranm): Pass signed_certificate_timestamp_ids into details
2271 LoadFromMemoryCacheDetails details( 2275 LoadFromMemoryCacheDetails details(
2272 url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method, 2276 url, GetRenderProcessHost()->GetID(), cert_id, cert_status, http_method,
2273 mime_type, resource_type); 2277 mime_type, resource_type);
2274 2278
2279 if (net::IsCertStatusError(cert_status))
2280 displayed_insecure_content_ = true;
2281
2275 controller_.ssl_manager()->DidLoadFromMemoryCache(details); 2282 controller_.ssl_manager()->DidLoadFromMemoryCache(details);
2276 2283
2277 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2284 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2278 DidLoadResourceFromMemoryCache(details)); 2285 DidLoadResourceFromMemoryCache(details));
2279 2286
2280 if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) { 2287 if (url.is_valid() && url.SchemeIsHTTPOrHTTPS()) {
2281 scoped_refptr<net::URLRequestContextGetter> request_context( 2288 scoped_refptr<net::URLRequestContextGetter> request_context(
2282 resource_type == ResourceType::MEDIA ? 2289 resource_type == ResourceType::MEDIA ?
2283 GetBrowserContext()->GetMediaRequestContextForRenderProcess( 2290 GetBrowserContext()->GetMediaRequestContextForRenderProcess(
2284 GetRenderProcessHost()->GetID()) : 2291 GetRenderProcessHost()->GetID()) :
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
3630 3637
3631 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { 3638 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) {
3632 if (!delegate_) 3639 if (!delegate_)
3633 return; 3640 return;
3634 const gfx::Size new_size = GetPreferredSize(); 3641 const gfx::Size new_size = GetPreferredSize();
3635 if (new_size != old_size) 3642 if (new_size != old_size)
3636 delegate_->UpdatePreferredSize(this, new_size); 3643 delegate_->UpdatePreferredSize(this, new_size);
3637 } 3644 }
3638 3645
3639 } // namespace content 3646 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/data/ssl/page_with_dynamic_insecure_content.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698