| 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 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "content/common/dom_storage/dom_storage_types.h" | 44 #include "content/common/dom_storage/dom_storage_types.h" |
| 45 #include "content/common/drag_messages.h" | 45 #include "content/common/drag_messages.h" |
| 46 #include "content/common/frame_messages.h" | 46 #include "content/common/frame_messages.h" |
| 47 #include "content/common/frame_replication_state.h" | 47 #include "content/common/frame_replication_state.h" |
| 48 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 48 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 49 #include "content/common/input_messages.h" | 49 #include "content/common/input_messages.h" |
| 50 #include "content/common/pepper_messages.h" | 50 #include "content/common/pepper_messages.h" |
| 51 #include "content/common/site_isolation_policy.h" | 51 #include "content/common/site_isolation_policy.h" |
| 52 #include "content/common/ssl_status_serialization.h" | 52 #include "content/common/ssl_status_serialization.h" |
| 53 #include "content/common/view_messages.h" | 53 #include "content/common/view_messages.h" |
| 54 #include "content/public/child/url_conversion.h" |
| 54 #include "content/public/common/bindings_policy.h" | 55 #include "content/public/common/bindings_policy.h" |
| 55 #include "content/public/common/content_client.h" | 56 #include "content/public/common/content_client.h" |
| 56 #include "content/public/common/content_constants.h" | 57 #include "content/public/common/content_constants.h" |
| 57 #include "content/public/common/content_switches.h" | 58 #include "content/public/common/content_switches.h" |
| 58 #include "content/public/common/drop_data.h" | 59 #include "content/public/common/drop_data.h" |
| 59 #include "content/public/common/favicon_url.h" | 60 #include "content/public/common/favicon_url.h" |
| 60 #include "content/public/common/file_chooser_file_info.h" | 61 #include "content/public/common/file_chooser_file_info.h" |
| 61 #include "content/public/common/file_chooser_params.h" | 62 #include "content/public/common/file_chooser_params.h" |
| 62 #include "content/public/common/page_importance_signals.h" | 63 #include "content/public/common/page_importance_signals.h" |
| 63 #include "content/public/common/page_state.h" | 64 #include "content/public/common/page_state.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 #endif | 310 #endif |
| 310 | 311 |
| 311 static RenderViewImpl* (*g_create_render_view_impl)( | 312 static RenderViewImpl* (*g_create_render_view_impl)( |
| 312 CompositorDependencies* compositor_deps, | 313 CompositorDependencies* compositor_deps, |
| 313 const ViewMsg_New_Params&) = nullptr; | 314 const ViewMsg_New_Params&) = nullptr; |
| 314 | 315 |
| 315 // static | 316 // static |
| 316 Referrer RenderViewImpl::GetReferrerFromRequest( | 317 Referrer RenderViewImpl::GetReferrerFromRequest( |
| 317 WebFrame* frame, | 318 WebFrame* frame, |
| 318 const WebURLRequest& request) { | 319 const WebURLRequest& request) { |
| 319 return Referrer(GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))), | 320 return Referrer( |
| 320 request.referrerPolicy()); | 321 WebStringToGURL(request.httpHeaderField(WebString::fromUTF8("Referer"))), |
| 322 request.referrerPolicy()); |
| 321 } | 323 } |
| 322 | 324 |
| 323 // static | 325 // static |
| 324 WindowOpenDisposition RenderViewImpl::NavigationPolicyToDisposition( | 326 WindowOpenDisposition RenderViewImpl::NavigationPolicyToDisposition( |
| 325 WebNavigationPolicy policy) { | 327 WebNavigationPolicy policy) { |
| 326 switch (policy) { | 328 switch (policy) { |
| 327 case blink::WebNavigationPolicyIgnore: | 329 case blink::WebNavigationPolicyIgnore: |
| 328 return IGNORE_ACTION; | 330 return IGNORE_ACTION; |
| 329 case blink::WebNavigationPolicyDownload: | 331 case blink::WebNavigationPolicyDownload: |
| 330 return SAVE_TO_DISK; | 332 return SAVE_TO_DISK; |
| (...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 // | 1601 // |
| 1600 // TODO(alexmos): This works fine for regular origins but may break path | 1602 // TODO(alexmos): This works fine for regular origins but may break path |
| 1601 // matching for file URLs with OOP subframes that open popups. This should | 1603 // matching for file URLs with OOP subframes that open popups. This should |
| 1602 // be fixed by either moving this lookup to the browser process or removing | 1604 // be fixed by either moving this lookup to the browser process or removing |
| 1603 // path-based matching for file URLs from content settings. See | 1605 // path-based matching for file URLs from content settings. See |
| 1604 // https://crbug.com/466297. | 1606 // https://crbug.com/466297. |
| 1605 if (creator->top()->isWebLocalFrame()) { | 1607 if (creator->top()->isWebLocalFrame()) { |
| 1606 params.opener_top_level_frame_url = creator->top()->document().url(); | 1608 params.opener_top_level_frame_url = creator->top()->document().url(); |
| 1607 } else { | 1609 } else { |
| 1608 params.opener_top_level_frame_url = | 1610 params.opener_top_level_frame_url = |
| 1609 GURL(creator->top()->securityOrigin().toString()); | 1611 WebStringToGURL(creator->top()->securityOrigin().toString()); |
| 1610 } | 1612 } |
| 1611 | 1613 |
| 1612 GURL security_url(creator->document().securityOrigin().toString()); | 1614 GURL security_url(WebStringToGURL( |
| 1615 creator->document().securityOrigin().toString())); |
| 1613 if (!security_url.is_valid()) | 1616 if (!security_url.is_valid()) |
| 1614 security_url = GURL(); | 1617 security_url = GURL(); |
| 1615 params.opener_security_origin = security_url; | 1618 params.opener_security_origin = security_url; |
| 1616 params.opener_suppressed = suppress_opener; | 1619 params.opener_suppressed = suppress_opener; |
| 1617 params.disposition = NavigationPolicyToDisposition(policy); | 1620 params.disposition = NavigationPolicyToDisposition(policy); |
| 1618 if (!request.isNull()) { | 1621 if (!request.isNull()) { |
| 1619 params.target_url = request.url(); | 1622 params.target_url = request.url(); |
| 1620 params.referrer = GetReferrerFromRequest(creator, request); | 1623 params.referrer = GetReferrerFromRequest(creator, request); |
| 1621 } | 1624 } |
| 1622 params.features = features; | 1625 params.features = features; |
| (...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3724 if (IsUseZoomForDSFEnabled()) { | 3727 if (IsUseZoomForDSFEnabled()) { |
| 3725 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3728 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
| 3726 } else { | 3729 } else { |
| 3727 webview()->setDeviceScaleFactor(device_scale_factor_); | 3730 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3728 } | 3731 } |
| 3729 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3732 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
| 3730 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3733 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
| 3731 } | 3734 } |
| 3732 | 3735 |
| 3733 } // namespace content | 3736 } // namespace content |
| OLD | NEW |