Chromium Code Reviews| 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 "webkit/plugins/ppapi/ppapi_webplugin_impl.h" | 5 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 22 #include "webkit/plugins/ppapi/message_channel.h" | 22 #include "webkit/plugins/ppapi/message_channel.h" |
| 23 #include "webkit/plugins/ppapi/npobject_var.h" | 23 #include "webkit/plugins/ppapi/npobject_var.h" |
| 24 #include "webkit/plugins/ppapi/plugin_module.h" | 24 #include "webkit/plugins/ppapi/plugin_module.h" |
| 25 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 25 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 26 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 26 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
| 27 | 27 |
| 28 using ppapi::NPObjectVar; | 28 using ppapi::NPObjectVar; |
| 29 using WebKit::WebCanvas; | 29 using WebKit::WebCanvas; |
| 30 using WebKit::WebPluginContainer; | 30 using WebKit::WebPluginContainer; |
| 31 using WebKit::WebPluginParams; | 31 using WebKit::WebPluginParams; |
|
darin (slow to review)
2012/04/30 18:57:02
add using WebKit::WebPlugin here?
Bernhard Bauer
2012/04/30 19:30:36
Done.
| |
| 32 using WebKit::WebPoint; | 32 using WebKit::WebPoint; |
| 33 using WebKit::WebRect; | 33 using WebKit::WebRect; |
| 34 using WebKit::WebString; | 34 using WebKit::WebString; |
| 35 using WebKit::WebURL; | 35 using WebKit::WebURL; |
| 36 using WebKit::WebVector; | 36 using WebKit::WebVector; |
| 37 using WebKit::WebView; | 37 using WebKit::WebView; |
| 38 | 38 |
| 39 namespace webkit { | 39 namespace webkit { |
| 40 namespace ppapi { | 40 namespace ppapi { |
| 41 | 41 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 return false; | 77 return false; |
| 78 | 78 |
| 79 bool success = instance_->Initialize(container, | 79 bool success = instance_->Initialize(container, |
| 80 init_data_->arg_names, | 80 init_data_->arg_names, |
| 81 init_data_->arg_values, | 81 init_data_->arg_values, |
| 82 init_data_->url, | 82 init_data_->url, |
| 83 full_frame_); | 83 full_frame_); |
| 84 if (!success) { | 84 if (!success) { |
| 85 instance_->Delete(); | 85 instance_->Delete(); |
| 86 instance_ = NULL; | 86 instance_ = NULL; |
| 87 return false; | 87 |
| 88 WebKit::WebPlugin* replacement_plugin = | |
| 89 init_data_->delegate->CreatePluginReplacement( | |
| 90 init_data_->module->path()); | |
| 91 if (!replacement_plugin->initialize(container)) { | |
| 92 LOG(ERROR) << "Couldn't initialize replacement plug-in"; | |
|
darin (slow to review)
2012/04/30 18:57:02
do we really need all of these LOG(ERROR) statemen
Bernhard Bauer
2012/04/30 19:30:36
Right; I do want logging if we can't load the actu
| |
| 93 return false; | |
| 94 } | |
| 95 container->setPlugin(replacement_plugin); | |
| 96 return true; | |
| 88 } | 97 } |
| 89 | 98 |
| 90 init_data_.reset(); | 99 init_data_.reset(); |
| 91 return true; | 100 return true; |
| 92 } | 101 } |
| 93 | 102 |
| 94 void WebPluginImpl::destroy() { | 103 void WebPluginImpl::destroy() { |
| 95 if (instance_) { | 104 if (instance_) { |
| 96 ::ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_); | 105 ::ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_); |
| 97 instance_object_ = PP_MakeUndefined(); | 106 instance_object_ = PP_MakeUndefined(); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 266 bool WebPluginImpl::canRotateView() { | 275 bool WebPluginImpl::canRotateView() { |
| 267 return instance_->CanRotateView(); | 276 return instance_->CanRotateView(); |
| 268 } | 277 } |
| 269 | 278 |
| 270 void WebPluginImpl::rotateView(RotationType type) { | 279 void WebPluginImpl::rotateView(RotationType type) { |
| 271 instance_->RotateView(type); | 280 instance_->RotateView(type); |
| 272 } | 281 } |
| 273 | 282 |
| 274 } // namespace ppapi | 283 } // namespace ppapi |
| 275 } // namespace webkit | 284 } // namespace webkit |
| OLD | NEW |