| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/glue/plugins/pepper_webplugin_impl.h" | 5 #include "webkit/plugins/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 "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
| 11 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" |
| 12 #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" |
| 13 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 13 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
| 14 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 14 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
| 15 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 15 #include "webkit/plugins/ppapi/plugin_instance.h" |
| 16 #include "webkit/glue/plugins/pepper_plugin_module.h" | 16 #include "webkit/plugins/ppapi/plugin_module.h" |
| 17 #include "webkit/glue/plugins/pepper_url_loader.h" | 17 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
| 18 #include "webkit/glue/plugins/pepper_var.h" | 18 #include "webkit/plugins/ppapi/var.h" |
| 19 | 19 |
| 20 using WebKit::WebCanvas; | 20 using WebKit::WebCanvas; |
| 21 using WebKit::WebPluginContainer; | 21 using WebKit::WebPluginContainer; |
| 22 using WebKit::WebPluginParams; | 22 using WebKit::WebPluginParams; |
| 23 using WebKit::WebPoint; | 23 using WebKit::WebPoint; |
| 24 using WebKit::WebRect; | 24 using WebKit::WebRect; |
| 25 using WebKit::WebString; | 25 using WebKit::WebString; |
| 26 using WebKit::WebURL; | 26 using WebKit::WebURL; |
| 27 using WebKit::WebVector; | 27 using WebKit::WebVector; |
| 28 using WebKit::WebView; | 28 using WebKit::WebView; |
| 29 | 29 |
| 30 namespace pepper { | 30 namespace webkit { |
| 31 namespace plugins { |
| 32 namespace ppapi { |
| 31 | 33 |
| 32 struct WebPluginImpl::InitData { | 34 struct WebPluginImpl::InitData { |
| 33 scoped_refptr<PluginModule> module; | 35 scoped_refptr<PluginModule> module; |
| 34 base::WeakPtr<PluginDelegate> delegate; | 36 base::WeakPtr<PluginDelegate> delegate; |
| 35 std::vector<std::string> arg_names; | 37 std::vector<std::string> arg_names; |
| 36 std::vector<std::string> arg_values; | 38 std::vector<std::string> arg_values; |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 WebPluginImpl::WebPluginImpl( | 41 WebPluginImpl::WebPluginImpl( |
| 40 PluginModule* plugin_module, | 42 PluginModule* plugin_module, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 WebKit::WebCursorInfo& cursor_info) { | 130 WebKit::WebCursorInfo& cursor_info) { |
| 129 if (instance_->IsFullscreen()) | 131 if (instance_->IsFullscreen()) |
| 130 return false; | 132 return false; |
| 131 return instance_->HandleInputEvent(event, &cursor_info); | 133 return instance_->HandleInputEvent(event, &cursor_info); |
| 132 } | 134 } |
| 133 | 135 |
| 134 void WebPluginImpl::didReceiveResponse( | 136 void WebPluginImpl::didReceiveResponse( |
| 135 const WebKit::WebURLResponse& response) { | 137 const WebKit::WebURLResponse& response) { |
| 136 DCHECK(!document_loader_); | 138 DCHECK(!document_loader_); |
| 137 | 139 |
| 138 document_loader_ = new URLLoader(instance_, true); | 140 document_loader_ = new PPB_URLLoader_Impl(instance_, true); |
| 139 document_loader_->didReceiveResponse(NULL, response); | 141 document_loader_->didReceiveResponse(NULL, response); |
| 140 | 142 |
| 141 if (!instance_->HandleDocumentLoad(document_loader_)) | 143 if (!instance_->HandleDocumentLoad(document_loader_)) |
| 142 document_loader_ = NULL; | 144 document_loader_ = NULL; |
| 143 } | 145 } |
| 144 | 146 |
| 145 void WebPluginImpl::didReceiveData(const char* data, int data_length) { | 147 void WebPluginImpl::didReceiveData(const char* data, int data_length) { |
| 146 if (document_loader_) | 148 if (document_loader_) |
| 147 document_loader_->didReceiveData(NULL, data, data_length); | 149 document_loader_->didReceiveData(NULL, data, data_length); |
| 148 } | 150 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 218 |
| 217 bool WebPluginImpl::printPage(int page_number, | 219 bool WebPluginImpl::printPage(int page_number, |
| 218 WebKit::WebCanvas* canvas) { | 220 WebKit::WebCanvas* canvas) { |
| 219 return instance_->PrintPage(page_number, canvas); | 221 return instance_->PrintPage(page_number, canvas); |
| 220 } | 222 } |
| 221 | 223 |
| 222 void WebPluginImpl::printEnd() { | 224 void WebPluginImpl::printEnd() { |
| 223 return instance_->PrintEnd(); | 225 return instance_->PrintEnd(); |
| 224 } | 226 } |
| 225 | 227 |
| 226 } // namespace pepper | 228 } // namespace ppapi |
| 229 } // namespace plugins |
| 230 } // namespace webkit |
| 231 |
| OLD | NEW |