| OLD | NEW |
| 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 Loading... |
| 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 rfh->Send(new FrameMsg_MixedContentFound( | 97 FrameMsg_MixedContentFound_Params params; |
| 98 rfh->GetRoutingID(), mixed_content_url, navigation_handle->GetURL(), | 98 params.main_resource_url = mixed_content_url; |
| 99 navigation_handle->request_context_type(), was_allowed, for_redirect)); | 99 params.mixed_content_url = navigation_handle->GetURL(); |
| 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)); |
| 100 } | 106 } |
| 101 | 107 |
| 102 } // namespace | 108 } // namespace |
| 103 | 109 |
| 104 namespace content { | 110 namespace content { |
| 105 | 111 |
| 106 // static | 112 // static |
| 107 std::unique_ptr<NavigationThrottle> | 113 std::unique_ptr<NavigationThrottle> |
| 108 MixedContentNavigationThrottle::CreateThrottleForNavigation( | 114 MixedContentNavigationThrottle::CreateThrottleForNavigation( |
| 109 NavigationHandle* navigation_handle) { | 115 NavigationHandle* navigation_handle) { |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 // static | 353 // static |
| 348 bool MixedContentNavigationThrottle::IsMixedContentForTesting( | 354 bool MixedContentNavigationThrottle::IsMixedContentForTesting( |
| 349 const GURL& origin_url, | 355 const GURL& origin_url, |
| 350 const GURL& url) { | 356 const GURL& url) { |
| 351 const url::Origin origin(origin_url); | 357 const url::Origin origin(origin_url); |
| 352 return !IsUrlPotentiallySecure(url) && | 358 return !IsUrlPotentiallySecure(url) && |
| 353 DoesOriginSchemeRestrictMixedContent(origin); | 359 DoesOriginSchemeRestrictMixedContent(origin); |
| 354 } | 360 } |
| 355 | 361 |
| 356 } // namespace content | 362 } // namespace content |
| OLD | NEW |