| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/pepper/ppb_var_deprecated_impl.h" | 5 #include "content/renderer/pepper/ppb_var_deprecated_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "content/renderer/pepper/common.h" | 9 #include "content/renderer/pepper/common.h" |
| 10 #include "content/renderer/pepper/host_globals.h" | 10 #include "content/renderer/pepper/host_globals.h" |
| 11 #include "content/renderer/pepper/npapi_glue.h" | 11 #include "content/renderer/pepper/npapi_glue.h" |
| 12 #include "content/renderer/pepper/npobject_var.h" | 12 #include "content/renderer/pepper/npobject_var.h" |
| 13 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 13 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 14 #include "content/renderer/pepper/plugin_module.h" | 14 #include "content/renderer/pepper/plugin_module.h" |
| 15 #include "content/renderer/pepper/plugin_object.h" | 15 #include "content/renderer/pepper/plugin_object.h" |
| 16 #include "ppapi/c/dev/ppb_var_deprecated.h" | 16 #include "ppapi/c/dev/ppb_var_deprecated.h" |
| 17 #include "ppapi/c/ppb_var.h" | 17 #include "ppapi/c/ppb_var.h" |
| 18 #include "ppapi/c/pp_var.h" | 18 #include "ppapi/c/pp_var.h" |
| 19 #include "ppapi/shared_impl/ppb_var_shared.h" | 19 #include "ppapi/shared_impl/ppb_var_shared.h" |
| 20 #include "third_party/WebKit/public/web/WebBindings.h" | 20 #include "third_party/WebKit/public/web/WebBindings.h" |
| 21 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 21 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
| 22 | 22 |
| 23 using ppapi::NPObjectVar; | 23 using ppapi::NPObjectVar; |
| 24 using ppapi::PpapiGlobals; | 24 using ppapi::PpapiGlobals; |
| 25 using ppapi::StringVar; | 25 using ppapi::StringVar; |
| 26 using ppapi::Var; | 26 using ppapi::Var; |
| 27 using WebKit::WebBindings; | 27 using blink::WebBindings; |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 const char kInvalidObjectException[] = "Error: Invalid object"; | 33 const char kInvalidObjectException[] = "Error: Invalid object"; |
| 34 const char kInvalidPropertyException[] = "Error: Invalid property"; | 34 const char kInvalidPropertyException[] = "Error: Invalid property"; |
| 35 const char kInvalidValueException[] = "Error: Invalid value"; | 35 const char kInvalidValueException[] = "Error: Invalid value"; |
| 36 const char kUnableToGetPropertyException[] = "Error: Unable to get property"; | 36 const char kUnableToGetPropertyException[] = "Error: Unable to get property"; |
| 37 const char kUnableToSetPropertyException[] = "Error: Unable to set property"; | 37 const char kUnableToSetPropertyException[] = "Error: Unable to set property"; |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 PP_Var CallDeprecated(PP_Var var, | 326 PP_Var CallDeprecated(PP_Var var, |
| 327 PP_Var method_name, | 327 PP_Var method_name, |
| 328 uint32_t argc, | 328 uint32_t argc, |
| 329 PP_Var* argv, | 329 PP_Var* argv, |
| 330 PP_Var* exception) { | 330 PP_Var* exception) { |
| 331 ObjectAccessorTryCatch accessor(var, exception); | 331 ObjectAccessorTryCatch accessor(var, exception); |
| 332 if (accessor.has_exception()) | 332 if (accessor.has_exception()) |
| 333 return PP_MakeUndefined(); | 333 return PP_MakeUndefined(); |
| 334 PepperPluginInstanceImpl* plugin = accessor.GetPluginInstance(); | 334 PepperPluginInstanceImpl* plugin = accessor.GetPluginInstance(); |
| 335 if (plugin && plugin->IsProcessingUserGesture()) { | 335 if (plugin && plugin->IsProcessingUserGesture()) { |
| 336 WebKit::WebScopedUserGesture user_gesture( | 336 blink::WebScopedUserGesture user_gesture( |
| 337 plugin->CurrentUserGestureToken()); | 337 plugin->CurrentUserGestureToken()); |
| 338 return InternalCallDeprecated(&accessor, method_name, argc, argv, | 338 return InternalCallDeprecated(&accessor, method_name, argc, argv, |
| 339 exception); | 339 exception); |
| 340 } | 340 } |
| 341 return InternalCallDeprecated(&accessor, method_name, argc, argv, exception); | 341 return InternalCallDeprecated(&accessor, method_name, argc, argv, exception); |
| 342 } | 342 } |
| 343 | 343 |
| 344 PP_Var Construct(PP_Var var, | 344 PP_Var Construct(PP_Var var, |
| 345 uint32_t argc, | 345 uint32_t argc, |
| 346 PP_Var* argv, | 346 PP_Var* argv, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 &IsInstanceOfDeprecated, | 427 &IsInstanceOfDeprecated, |
| 428 &CreateObjectDeprecated, | 428 &CreateObjectDeprecated, |
| 429 &CreateObjectWithModuleDeprecated, | 429 &CreateObjectWithModuleDeprecated, |
| 430 }; | 430 }; |
| 431 | 431 |
| 432 return &var_deprecated_interface; | 432 return &var_deprecated_interface; |
| 433 } | 433 } |
| 434 | 434 |
| 435 } // namespace content | 435 } // namespace content |
| 436 | 436 |
| OLD | NEW |