OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 if (render_view()->webview()) | 1345 if (render_view()->webview()) |
1346 active_url = render_view()->GetURLForGraphicsContext3D(); | 1346 active_url = render_view()->GetURLForGraphicsContext3D(); |
1347 | 1347 |
1348 // Synchronous IPC to obtain a routing id for the fullscreen widget. | 1348 // Synchronous IPC to obtain a routing id for the fullscreen widget. |
1349 int32_t fullscreen_widget_routing_id = MSG_ROUTING_NONE; | 1349 int32_t fullscreen_widget_routing_id = MSG_ROUTING_NONE; |
1350 if (!RenderThreadImpl::current_render_message_filter() | 1350 if (!RenderThreadImpl::current_render_message_filter() |
1351 ->CreateFullscreenWidget(render_view()->routing_id(), | 1351 ->CreateFullscreenWidget(render_view()->routing_id(), |
1352 &fullscreen_widget_routing_id)) { | 1352 &fullscreen_widget_routing_id)) { |
1353 return nullptr; | 1353 return nullptr; |
1354 } | 1354 } |
| 1355 RenderWidget::ShowCallback show_callback = base::Bind( |
| 1356 &RenderViewImpl::ShowCreatedFullscreenWidget, render_view()->AsWeakPtr()); |
1355 | 1357 |
1356 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create( | 1358 RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create( |
1357 fullscreen_widget_routing_id, render_view()->routing_id(), | 1359 fullscreen_widget_routing_id, show_callback, |
1358 GetRenderWidget()->compositor_deps(), plugin, active_url, | 1360 GetRenderWidget()->compositor_deps(), plugin, active_url, |
1359 GetRenderWidget()->screen_info()); | 1361 GetRenderWidget()->screen_info()); |
| 1362 // TODO(nick): The show() handshake seems like unnecessary complexity here, |
| 1363 // since there's no real delay between CreateFullscreenWidget and |
| 1364 // ShowCreatedFullscreenWidget. Would it be simpler to have the |
| 1365 // CreateFullscreenWidget mojo method implicitly show the window, and skip the |
| 1366 // subsequent step? |
1360 widget->show(blink::WebNavigationPolicyIgnore); | 1367 widget->show(blink::WebNavigationPolicyIgnore); |
1361 return widget; | 1368 return widget; |
1362 } | 1369 } |
1363 | 1370 |
1364 bool RenderFrameImpl::IsPepperAcceptingCompositionEvents() const { | 1371 bool RenderFrameImpl::IsPepperAcceptingCompositionEvents() const { |
1365 if (!focused_pepper_plugin_) | 1372 if (!focused_pepper_plugin_) |
1366 return false; | 1373 return false; |
1367 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); | 1374 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); |
1368 } | 1375 } |
1369 | 1376 |
(...skipping 3737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5107 ? static_cast<DocumentState*>(info.extraData) | 5114 ? static_cast<DocumentState*>(info.extraData) |
5108 ->navigation_state() | 5115 ->navigation_state() |
5109 ->IsContentInitiated() | 5116 ->IsContentInitiated() |
5110 : !IsBrowserInitiated(pending_navigation_params_.get()); | 5117 : !IsBrowserInitiated(pending_navigation_params_.get()); |
5111 bool is_redirect = | 5118 bool is_redirect = |
5112 info.extraData || | 5119 info.extraData || |
5113 (pending_navigation_params_ && | 5120 (pending_navigation_params_ && |
5114 !pending_navigation_params_->request_params.redirects.empty()); | 5121 !pending_navigation_params_->request_params.redirects.empty()); |
5115 | 5122 |
5116 #ifdef OS_ANDROID | 5123 #ifdef OS_ANDROID |
| 5124 bool render_view_was_created_by_renderer = |
| 5125 render_view_->was_created_by_renderer_; |
5117 // The handlenavigation API is deprecated and will be removed once | 5126 // The handlenavigation API is deprecated and will be removed once |
5118 // crbug.com/325351 is resolved. | 5127 // crbug.com/325351 is resolved. |
5119 if (GetContentClient()->renderer()->HandleNavigation( | 5128 if (GetContentClient()->renderer()->HandleNavigation( |
5120 this, is_content_initiated, render_view_->opener_id_, frame_, | 5129 this, is_content_initiated, render_view_was_created_by_renderer, |
5121 info.urlRequest, info.navigationType, info.defaultPolicy, | 5130 frame_, info.urlRequest, info.navigationType, info.defaultPolicy, |
5122 is_redirect)) { | 5131 is_redirect)) { |
5123 return blink::WebNavigationPolicyIgnore; | 5132 return blink::WebNavigationPolicyIgnore; |
5124 } | 5133 } |
5125 #endif | 5134 #endif |
5126 | 5135 |
5127 Referrer referrer( | 5136 Referrer referrer( |
5128 RenderViewImpl::GetReferrerFromRequest(frame_, info.urlRequest)); | 5137 RenderViewImpl::GetReferrerFromRequest(frame_, info.urlRequest)); |
5129 | 5138 |
5130 // Webkit is asking whether to navigate to a new URL. | 5139 // Webkit is asking whether to navigate to a new URL. |
5131 // This is fine normally, except if we're showing UI from one security | 5140 // This is fine normally, except if we're showing UI from one security |
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6623 // event target. Potentially a Pepper plugin will receive the event. | 6632 // event target. Potentially a Pepper plugin will receive the event. |
6624 // In order to tell whether a plugin gets the last mouse event and which it | 6633 // In order to tell whether a plugin gets the last mouse event and which it |
6625 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6634 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6626 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6635 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6627 // |pepper_last_mouse_event_target_|. | 6636 // |pepper_last_mouse_event_target_|. |
6628 pepper_last_mouse_event_target_ = nullptr; | 6637 pepper_last_mouse_event_target_ = nullptr; |
6629 #endif | 6638 #endif |
6630 } | 6639 } |
6631 | 6640 |
6632 } // namespace content | 6641 } // namespace content |
OLD | NEW |