Chromium Code Reviews| 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.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_memory_dev.h" | 14 #include "ppapi/c/dev/ppb_memory_dev.h" |
| 15 #include "ppapi/c/dev/ppb_zoom_dev.h" | 15 #include "ppapi/c/dev/ppb_zoom_dev.h" |
| 16 #include "ppapi/c/dev/ppp_find_dev.h" | 16 #include "ppapi/c/dev/ppp_find_dev.h" |
| 17 #include "ppapi/c/dev/ppp_policy_update_dev.h" | 17 #include "ppapi/c/dev/ppp_policy_update_dev.h" |
| 18 #include "ppapi/c/dev/ppp_selection_dev.h" | 18 #include "ppapi/c/dev/ppp_selection_dev.h" |
| 19 #include "ppapi/c/dev/ppp_zoom_dev.h" | 19 #include "ppapi/c/dev/ppp_zoom_dev.h" |
| 20 #include "ppapi/c/pp_input_event.h" | 20 #include "ppapi/c/pp_input_event.h" |
| 21 #include "ppapi/c/pp_instance.h" | 21 #include "ppapi/c/pp_instance.h" |
| 22 #include "ppapi/c/pp_rect.h" | 22 #include "ppapi/c/pp_rect.h" |
| 23 #include "ppapi/c/pp_resource.h" | 23 #include "ppapi/c/pp_resource.h" |
| 24 #include "ppapi/c/pp_var.h" | 24 #include "ppapi/c/pp_var.h" |
| 25 #include "ppapi/c/ppb_core.h" | 25 #include "ppapi/c/ppb_core.h" |
| 26 #include "ppapi/c/ppb_fullscreen.h" | |
| 26 #include "ppapi/c/ppb_instance.h" | 27 #include "ppapi/c/ppb_instance.h" |
| 27 #include "ppapi/c/ppp_input_event.h" | 28 #include "ppapi/c/ppp_input_event.h" |
| 28 #include "ppapi/c/ppp_instance.h" | 29 #include "ppapi/c/ppp_instance.h" |
| 29 #include "ppapi/c/ppp_messaging.h" | 30 #include "ppapi/c/ppp_messaging.h" |
| 30 #include "ppapi/c/private/ppb_instance_private.h" | 31 #include "ppapi/c/private/ppb_instance_private.h" |
| 31 #include "ppapi/c/private/ppp_instance_private.h" | 32 #include "ppapi/c/private/ppp_instance_private.h" |
| 32 #include "ppapi/shared_impl/input_event_impl.h" | 33 #include "ppapi/shared_impl/input_event_impl.h" |
| 33 #include "ppapi/shared_impl/resource.h" | 34 #include "ppapi/shared_impl/resource.h" |
| 34 #include "ppapi/shared_impl/var.h" | 35 #include "ppapi/shared_impl/var.h" |
| 35 #include "ppapi/thunk/enter.h" | 36 #include "ppapi/thunk/enter.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 plugin_pdf_interface_(NULL), | 229 plugin_pdf_interface_(NULL), |
| 229 plugin_policy_updated_interface_(NULL), | 230 plugin_policy_updated_interface_(NULL), |
| 230 plugin_selection_interface_(NULL), | 231 plugin_selection_interface_(NULL), |
| 231 plugin_zoom_interface_(NULL), | 232 plugin_zoom_interface_(NULL), |
| 232 checked_for_plugin_input_event_interface_(false), | 233 checked_for_plugin_input_event_interface_(false), |
| 233 checked_for_plugin_messaging_interface_(false), | 234 checked_for_plugin_messaging_interface_(false), |
| 234 plugin_print_interface_(NULL), | 235 plugin_print_interface_(NULL), |
| 235 plugin_graphics_3d_interface_(NULL), | 236 plugin_graphics_3d_interface_(NULL), |
| 236 always_on_top_(false), | 237 always_on_top_(false), |
| 237 fullscreen_container_(NULL), | 238 fullscreen_container_(NULL), |
| 239 fullscreen_dev_(false), | |
| 240 desired_fullscreen_state_(false), | |
| 238 fullscreen_(false), | 241 fullscreen_(false), |
| 239 message_channel_(NULL), | 242 message_channel_(NULL), |
| 240 sad_plugin_(NULL), | 243 sad_plugin_(NULL), |
| 241 input_event_mask_(0), | 244 input_event_mask_(0), |
| 242 filtered_input_event_mask_(0) { | 245 filtered_input_event_mask_(0) { |
| 243 pp_instance_ = ResourceTracker::Get()->AddInstance(this); | 246 pp_instance_ = ResourceTracker::Get()->AddInstance(this); |
| 244 | 247 |
| 245 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); | 248 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); |
| 246 DCHECK(delegate); | 249 DCHECK(delegate); |
| 247 module_->InstanceCreated(this); | 250 module_->InstanceCreated(this); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 346 else | 349 else |
| 347 container_->commitBackingTexture(); | 350 container_->commitBackingTexture(); |
| 348 } | 351 } |
| 349 | 352 |
| 350 void PluginInstance::InstanceCrashed() { | 353 void PluginInstance::InstanceCrashed() { |
| 351 // Force free all resources and vars. | 354 // Force free all resources and vars. |
| 352 ResourceTracker::Get()->InstanceCrashed(pp_instance()); | 355 ResourceTracker::Get()->InstanceCrashed(pp_instance()); |
| 353 | 356 |
| 354 // Free any associated graphics. | 357 // Free any associated graphics. |
| 355 SetFullscreen(false, false); | 358 SetFullscreen(false, false); |
| 359 SetFullscreen_Dev(false, false); | |
| 356 bound_graphics_ = NULL; | 360 bound_graphics_ = NULL; |
| 357 InvalidateRect(gfx::Rect()); | 361 InvalidateRect(gfx::Rect()); |
| 358 | 362 |
| 359 delegate()->PluginCrashed(this); | 363 delegate()->PluginCrashed(this); |
| 360 } | 364 } |
| 361 | 365 |
| 362 bool PluginInstance::SetCursor(PP_CursorType_Dev type, | 366 bool PluginInstance::SetCursor(PP_CursorType_Dev type, |
| 363 PP_Resource custom_image, | 367 PP_Resource custom_image, |
| 364 const PP_Point* hot_spot) { | 368 const PP_Point* hot_spot) { |
| 365 if (type != PP_CURSORTYPE_CUSTOM) { | 369 if (type != PP_CURSORTYPE_CUSTOM) { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 if (!clip.IsEmpty()) | 518 if (!clip.IsEmpty()) |
| 515 new_clip = clip; | 519 new_clip = clip; |
| 516 | 520 |
| 517 // Don't notify the plugin if we've already sent these same params before. | 521 // Don't notify the plugin if we've already sent these same params before. |
| 518 if (sent_did_change_view_ && position == position_ && new_clip == clip_) | 522 if (sent_did_change_view_ && position == position_ && new_clip == clip_) |
| 519 return; | 523 return; |
| 520 | 524 |
| 521 sent_did_change_view_ = true; | 525 sent_did_change_view_ = true; |
| 522 position_ = position; | 526 position_ = position; |
| 523 clip_ = new_clip; | 527 clip_ = new_clip; |
| 524 fullscreen_ = (fullscreen_container_ != NULL); | 528 fullscreen_ = desired_fullscreen_state_; |
| 529 fullscreen_dev_ = (fullscreen_container_ != NULL); | |
| 525 | 530 |
| 526 PP_Rect pp_position, pp_clip; | 531 PP_Rect pp_position, pp_clip; |
| 527 RectToPPRect(position_, &pp_position); | 532 RectToPPRect(position_, &pp_position); |
| 528 RectToPPRect(clip_, &pp_clip); | 533 RectToPPRect(clip_, &pp_clip); |
| 529 instance_interface_->DidChangeView(pp_instance(), &pp_position, &pp_clip); | 534 instance_interface_->DidChangeView(pp_instance(), &pp_position, &pp_clip); |
| 530 } | 535 } |
| 531 | 536 |
| 532 void PluginInstance::SetWebKitFocus(bool has_focus) { | 537 void PluginInstance::SetWebKitFocus(bool has_focus) { |
| 533 if (has_webkit_focus_ == has_focus) | 538 if (has_webkit_focus_ == has_focus) |
| 534 return; | 539 return; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 767 } | 772 } |
| 768 | 773 |
| 769 bool PluginInstance::PluginHasFocus() const { | 774 bool PluginInstance::PluginHasFocus() const { |
| 770 return has_webkit_focus_ && has_content_area_focus_; | 775 return has_webkit_focus_ && has_content_area_focus_; |
| 771 } | 776 } |
| 772 | 777 |
| 773 void PluginInstance::ReportGeometry() { | 778 void PluginInstance::ReportGeometry() { |
| 774 // If this call was delayed, we may have transitioned back to fullscreen in | 779 // If this call was delayed, we may have transitioned back to fullscreen in |
| 775 // the mean time, so only report the geometry if we are actually in normal | 780 // the mean time, so only report the geometry if we are actually in normal |
| 776 // mode. | 781 // mode. |
| 777 if (container_ && !fullscreen_container_) | 782 if (container_ && !fullscreen_container_ && !fullscreen_dev_) |
| 778 container_->reportGeometry(); | 783 container_->reportGeometry(); |
| 779 } | 784 } |
| 780 | 785 |
| 781 bool PluginInstance::GetPreferredPrintOutputFormat( | 786 bool PluginInstance::GetPreferredPrintOutputFormat( |
| 782 PP_PrintOutputFormat_Dev* format) { | 787 PP_PrintOutputFormat_Dev* format) { |
| 783 // Keep a reference on the stack. See NOTE above. | 788 // Keep a reference on the stack. See NOTE above. |
| 784 scoped_refptr<PluginInstance> ref(this); | 789 scoped_refptr<PluginInstance> ref(this); |
| 785 if (!LoadPrintInterface()) | 790 if (!LoadPrintInterface()) |
| 786 return false; | 791 return false; |
| 787 uint32_t supported_formats = | 792 uint32_t supported_formats = |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 885 DCHECK(plugin_print_interface_); | 890 DCHECK(plugin_print_interface_); |
| 886 if (plugin_print_interface_) | 891 if (plugin_print_interface_) |
| 887 plugin_print_interface_->End(pp_instance()); | 892 plugin_print_interface_->End(pp_instance()); |
| 888 | 893 |
| 889 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); | 894 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); |
| 890 #if defined(OS_MACOSX) | 895 #if defined(OS_MACOSX) |
| 891 last_printed_page_ = NULL; | 896 last_printed_page_ = NULL; |
| 892 #endif // defined(OS_MACOSX) | 897 #endif // defined(OS_MACOSX) |
| 893 } | 898 } |
| 894 | 899 |
| 900 bool PluginInstance::IsFullscreenOrPending_Dev() { | |
| 901 return fullscreen_container_ != NULL; | |
| 902 } | |
| 903 | |
| 895 bool PluginInstance::IsFullscreenOrPending() { | 904 bool PluginInstance::IsFullscreenOrPending() { |
| 896 return fullscreen_container_ != NULL; | 905 return desired_fullscreen_state_; |
| 897 } | 906 } |
| 898 | 907 |
| 899 void PluginInstance::SetFullscreen(bool fullscreen, bool delay_report) { | 908 void PluginInstance::SetFullscreen(bool fullscreen, bool delay_report) { |
| 900 // Keep a reference on the stack. See NOTE above. | 909 // Keep a reference on the stack. See NOTE above. |
| 901 scoped_refptr<PluginInstance> ref(this); | 910 scoped_refptr<PluginInstance> ref(this); |
| 902 | 911 |
| 903 // We check whether we are trying to switch to the state we're already going | 912 // We check whether we are trying to switch to the state we're already going |
| 904 // to (i.e. if we're already switching to fullscreen but the fullscreen | 913 // to (i.e. if we're already switching to fullscreen but the fullscreen |
| 905 // container isn't ready yet, don't do anything more). | 914 // container isn't ready yet, don't do anything more). |
| 906 if (fullscreen == IsFullscreenOrPending()) | 915 if (fullscreen == IsFullscreenOrPending()) |
| 907 return; | 916 return; |
| 908 | 917 |
| 918 // Unbind current 2D or 3D graphics context. | |
| 919 BindGraphics(pp_instance(), 0); | |
|
jeremya
2011/09/09 17:45:35
Is it necessary to unbind the graphics context her
polina
2011/09/26 21:57:00
That's what the interface documentation in the hea
| |
| 920 | |
| 921 VLOG(1) << "Setting fullscreen to " << (fullscreen ? "on" : "off"); | |
| 922 desired_fullscreen_state_ = fullscreen; | |
| 923 if (fullscreen) | |
| 924 container_->element().requestFullScreen(); | |
| 925 else | |
| 926 container_->element().document().cancelFullScreen(); | |
| 927 if (!delay_report) { | |
| 928 ReportGeometry(); | |
| 929 } else { | |
| 930 MessageLoop::current()->PostTask( | |
| 931 FROM_HERE, NewRunnableMethod(this, &PluginInstance::ReportGeometry)); | |
| 932 } | |
| 933 } | |
| 934 | |
| 935 void PluginInstance::SetFullscreen_Dev(bool fullscreen, bool delay_report) { | |
| 936 // Keep a reference on the stack. See NOTE above. | |
| 937 scoped_refptr<PluginInstance> ref(this); | |
| 938 | |
| 939 // We check whether we are trying to switch to the state we're already going | |
| 940 // to (i.e. if we're already switching to fullscreen but the fullscreen | |
| 941 // container isn't ready yet, don't do anything more). | |
| 942 if (fullscreen == IsFullscreenOrPending_Dev()) | |
| 943 return; | |
| 944 | |
| 945 // Unbind current 2D or 3D graphics context. | |
| 909 BindGraphics(pp_instance(), 0); | 946 BindGraphics(pp_instance(), 0); |
| 910 VLOG(1) << "Setting fullscreen to " << (fullscreen ? "on" : "off"); | 947 VLOG(1) << "Setting fullscreen to " << (fullscreen ? "on" : "off"); |
| 911 if (fullscreen) { | 948 if (fullscreen) { |
| 912 DCHECK(!fullscreen_container_); | 949 DCHECK(!fullscreen_container_); |
| 913 fullscreen_container_ = delegate_->CreateFullscreenContainer(this); | 950 fullscreen_container_ = delegate_->CreateFullscreenContainer(this); |
| 914 } else { | 951 } else { |
| 915 DCHECK(fullscreen_container_); | 952 DCHECK(fullscreen_container_); |
| 916 fullscreen_container_->Destroy(); | 953 fullscreen_container_->Destroy(); |
| 917 fullscreen_container_ = NULL; | 954 fullscreen_container_ = NULL; |
| 918 fullscreen_ = false; | 955 fullscreen_dev_ = false; |
| 919 if (!delay_report) { | 956 if (!delay_report) { |
| 920 ReportGeometry(); | 957 ReportGeometry(); |
| 921 } else { | 958 } else { |
| 922 MessageLoop::current()->PostTask( | 959 MessageLoop::current()->PostTask( |
| 923 FROM_HERE, NewRunnableMethod(this, &PluginInstance::ReportGeometry)); | 960 FROM_HERE, NewRunnableMethod(this, &PluginInstance::ReportGeometry)); |
| 924 } | 961 } |
| 925 } | 962 } |
| 926 } | 963 } |
| 927 | 964 |
| 928 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, | 965 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1234 PPB_Surface3D_Impl* PluginInstance::GetBoundSurface3D() const { | 1271 PPB_Surface3D_Impl* PluginInstance::GetBoundSurface3D() const { |
| 1235 if (bound_graphics_.get() == NULL) | 1272 if (bound_graphics_.get() == NULL) |
| 1236 return NULL; | 1273 return NULL; |
| 1237 | 1274 |
| 1238 if (bound_graphics_->AsPPB_Surface3D_API()) | 1275 if (bound_graphics_->AsPPB_Surface3D_API()) |
| 1239 return static_cast<PPB_Surface3D_Impl*>(bound_graphics_.get()); | 1276 return static_cast<PPB_Surface3D_Impl*>(bound_graphics_.get()); |
| 1240 return NULL; | 1277 return NULL; |
| 1241 } | 1278 } |
| 1242 | 1279 |
| 1243 void PluginInstance::setBackingTextureId(unsigned int id) { | 1280 void PluginInstance::setBackingTextureId(unsigned int id) { |
| 1244 // If we have a full-screen container_ then the plugin is fullscreen, | 1281 // If we have a fullscreen_container_ (under PPB_Fullscreen_Dev) |
| 1245 // and the parent context is not the one for the browser page, but for the | 1282 // or desired_fullscreen_state is true (under PPB_Fullscreen), |
| 1246 // full-screen window, and so the parent texture ID doesn't correspond to | 1283 // then the plugin is fullscreen or transitioning to fullscreen |
| 1247 // anything in the page's context. | 1284 // and the parent context is not the one for the browser page, |
| 1285 // but for the fullscreen window, and so the parent texture ID | |
| 1286 // doesn't correspond to anything in the page's context. | |
| 1248 // | 1287 // |
| 1249 // TODO(alokp): It would be better at some point to have the equivalent | 1288 // TODO(alokp): It would be better at some point to have the equivalent |
| 1250 // in the FullscreenContainer so that we don't need to poll | 1289 // in the FullscreenContainer so that we don't need to poll |
| 1251 if (fullscreen_container_) | 1290 if (fullscreen_container_ || desired_fullscreen_state_) |
| 1252 return; | 1291 return; |
| 1253 | 1292 |
| 1254 if (container_) | 1293 if (container_) |
| 1255 container_->setBackingTextureId(id); | 1294 container_->setBackingTextureId(id); |
| 1256 } | 1295 } |
| 1257 | 1296 |
| 1258 void PluginInstance::AddPluginObject(PluginObject* plugin_object) { | 1297 void PluginInstance::AddPluginObject(PluginObject* plugin_object) { |
| 1259 DCHECK(live_plugin_objects_.find(plugin_object) == | 1298 DCHECK(live_plugin_objects_.find(plugin_object) == |
| 1260 live_plugin_objects_.end()); | 1299 live_plugin_objects_.end()); |
| 1261 live_plugin_objects_.insert(plugin_object); | 1300 live_plugin_objects_.insert(plugin_object); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1289 bound_graphics_ = NULL; | 1328 bound_graphics_ = NULL; |
| 1290 } | 1329 } |
| 1291 | 1330 |
| 1292 // Special-case clearing the current device. | 1331 // Special-case clearing the current device. |
| 1293 if (!device) { | 1332 if (!device) { |
| 1294 setBackingTextureId(0); | 1333 setBackingTextureId(0); |
| 1295 InvalidateRect(gfx::Rect()); | 1334 InvalidateRect(gfx::Rect()); |
| 1296 return PP_TRUE; | 1335 return PP_TRUE; |
| 1297 } | 1336 } |
| 1298 | 1337 |
| 1299 // Refuse to bind if we're transitioning to fullscreen. | 1338 // Refuse to bind if we're transitioning to fullscreen with PPB_Fullscreen_Dev |
| 1300 if (fullscreen_container_ && !fullscreen_) | 1339 // or to/from fullscreen with PPB_Fullscreen. |
| 1340 if ((fullscreen_container_ && !fullscreen_dev_) || | |
| 1341 desired_fullscreen_state_ != fullscreen_) | |
| 1301 return PP_FALSE; | 1342 return PP_FALSE; |
| 1302 | 1343 |
| 1303 EnterResourceNoLock<PPB_Graphics2D_API> enter_2d(device, false); | 1344 EnterResourceNoLock<PPB_Graphics2D_API> enter_2d(device, false); |
| 1304 PPB_Graphics2D_Impl* graphics_2d = enter_2d.succeeded() ? | 1345 PPB_Graphics2D_Impl* graphics_2d = enter_2d.succeeded() ? |
| 1305 static_cast<PPB_Graphics2D_Impl*>(enter_2d.object()) : NULL; | 1346 static_cast<PPB_Graphics2D_Impl*>(enter_2d.object()) : NULL; |
| 1306 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); | 1347 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); |
| 1307 PPB_Graphics3D_Impl* graphics_3d = enter_3d.succeeded() ? | 1348 PPB_Graphics3D_Impl* graphics_3d = enter_3d.succeeded() ? |
| 1308 static_cast<PPB_Graphics3D_Impl*>(enter_3d.object()) : NULL; | 1349 static_cast<PPB_Graphics3D_Impl*>(enter_3d.object()) : NULL; |
| 1309 EnterResourceNoLock<PPB_Surface3D_API> enter_surface_3d(device, false); | 1350 EnterResourceNoLock<PPB_Surface3D_API> enter_surface_3d(device, false); |
| 1310 PPB_Surface3D_Impl* surface_3d = enter_surface_3d.succeeded() ? | 1351 PPB_Surface3D_Impl* surface_3d = enter_surface_3d.succeeded() ? |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1409 | 1450 |
| 1410 PP_Var ret = NPVariantToPPVar(this, &result); | 1451 PP_Var ret = NPVariantToPPVar(this, &result); |
| 1411 WebBindings::releaseVariantValue(&result); | 1452 WebBindings::releaseVariantValue(&result); |
| 1412 return ret; | 1453 return ret; |
| 1413 } | 1454 } |
| 1414 | 1455 |
| 1415 PP_Bool PluginInstance::IsFullscreen(PP_Instance instance) { | 1456 PP_Bool PluginInstance::IsFullscreen(PP_Instance instance) { |
| 1416 return PP_FromBool(fullscreen_); | 1457 return PP_FromBool(fullscreen_); |
| 1417 } | 1458 } |
| 1418 | 1459 |
| 1460 PP_Bool PluginInstance::IsFullscreen_Dev(PP_Instance instance) { | |
| 1461 return PP_FromBool(fullscreen_dev_); | |
| 1462 } | |
| 1463 | |
| 1419 PP_Bool PluginInstance::SetFullscreen(PP_Instance instance, | 1464 PP_Bool PluginInstance::SetFullscreen(PP_Instance instance, |
| 1420 PP_Bool fullscreen) { | 1465 PP_Bool fullscreen) { |
| 1421 SetFullscreen(PP_ToBool(fullscreen), true); | 1466 SetFullscreen(PP_ToBool(fullscreen), true); |
| 1422 return PP_TRUE; | 1467 return PP_TRUE; |
| 1423 } | 1468 } |
| 1424 | 1469 |
| 1470 PP_Bool PluginInstance::SetFullscreen_Dev(PP_Instance instance, | |
| 1471 PP_Bool fullscreen) { | |
| 1472 SetFullscreen_Dev(PP_ToBool(fullscreen), true); | |
| 1473 return PP_TRUE; | |
| 1474 } | |
| 1475 | |
| 1425 PP_Bool PluginInstance::GetScreenSize(PP_Instance instance, PP_Size* size) { | 1476 PP_Bool PluginInstance::GetScreenSize(PP_Instance instance, PP_Size* size) { |
| 1426 gfx::Size screen_size = delegate()->GetScreenSize(); | 1477 gfx::Size screen_size = delegate()->GetScreenSize(); |
| 1427 *size = PP_MakeSize(screen_size.width(), screen_size.height()); | 1478 *size = PP_MakeSize(screen_size.width(), screen_size.height()); |
| 1428 return PP_TRUE; | 1479 return PP_TRUE; |
| 1429 } | 1480 } |
| 1430 | 1481 |
| 1482 PP_Bool PluginInstance::GetScreenSize_Dev(PP_Instance instance, PP_Size* size) { | |
| 1483 return GetScreenSize(instance, size); | |
| 1484 } | |
| 1485 | |
| 1431 int32_t PluginInstance::RequestInputEvents(PP_Instance instance, | 1486 int32_t PluginInstance::RequestInputEvents(PP_Instance instance, |
| 1432 uint32_t event_classes) { | 1487 uint32_t event_classes) { |
| 1433 input_event_mask_ |= event_classes; | 1488 input_event_mask_ |= event_classes; |
| 1434 filtered_input_event_mask_ &= ~(event_classes); | 1489 filtered_input_event_mask_ &= ~(event_classes); |
| 1435 return ValidateRequestInputEvents(false, event_classes); | 1490 return ValidateRequestInputEvents(false, event_classes); |
| 1436 } | 1491 } |
| 1437 | 1492 |
| 1438 int32_t PluginInstance::RequestFilteringInputEvents(PP_Instance instance, | 1493 int32_t PluginInstance::RequestFilteringInputEvents(PP_Instance instance, |
| 1439 uint32_t event_classes) { | 1494 uint32_t event_classes) { |
| 1440 filtered_input_event_mask_ |= event_classes; | 1495 filtered_input_event_mask_ |= event_classes; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1486 } | 1541 } |
| 1487 | 1542 |
| 1488 void PluginInstance::DoSetCursor(WebCursorInfo* cursor) { | 1543 void PluginInstance::DoSetCursor(WebCursorInfo* cursor) { |
| 1489 cursor_.reset(cursor); | 1544 cursor_.reset(cursor); |
| 1490 if (fullscreen_container_) | 1545 if (fullscreen_container_) |
| 1491 fullscreen_container_->DidChangeCursor(*cursor); | 1546 fullscreen_container_->DidChangeCursor(*cursor); |
| 1492 } | 1547 } |
| 1493 | 1548 |
| 1494 } // namespace ppapi | 1549 } // namespace ppapi |
| 1495 } // namespace webkit | 1550 } // namespace webkit |
| OLD | NEW |