OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "ppapi/c/dev/ppb_find_dev.h" | 12 #include "ppapi/c/dev/ppb_find_dev.h" |
13 #include "ppapi/c/dev/ppb_fullscreen_dev.h" | 13 #include "ppapi/c/dev/ppb_fullscreen_dev.h" |
14 #include "ppapi/c/dev/ppb_messaging_dev.h" | |
14 #include "ppapi/c/dev/ppb_zoom_dev.h" | 15 #include "ppapi/c/dev/ppb_zoom_dev.h" |
15 #include "ppapi/c/dev/ppp_find_dev.h" | 16 #include "ppapi/c/dev/ppp_find_dev.h" |
17 #include "ppapi/c/dev/ppp_messaging_dev.h" | |
16 #include "ppapi/c/dev/ppp_selection_dev.h" | 18 #include "ppapi/c/dev/ppp_selection_dev.h" |
17 #include "ppapi/c/dev/ppp_zoom_dev.h" | 19 #include "ppapi/c/dev/ppp_zoom_dev.h" |
18 #include "ppapi/c/pp_input_event.h" | 20 #include "ppapi/c/pp_input_event.h" |
19 #include "ppapi/c/pp_instance.h" | 21 #include "ppapi/c/pp_instance.h" |
20 #include "ppapi/c/pp_rect.h" | 22 #include "ppapi/c/pp_rect.h" |
21 #include "ppapi/c/pp_resource.h" | 23 #include "ppapi/c/pp_resource.h" |
22 #include "ppapi/c/pp_var.h" | 24 #include "ppapi/c/pp_var.h" |
23 #include "ppapi/c/ppb_core.h" | 25 #include "ppapi/c/ppb_core.h" |
24 #include "ppapi/c/ppb_instance.h" | 26 #include "ppapi/c/ppb_instance.h" |
25 #include "ppapi/c/ppp_instance.h" | 27 #include "ppapi/c/ppp_instance.h" |
26 #include "printing/units.h" | 28 #include "printing/units.h" |
27 #include "skia/ext/vector_platform_device.h" | 29 #include "skia/ext/vector_platform_device.h" |
28 #include "skia/ext/platform_canvas.h" | 30 #include "skia/ext/platform_canvas.h" |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
40 #include "ui/gfx/rect.h" | 42 #include "ui/gfx/rect.h" |
41 #include "ui/gfx/skia_util.h" | 43 #include "ui/gfx/skia_util.h" |
42 #include "webkit/plugins/ppapi/common.h" | 44 #include "webkit/plugins/ppapi/common.h" |
43 #include "webkit/plugins/ppapi/event_conversion.h" | 45 #include "webkit/plugins/ppapi/event_conversion.h" |
44 #include "webkit/plugins/ppapi/fullscreen_container.h" | 46 #include "webkit/plugins/ppapi/fullscreen_container.h" |
47 #include "webkit/plugins/ppapi/message_channel.h" | |
45 #include "webkit/plugins/ppapi/plugin_delegate.h" | 48 #include "webkit/plugins/ppapi/plugin_delegate.h" |
46 #include "webkit/plugins/ppapi/plugin_module.h" | 49 #include "webkit/plugins/ppapi/plugin_module.h" |
47 #include "webkit/plugins/ppapi/plugin_object.h" | 50 #include "webkit/plugins/ppapi/plugin_object.h" |
48 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" | 51 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" |
49 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" | 52 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" |
50 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 53 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
51 #include "webkit/plugins/ppapi/ppb_surface_3d_impl.h" | 54 #include "webkit/plugins/ppapi/ppb_surface_3d_impl.h" |
52 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 55 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
53 #include "webkit/plugins/ppapi/ppp_pdf.h" | 56 #include "webkit/plugins/ppapi/ppp_pdf.h" |
54 #include "webkit/plugins/ppapi/string.h" | 57 #include "webkit/plugins/ppapi/string.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 typedef bool (*RenderPDFPageToDCProc)( | 96 typedef bool (*RenderPDFPageToDCProc)( |
94 const unsigned char* pdf_buffer, int buffer_size, int page_number, HDC dc, | 97 const unsigned char* pdf_buffer, int buffer_size, int page_number, HDC dc, |
95 int dpi_x, int dpi_y, int bounds_origin_x, int bounds_origin_y, | 98 int dpi_x, int dpi_y, int bounds_origin_x, int bounds_origin_y, |
96 int bounds_width, int bounds_height, bool fit_to_bounds, | 99 int bounds_width, int bounds_height, bool fit_to_bounds, |
97 bool stretch_to_bounds, bool keep_aspect_ratio, bool center_in_bounds); | 100 bool stretch_to_bounds, bool keep_aspect_ratio, bool center_in_bounds); |
98 #endif // defined(OS_WIN) | 101 #endif // defined(OS_WIN) |
99 | 102 |
100 namespace { | 103 namespace { |
101 | 104 |
102 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, np_name) \ | 105 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, np_name) \ |
103 COMPILE_ASSERT(int(WebCursorInfo::webkit_name) == int(np_name), \ | 106 COMPILE_ASSERT(static_cast<int>(WebCursorInfo::webkit_name) \ |
107 == static_cast<int>(np_name), \ | |
104 mismatching_enums) | 108 mismatching_enums) |
105 | 109 |
106 COMPILE_ASSERT_MATCHING_ENUM(TypePointer, PP_CURSORTYPE_POINTER); | 110 COMPILE_ASSERT_MATCHING_ENUM(TypePointer, PP_CURSORTYPE_POINTER); |
107 COMPILE_ASSERT_MATCHING_ENUM(TypeCross, PP_CURSORTYPE_CROSS); | 111 COMPILE_ASSERT_MATCHING_ENUM(TypeCross, PP_CURSORTYPE_CROSS); |
108 COMPILE_ASSERT_MATCHING_ENUM(TypeHand, PP_CURSORTYPE_HAND); | 112 COMPILE_ASSERT_MATCHING_ENUM(TypeHand, PP_CURSORTYPE_HAND); |
109 COMPILE_ASSERT_MATCHING_ENUM(TypeIBeam, PP_CURSORTYPE_IBEAM); | 113 COMPILE_ASSERT_MATCHING_ENUM(TypeIBeam, PP_CURSORTYPE_IBEAM); |
110 COMPILE_ASSERT_MATCHING_ENUM(TypeWait, PP_CURSORTYPE_WAIT); | 114 COMPILE_ASSERT_MATCHING_ENUM(TypeWait, PP_CURSORTYPE_WAIT); |
111 COMPILE_ASSERT_MATCHING_ENUM(TypeHelp, PP_CURSORTYPE_HELP); | 115 COMPILE_ASSERT_MATCHING_ENUM(TypeHelp, PP_CURSORTYPE_HELP); |
112 COMPILE_ASSERT_MATCHING_ENUM(TypeEastResize, PP_CURSORTYPE_EASTRESIZE); | 116 COMPILE_ASSERT_MATCHING_ENUM(TypeEastResize, PP_CURSORTYPE_EASTRESIZE); |
113 COMPILE_ASSERT_MATCHING_ENUM(TypeNorthResize, PP_CURSORTYPE_NORTHRESIZE); | 117 COMPILE_ASSERT_MATCHING_ENUM(TypeNorthResize, PP_CURSORTYPE_NORTHRESIZE); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 | 259 |
256 PP_Bool GetScreenSize(PP_Instance instance_id, PP_Size* size) { | 260 PP_Bool GetScreenSize(PP_Instance instance_id, PP_Size* size) { |
257 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); | 261 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); |
258 if (!instance || !size) | 262 if (!instance || !size) |
259 return PP_FALSE; | 263 return PP_FALSE; |
260 gfx::Size screen_size = instance->delegate()->GetScreenSize(); | 264 gfx::Size screen_size = instance->delegate()->GetScreenSize(); |
261 *size = PP_MakeSize(screen_size.width(), screen_size.height()); | 265 *size = PP_MakeSize(screen_size.width(), screen_size.height()); |
262 return PP_TRUE; | 266 return PP_TRUE; |
263 } | 267 } |
264 | 268 |
265 | |
266 const PPB_Fullscreen_Dev ppb_fullscreen = { | 269 const PPB_Fullscreen_Dev ppb_fullscreen = { |
267 &IsFullscreen, | 270 &IsFullscreen, |
268 &SetFullscreen, | 271 &SetFullscreen, |
269 &GetScreenSize | 272 &GetScreenSize |
270 }; | 273 }; |
271 | 274 |
275 void PostMessage(PP_Instance instance_id, PP_Var message) { | |
276 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); | |
277 if (!instance) | |
278 return; | |
279 instance->PostMessage(message); | |
280 } | |
281 | |
282 const PPB_Messaging_Dev ppb_messaging = { | |
283 &PostMessage | |
284 }; | |
285 | |
272 void ZoomChanged(PP_Instance instance_id, double factor) { | 286 void ZoomChanged(PP_Instance instance_id, double factor) { |
273 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); | 287 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); |
274 if (!instance) | 288 if (!instance) |
275 return; | 289 return; |
276 | 290 |
277 // We only want to tell the page to change its zoom if the whole page is the | 291 // We only want to tell the page to change its zoom if the whole page is the |
278 // plugin. If we're in an iframe, then don't do anything. | 292 // plugin. If we're in an iframe, then don't do anything. |
279 if (!instance->IsFullPagePlugin()) | 293 if (!instance->IsFullPagePlugin()) |
280 return; | 294 return; |
281 | 295 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 : delegate_(delegate), | 333 : delegate_(delegate), |
320 module_(module), | 334 module_(module), |
321 instance_interface_(instance_interface), | 335 instance_interface_(instance_interface), |
322 pp_instance_(0), | 336 pp_instance_(0), |
323 container_(NULL), | 337 container_(NULL), |
324 full_frame_(false), | 338 full_frame_(false), |
325 has_webkit_focus_(false), | 339 has_webkit_focus_(false), |
326 has_content_area_focus_(false), | 340 has_content_area_focus_(false), |
327 find_identifier_(-1), | 341 find_identifier_(-1), |
328 plugin_find_interface_(NULL), | 342 plugin_find_interface_(NULL), |
343 plugin_messaging_interface_(NULL), | |
329 plugin_pdf_interface_(NULL), | 344 plugin_pdf_interface_(NULL), |
330 plugin_selection_interface_(NULL), | 345 plugin_selection_interface_(NULL), |
331 plugin_zoom_interface_(NULL), | 346 plugin_zoom_interface_(NULL), |
332 #if defined(OS_LINUX) | 347 #if defined(OS_LINUX) |
333 canvas_(NULL), | 348 canvas_(NULL), |
334 #endif // defined(OS_LINUX) | 349 #endif // defined(OS_LINUX) |
335 plugin_print_interface_(NULL), | 350 plugin_print_interface_(NULL), |
336 plugin_graphics_3d_interface_(NULL), | 351 plugin_graphics_3d_interface_(NULL), |
337 always_on_top_(false), | 352 always_on_top_(false), |
338 fullscreen_container_(NULL), | 353 fullscreen_container_(NULL), |
339 fullscreen_(false), | 354 fullscreen_(false), |
355 message_channel_(NULL), | |
340 sad_plugin_(NULL) { | 356 sad_plugin_(NULL) { |
341 pp_instance_ = ResourceTracker::Get()->AddInstance(this); | 357 pp_instance_ = ResourceTracker::Get()->AddInstance(this); |
342 | 358 |
343 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); | 359 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); |
344 DCHECK(delegate); | 360 DCHECK(delegate); |
345 module_->InstanceCreated(this); | 361 module_->InstanceCreated(this); |
346 delegate_->InstanceCreated(this); | 362 delegate_->InstanceCreated(this); |
363 message_channel_.reset(new MessageChannel(this)); | |
347 } | 364 } |
348 | 365 |
349 PluginInstance::~PluginInstance() { | 366 PluginInstance::~PluginInstance() { |
350 // Free all the plugin objects. This will automatically clear the back- | 367 // Free all the plugin objects. This will automatically clear the back- |
351 // pointer from the NPObject so WebKit can't call into the plugin any more. | 368 // pointer from the NPObject so WebKit can't call into the plugin any more. |
352 // | 369 // |
353 // Swap out the set so we can delete from it (the objects will try to | 370 // Swap out the set so we can delete from it (the objects will try to |
354 // unregister themselves inside the delete call). | 371 // unregister themselves inside the delete call). |
355 PluginObjectSet plugin_object_copy; | 372 PluginObjectSet plugin_object_copy; |
356 live_plugin_objects_.swap(plugin_object_copy); | 373 live_plugin_objects_.swap(plugin_object_copy); |
(...skipping 19 matching lines...) Expand all Loading... | |
376 const PPB_Find_Dev* PluginInstance::GetFindInterface() { | 393 const PPB_Find_Dev* PluginInstance::GetFindInterface() { |
377 return &ppb_find; | 394 return &ppb_find; |
378 } | 395 } |
379 | 396 |
380 // static | 397 // static |
381 const PPB_Fullscreen_Dev* PluginInstance::GetFullscreenInterface() { | 398 const PPB_Fullscreen_Dev* PluginInstance::GetFullscreenInterface() { |
382 return &ppb_fullscreen; | 399 return &ppb_fullscreen; |
383 } | 400 } |
384 | 401 |
385 // static | 402 // static |
403 const PPB_Messaging_Dev* PluginInstance::GetMessagingInterface() { | |
404 return &ppb_messaging; | |
405 } | |
406 | |
407 // static | |
386 const PPB_Zoom_Dev* PluginInstance::GetZoomInterface() { | 408 const PPB_Zoom_Dev* PluginInstance::GetZoomInterface() { |
387 return &ppb_zoom; | 409 return &ppb_zoom; |
388 } | 410 } |
389 | 411 |
390 // NOTE: Any of these methods that calls into the plugin needs to take into | 412 // NOTE: Any of these methods that calls into the plugin needs to take into |
391 // account that the plugin may use Var to remove the <embed> from the DOM, which | 413 // account that the plugin may use Var to remove the <embed> from the DOM, which |
392 // will make the WebPluginImpl drop its reference, usually the last one. If a | 414 // will make the WebPluginImpl drop its reference, usually the last one. If a |
393 // method needs to access a member of the instance after the call has returned, | 415 // method needs to access a member of the instance after the call has returned, |
394 // then it needs to keep its own reference on the stack. | 416 // then it needs to keep its own reference on the stack. |
395 | 417 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
597 try_catch.SetException("Exception caught"); | 619 try_catch.SetException("Exception caught"); |
598 WebBindings::releaseVariantValue(&result); | 620 WebBindings::releaseVariantValue(&result); |
599 return PP_MakeUndefined(); | 621 return PP_MakeUndefined(); |
600 } | 622 } |
601 | 623 |
602 PP_Var ret = Var::NPVariantToPPVar(this, &result); | 624 PP_Var ret = Var::NPVariantToPPVar(this, &result); |
603 WebBindings::releaseVariantValue(&result); | 625 WebBindings::releaseVariantValue(&result); |
604 return ret; | 626 return ret; |
605 } | 627 } |
606 | 628 |
629 void PluginInstance::PostMessage(PP_Var message) { | |
630 message_channel_->PostMessageToJavaScript(message); | |
631 } | |
632 | |
607 void PluginInstance::Delete() { | 633 void PluginInstance::Delete() { |
608 // Keep a reference on the stack. See NOTE above. | 634 // Keep a reference on the stack. See NOTE above. |
609 scoped_refptr<PluginInstance> ref(this); | 635 scoped_refptr<PluginInstance> ref(this); |
610 instance_interface_->DidDestroy(pp_instance()); | 636 instance_interface_->DidDestroy(pp_instance()); |
611 | 637 |
612 if (fullscreen_container_) { | 638 if (fullscreen_container_) { |
613 fullscreen_container_->Destroy(); | 639 fullscreen_container_->Destroy(); |
614 fullscreen_container_ = NULL; | 640 fullscreen_container_ = NULL; |
615 } | 641 } |
616 container_ = NULL; | 642 container_ = NULL; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 for (size_t i = 0; i < pp_events.size(); i++) { | 682 for (size_t i = 0; i < pp_events.size(); i++) { |
657 rv |= PPBoolToBool(instance_interface_->HandleInputEvent(pp_instance(), | 683 rv |= PPBoolToBool(instance_interface_->HandleInputEvent(pp_instance(), |
658 &pp_events[i])); | 684 &pp_events[i])); |
659 } | 685 } |
660 | 686 |
661 if (cursor_.get()) | 687 if (cursor_.get()) |
662 *cursor_info = *cursor_; | 688 *cursor_info = *cursor_; |
663 return rv; | 689 return rv; |
664 } | 690 } |
665 | 691 |
692 void PluginInstance::HandleMessage(PP_Var message) { | |
693 // Keep a reference on the stack. See NOTE above. | |
694 scoped_refptr<PluginInstance> ref(this); | |
695 if (!LoadMessagingInterface()) | |
696 return; | |
697 plugin_messaging_interface_->HandleMessage(pp_instance(), message); | |
698 } | |
699 | |
666 PP_Var PluginInstance::GetInstanceObject() { | 700 PP_Var PluginInstance::GetInstanceObject() { |
667 return instance_interface_->GetInstanceObject(pp_instance()); | 701 return instance_interface_->GetInstanceObject(pp_instance()); |
668 } | 702 } |
669 | 703 |
670 void PluginInstance::ViewChanged(const gfx::Rect& position, | 704 void PluginInstance::ViewChanged(const gfx::Rect& position, |
671 const gfx::Rect& clip) { | 705 const gfx::Rect& clip) { |
672 fullscreen_ = (fullscreen_container_ != NULL); | 706 fullscreen_ = (fullscreen_container_ != NULL); |
673 position_ = position; | 707 position_ = position; |
674 | 708 |
675 if (clip.IsEmpty()) { | 709 if (clip.IsEmpty()) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
832 bool PluginInstance::LoadFindInterface() { | 866 bool PluginInstance::LoadFindInterface() { |
833 if (!plugin_find_interface_) { | 867 if (!plugin_find_interface_) { |
834 plugin_find_interface_ = | 868 plugin_find_interface_ = |
835 reinterpret_cast<const PPP_Find_Dev*>(module_->GetPluginInterface( | 869 reinterpret_cast<const PPP_Find_Dev*>(module_->GetPluginInterface( |
836 PPP_FIND_DEV_INTERFACE)); | 870 PPP_FIND_DEV_INTERFACE)); |
837 } | 871 } |
838 | 872 |
839 return !!plugin_find_interface_; | 873 return !!plugin_find_interface_; |
840 } | 874 } |
841 | 875 |
876 bool PluginInstance::LoadMessagingInterface() { | |
877 if (!plugin_messaging_interface_) { | |
brettw
2011/03/22 05:59:11
This will query the plugin every single time if it
dmichael(do not use this one)
2011/03/22 15:39:00
I'm fine either way... it only happens when the J
| |
878 plugin_messaging_interface_ = | |
879 reinterpret_cast<const PPP_Messaging_Dev*>(module_->GetPluginInterface( | |
880 PPP_MESSAGING_DEV_INTERFACE)); | |
881 } | |
882 | |
883 return !!plugin_messaging_interface_; | |
884 } | |
885 | |
842 bool PluginInstance::LoadPdfInterface() { | 886 bool PluginInstance::LoadPdfInterface() { |
843 if (!plugin_pdf_interface_) { | 887 if (!plugin_pdf_interface_) { |
844 plugin_pdf_interface_ = | 888 plugin_pdf_interface_ = |
845 reinterpret_cast<const PPP_Pdf*>(module_->GetPluginInterface( | 889 reinterpret_cast<const PPP_Pdf*>(module_->GetPluginInterface( |
846 PPP_PDF_INTERFACE)); | 890 PPP_PDF_INTERFACE)); |
847 } | 891 } |
848 | 892 |
849 return !!plugin_pdf_interface_; | 893 return !!plugin_pdf_interface_; |
850 } | 894 } |
851 | 895 |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1366 return found->second; | 1410 return found->second; |
1367 } | 1411 } |
1368 | 1412 |
1369 bool PluginInstance::IsFullPagePlugin() const { | 1413 bool PluginInstance::IsFullPagePlugin() const { |
1370 WebFrame* frame = container()->element().document().frame(); | 1414 WebFrame* frame = container()->element().document().frame(); |
1371 return frame->view()->mainFrame()->document().isPluginDocument(); | 1415 return frame->view()->mainFrame()->document().isPluginDocument(); |
1372 } | 1416 } |
1373 | 1417 |
1374 } // namespace ppapi | 1418 } // namespace ppapi |
1375 } // namespace webkit | 1419 } // namespace webkit |
OLD | NEW |