| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "content/common/browser_plugin/browser_plugin_constants.h" | 11 #include "content/common/browser_plugin/browser_plugin_constants.h" |
| 12 #include "content/common/browser_plugin/browser_plugin_messages.h" | 12 #include "content/common/browser_plugin/browser_plugin_messages.h" |
| 13 #include "content/common/view_messages.h" | 13 #include "content/common/view_messages.h" |
| 14 #include "content/public/common/content_client.h" | 14 #include "content/public/common/content_client.h" |
| 15 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
| 16 #include "content/public/renderer/browser_plugin_delegate.h" | 16 #include "content/public/renderer/browser_plugin_delegate.h" |
| 17 #include "content/public/renderer/content_renderer_client.h" | 17 #include "content/public/renderer/content_renderer_client.h" |
| 18 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 18 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
| 19 #include "content/renderer/child_frame_compositing_helper.h" | 19 #include "content/renderer/child_frame_compositing_helper.h" |
| 20 #include "content/renderer/cursor_utils.h" | 20 #include "content/renderer/cursor_utils.h" |
| 21 #include "content/renderer/drop_data_builder.h" | 21 #include "content/renderer/drop_data_builder.h" |
| 22 #include "content/renderer/render_thread_impl.h" | 22 #include "content/renderer/render_thread_impl.h" |
| 23 #include "content/renderer/sad_plugin.h" | 23 #include "content/renderer/sad_plugin.h" |
| 24 #include "third_party/WebKit/public/platform/WebRect.h" | 24 #include "third_party/WebKit/public/platform/WebRect.h" |
| 25 #include "third_party/WebKit/public/web/WebDocument.h" |
| 25 #include "third_party/WebKit/public/web/WebElement.h" | 26 #include "third_party/WebKit/public/web/WebElement.h" |
| 26 #include "third_party/WebKit/public/web/WebInputEvent.h" | 27 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 28 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 27 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 29 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| 28 #include "third_party/WebKit/public/web/WebView.h" | 30 #include "third_party/WebKit/public/web/WebView.h" |
| 29 #include "third_party/skia/include/core/SkCanvas.h" | 31 #include "third_party/skia/include/core/SkCanvas.h" |
| 30 #include "ui/events/keycodes/keyboard_codes.h" | 32 #include "ui/events/keycodes/keyboard_codes.h" |
| 31 | 33 |
| 32 using blink::WebCanvas; | 34 using blink::WebCanvas; |
| 33 using blink::WebPluginContainer; | 35 using blink::WebPluginContainer; |
| 34 using blink::WebPoint; | 36 using blink::WebPoint; |
| 35 using blink::WebRect; | 37 using blink::WebRect; |
| 36 using blink::WebURL; | 38 using blink::WebURL; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 compositing_helper_->OnContainerDestroy(); | 129 compositing_helper_->OnContainerDestroy(); |
| 128 compositing_helper_ = NULL; | 130 compositing_helper_ = NULL; |
| 129 } | 131 } |
| 130 } | 132 } |
| 131 | 133 |
| 132 // TODO(fsamuel): Add support for reattachment. | 134 // TODO(fsamuel): Add support for reattachment. |
| 133 BrowserPluginHostMsg_Attach_Params attach_params; | 135 BrowserPluginHostMsg_Attach_Params attach_params; |
| 134 attach_params.focused = ShouldGuestBeFocused(); | 136 attach_params.focused = ShouldGuestBeFocused(); |
| 135 attach_params.visible = visible_; | 137 attach_params.visible = visible_; |
| 136 attach_params.origin = plugin_rect().origin(); | 138 attach_params.origin = plugin_rect().origin(); |
| 139 attach_params.is_full_page_plugin = false; |
| 140 if (container()) { |
| 141 blink::WebLocalFrame* frame = container()->element().document().frame(); |
| 142 attach_params.is_full_page_plugin = |
| 143 frame->view()->mainFrame()->document().isPluginDocument(); |
| 144 } |
| 137 gfx::Size view_size(width(), height()); | 145 gfx::Size view_size(width(), height()); |
| 138 if (!view_size.IsEmpty()) { | 146 if (!view_size.IsEmpty()) { |
| 139 PopulateResizeGuestParameters(view_size, | 147 PopulateResizeGuestParameters(view_size, |
| 140 &attach_params.resize_guest_params); | 148 &attach_params.resize_guest_params); |
| 141 } | 149 } |
| 142 browser_plugin_manager()->Send(new BrowserPluginHostMsg_Attach( | 150 browser_plugin_manager()->Send(new BrowserPluginHostMsg_Attach( |
| 143 render_view_routing_id_, | 151 render_view_routing_id_, |
| 144 browser_plugin_instance_id_, | 152 browser_plugin_instance_id_, |
| 145 attach_params)); | 153 attach_params)); |
| 146 | 154 |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 const blink::WebMouseEvent& event) { | 658 const blink::WebMouseEvent& event) { |
| 651 browser_plugin_manager()->Send( | 659 browser_plugin_manager()->Send( |
| 652 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 660 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
| 653 browser_plugin_instance_id_, | 661 browser_plugin_instance_id_, |
| 654 plugin_rect_, | 662 plugin_rect_, |
| 655 &event)); | 663 &event)); |
| 656 return true; | 664 return true; |
| 657 } | 665 } |
| 658 | 666 |
| 659 } // namespace content | 667 } // namespace content |
| OLD | NEW |