| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 compositing_helper_->OnContainerDestroy(); | 135 compositing_helper_->OnContainerDestroy(); |
| 134 compositing_helper_ = NULL; | 136 compositing_helper_ = NULL; |
| 135 } | 137 } |
| 136 } | 138 } |
| 137 | 139 |
| 138 // TODO(fsamuel): Add support for reattachment. | 140 // TODO(fsamuel): Add support for reattachment. |
| 139 BrowserPluginHostMsg_Attach_Params attach_params; | 141 BrowserPluginHostMsg_Attach_Params attach_params; |
| 140 attach_params.focused = ShouldGuestBeFocused(); | 142 attach_params.focused = ShouldGuestBeFocused(); |
| 141 attach_params.visible = visible_; | 143 attach_params.visible = visible_; |
| 142 attach_params.origin = plugin_rect().origin(); | 144 attach_params.origin = plugin_rect().origin(); |
| 145 attach_params.is_full_page_plugin = false; |
| 146 if (container()) { |
| 147 blink::WebLocalFrame* frame = container()->element().document().frame(); |
| 148 attach_params.is_full_page_plugin = |
| 149 frame->view()->mainFrame()->document().isPluginDocument(); |
| 150 } |
| 143 gfx::Size view_size(width(), height()); | 151 gfx::Size view_size(width(), height()); |
| 144 if (!view_size.IsEmpty()) { | 152 if (!view_size.IsEmpty()) { |
| 145 PopulateResizeGuestParameters(view_size, | 153 PopulateResizeGuestParameters(view_size, |
| 146 &attach_params.resize_guest_params); | 154 &attach_params.resize_guest_params); |
| 147 } | 155 } |
| 148 browser_plugin_manager()->Send(new BrowserPluginHostMsg_Attach( | 156 browser_plugin_manager()->Send(new BrowserPluginHostMsg_Attach( |
| 149 render_view_routing_id_, | 157 render_view_routing_id_, |
| 150 browser_plugin_instance_id_, | 158 browser_plugin_instance_id_, |
| 151 attach_params)); | 159 attach_params)); |
| 152 | 160 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 const blink::WebMouseEvent& event) { | 659 const blink::WebMouseEvent& event) { |
| 652 browser_plugin_manager()->Send( | 660 browser_plugin_manager()->Send( |
| 653 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 661 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
| 654 browser_plugin_instance_id_, | 662 browser_plugin_instance_id_, |
| 655 plugin_rect_, | 663 plugin_rect_, |
| 656 &event)); | 664 &event)); |
| 657 return true; | 665 return true; |
| 658 } | 666 } |
| 659 | 667 |
| 660 } // namespace content | 668 } // namespace content |
| OLD | NEW |