| Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
|
| ===================================================================
|
| --- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 93207)
|
| +++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
|
| @@ -200,18 +200,6 @@
|
| new ::ppapi::PPP_Instance_Combined(*interface));
|
| }
|
|
|
| -// static
|
| -PluginInstance* PluginInstance::Create1_0(PluginDelegate* delegate,
|
| - PluginModule* module,
|
| - const void* ppp_instance_if_1_0) {
|
| - const PPP_Instance_1_0* interface =
|
| - static_cast<const PPP_Instance_1_0*>(ppp_instance_if_1_0);
|
| - return new PluginInstance(
|
| - delegate,
|
| - module,
|
| - new ::ppapi::PPP_Instance_Combined(*interface));
|
| -}
|
| -
|
| PluginInstance::PluginInstance(
|
| PluginDelegate* delegate,
|
| PluginModule* module,
|
| @@ -431,16 +419,16 @@
|
| argc++;
|
| }
|
|
|
| - return PP_ToBool(instance_interface_->DidCreate(pp_instance(),
|
| - argc,
|
| - argn.get(),
|
| - argv.get()));
|
| + return PPBoolToBool(instance_interface_->DidCreate(pp_instance(),
|
| + argc,
|
| + argn.get(),
|
| + argv.get()));
|
| }
|
|
|
| bool PluginInstance::HandleDocumentLoad(PPB_URLLoader_Impl* loader) {
|
| Resource::ScopedResourceId resource(loader);
|
| - return PP_ToBool(instance_interface_->HandleDocumentLoad(pp_instance(),
|
| - resource.id));
|
| + return PPBoolToBool(instance_interface_->HandleDocumentLoad(pp_instance(),
|
| + resource.id));
|
| }
|
|
|
| bool PluginInstance::HandleInputEvent(const WebKit::WebInputEvent& event,
|
| @@ -471,7 +459,7 @@
|
| new PPB_InputEvent_Impl(this, events[i]));
|
| PP_Resource resource = event_resource->GetReference();
|
|
|
| - rv |= PP_ToBool(plugin_input_event_interface_->HandleInputEvent(
|
| + rv |= PPBoolToBool(plugin_input_event_interface_->HandleInputEvent(
|
| pp_instance(), event_resource->GetReference()));
|
|
|
| // Release the reference we took above.
|
| @@ -480,19 +468,15 @@
|
| }
|
| }
|
|
|
| - // For compatibility, also send all input events through the old interface,
|
| - // if it exists.
|
| + // For compatibility, also send all input events through the old interface.
|
| // TODO(brettw) remove this.
|
| - if (instance_interface_->HandleInputEvent_0_5) {
|
| - std::vector<PP_InputEvent> pp_events;
|
| - CreatePPEvent(event, &pp_events);
|
| + std::vector<PP_InputEvent> pp_events;
|
| + CreatePPEvent(event, &pp_events);
|
|
|
| - // Each input event may generate more than one PP_InputEvent.
|
| - for (size_t i = 0; i < pp_events.size(); i++) {
|
| - rv |= PP_ToBool(
|
| - instance_interface_->HandleInputEvent_0_5(pp_instance(),
|
| - &pp_events[i]));
|
| - }
|
| + // Each input event may generate more than one PP_InputEvent.
|
| + for (size_t i = 0; i < pp_events.size(); i++) {
|
| + rv |= PPBoolToBool(instance_interface_->HandleInputEvent(pp_instance(),
|
| + &pp_events[i]));
|
| }
|
|
|
| if (cursor_.get())
|
| @@ -549,7 +533,7 @@
|
| if (PluginHasFocus() != old_plugin_focus) {
|
| delegate()->PluginFocusChanged(PluginHasFocus());
|
| instance_interface_->DidChangeFocus(pp_instance(),
|
| - PP_FromBool(PluginHasFocus()));
|
| + BoolToPPBool(PluginHasFocus()));
|
| }
|
| }
|
|
|
| @@ -561,7 +545,7 @@
|
| has_content_area_focus_ = has_focus;
|
| if (PluginHasFocus() != old_plugin_focus) {
|
| instance_interface_->DidChangeFocus(pp_instance(),
|
| - PP_FromBool(PluginHasFocus()));
|
| + BoolToPPBool(PluginHasFocus()));
|
| }
|
| }
|
|
|
| @@ -621,7 +605,7 @@
|
| return string16();
|
|
|
| PP_Var rv = plugin_selection_interface_->GetSelectedText(pp_instance(),
|
| - PP_FromBool(html));
|
| + BoolToPPBool(html));
|
| scoped_refptr<StringVar> string(StringVar::FromPPVar(rv));
|
| Var::PluginReleasePPVar(rv); // Release the ref the plugin transfered to us.
|
| if (!string)
|
| @@ -651,7 +635,7 @@
|
| scoped_refptr<PluginInstance> ref(this);
|
| if (!LoadZoomInterface())
|
| return;
|
| - plugin_zoom_interface_->Zoom(pp_instance(), factor, PP_FromBool(text_only));
|
| + plugin_zoom_interface_->Zoom(pp_instance(), factor, BoolToPPBool(text_only));
|
| }
|
|
|
| bool PluginInstance::StartFind(const string16& search_text,
|
| @@ -662,11 +646,11 @@
|
| if (!LoadFindInterface())
|
| return false;
|
| find_identifier_ = identifier;
|
| - return PP_ToBool(
|
| + return PPBoolToBool(
|
| plugin_find_interface_->StartFind(
|
| pp_instance(),
|
| UTF16ToUTF8(search_text.c_str()).c_str(),
|
| - PP_FromBool(case_sensitive)));
|
| + BoolToPPBool(case_sensitive)));
|
| }
|
|
|
| void PluginInstance::SelectFindResult(bool forward) {
|
| @@ -674,7 +658,7 @@
|
| scoped_refptr<PluginInstance> ref(this);
|
| if (LoadFindInterface())
|
| plugin_find_interface_->SelectFindResult(pp_instance(),
|
| - PP_FromBool(forward));
|
| + BoolToPPBool(forward));
|
| }
|
|
|
| void PluginInstance::StopFind() {
|
| @@ -1518,7 +1502,7 @@
|
| PP_Bool fullscreen) {
|
| // TODO(yzshen): Re-enable it once fullscreen mode is supported on Windows.
|
| #if !defined(OS_WIN)
|
| - SetFullscreen(PP_ToBool(fullscreen), true);
|
| + SetFullscreen(PPBoolToBool(fullscreen), true);
|
| return PP_TRUE;
|
| #else
|
| return PP_FALSE;
|
|
|