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

Side by Side Diff: content/browser/frame_host/mixed_content_navigation_throttle.cc

Issue 2765643002: Revert of PlzNavigate: send SourceLocation when mixed content is found (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | content/browser/frame_host/navigation_handle_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/frame_host/mixed_content_navigation_throttle.h" 5 #include "content/browser/frame_host/mixed_content_navigation_throttle.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "content/browser/frame_host/frame_tree.h" 9 #include "content/browser/frame_host/frame_tree.h"
10 #include "content/browser/frame_host/frame_tree_node.h" 10 #include "content/browser/frame_host/frame_tree_node.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 const GURL& mixed_content_url, 87 const GURL& mixed_content_url,
88 bool was_allowed, 88 bool was_allowed,
89 bool for_redirect) { 89 bool for_redirect) {
90 // TODO(carlosk): the root node should never be considered as being/having 90 // TODO(carlosk): the root node should never be considered as being/having
91 // mixed content for now. Once/if the browser should also check form submits 91 // mixed content for now. Once/if the browser should also check form submits
92 // for mixed content than this will be allowed to happen and this DCHECK 92 // for mixed content than this will be allowed to happen and this DCHECK
93 // should be updated. 93 // should be updated.
94 DCHECK(navigation_handle->frame_tree_node()->parent()); 94 DCHECK(navigation_handle->frame_tree_node()->parent());
95 RenderFrameHost* rfh = 95 RenderFrameHost* rfh =
96 navigation_handle->frame_tree_node()->current_frame_host(); 96 navigation_handle->frame_tree_node()->current_frame_host();
97 FrameMsg_MixedContentFound_Params params; 97 rfh->Send(new FrameMsg_MixedContentFound(
98 params.main_resource_url = mixed_content_url; 98 rfh->GetRoutingID(), mixed_content_url, navigation_handle->GetURL(),
99 params.mixed_content_url = navigation_handle->GetURL(); 99 navigation_handle->request_context_type(), was_allowed, for_redirect));
100 params.request_context_type = navigation_handle->request_context_type();
101 params.was_allowed = was_allowed;
102 params.had_redirect = for_redirect;
103 params.source_location = navigation_handle->source_location();
104
105 rfh->Send(new FrameMsg_MixedContentFound(rfh->GetRoutingID(), params));
106 } 100 }
107 101
108 } // namespace 102 } // namespace
109 103
110 namespace content { 104 namespace content {
111 105
112 // static 106 // static
113 std::unique_ptr<NavigationThrottle> 107 std::unique_ptr<NavigationThrottle>
114 MixedContentNavigationThrottle::CreateThrottleForNavigation( 108 MixedContentNavigationThrottle::CreateThrottleForNavigation(
115 NavigationHandle* navigation_handle) { 109 NavigationHandle* navigation_handle) {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 // static 347 // static
354 bool MixedContentNavigationThrottle::IsMixedContentForTesting( 348 bool MixedContentNavigationThrottle::IsMixedContentForTesting(
355 const GURL& origin_url, 349 const GURL& origin_url,
356 const GURL& url) { 350 const GURL& url) {
357 const url::Origin origin(origin_url); 351 const url::Origin origin(origin_url);
358 return !IsUrlPotentiallySecure(url) && 352 return !IsUrlPotentiallySecure(url) &&
359 DoesOriginSchemeRestrictMixedContent(origin); 353 DoesOriginSchemeRestrictMixedContent(origin);
360 } 354 }
361 355
362 } // namespace content 356 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698