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/npapi/webplugin_delegate_impl.h" | 5 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
15 #include "webkit/glue/webkit_glue.h" | 15 #include "webkit/glue/webkit_glue.h" |
16 #include "webkit/plugins/npapi/plugin_instance.h" | 16 #include "webkit/plugins/npapi/plugin_instance.h" |
17 #include "webkit/plugins/npapi/plugin_lib.h" | 17 #include "webkit/plugins/npapi/plugin_lib.h" |
18 #include "webkit/plugins/npapi/plugin_stream_url.h" | 18 #include "webkit/plugins/npapi/plugin_stream_url.h" |
19 | 19 |
20 using WebKit::WebCursorInfo; | 20 using WebKit::WebCursorInfo; |
21 using WebKit::WebInputEvent; | 21 using WebKit::WebInputEvent; |
22 | 22 |
23 namespace webkit { | 23 namespace webkit { |
24 namespace npapi { | 24 namespace npapi { |
25 | 25 |
26 WebPluginDelegateImpl* WebPluginDelegateImpl::Create( | 26 WebPluginDelegateImpl* WebPluginDelegateImpl::Create( |
27 const FilePath& filename, | 27 const base::FilePath& filename, |
28 const std::string& mime_type) { | 28 const std::string& mime_type) { |
29 scoped_refptr<PluginLib> plugin_lib(PluginLib::CreatePluginLib(filename)); | 29 scoped_refptr<PluginLib> plugin_lib(PluginLib::CreatePluginLib(filename)); |
30 if (plugin_lib.get() == NULL) | 30 if (plugin_lib.get() == NULL) |
31 return NULL; | 31 return NULL; |
32 | 32 |
33 NPError err = plugin_lib->NP_Initialize(); | 33 NPError err = plugin_lib->NP_Initialize(); |
34 if (err != NPERR_NO_ERROR) | 34 if (err != NPERR_NO_ERROR) |
35 return NULL; | 35 return NULL; |
36 | 36 |
37 scoped_refptr<PluginInstance> instance(plugin_lib->CreateInstance(mime_type)); | 37 scoped_refptr<PluginInstance> instance(plugin_lib->CreateInstance(mime_type)); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 } | 232 } |
233 | 233 |
234 void WebPluginDelegateImpl::DidFinishManualLoading() { | 234 void WebPluginDelegateImpl::DidFinishManualLoading() { |
235 instance()->DidFinishManualLoading(); | 235 instance()->DidFinishManualLoading(); |
236 } | 236 } |
237 | 237 |
238 void WebPluginDelegateImpl::DidManualLoadFail() { | 238 void WebPluginDelegateImpl::DidManualLoadFail() { |
239 instance()->DidManualLoadFail(); | 239 instance()->DidManualLoadFail(); |
240 } | 240 } |
241 | 241 |
242 FilePath WebPluginDelegateImpl::GetPluginPath() { | 242 base::FilePath WebPluginDelegateImpl::GetPluginPath() { |
243 return instance()->plugin_lib()->plugin_info().path; | 243 return instance()->plugin_lib()->plugin_info().path; |
244 } | 244 } |
245 | 245 |
246 void WebPluginDelegateImpl::WindowedUpdateGeometry( | 246 void WebPluginDelegateImpl::WindowedUpdateGeometry( |
247 const gfx::Rect& window_rect, | 247 const gfx::Rect& window_rect, |
248 const gfx::Rect& clip_rect) { | 248 const gfx::Rect& clip_rect) { |
249 if (WindowedReposition(window_rect, clip_rect) || | 249 if (WindowedReposition(window_rect, clip_rect) || |
250 !windowed_did_set_window_) { | 250 !windowed_did_set_window_) { |
251 // Let the plugin know that it has been moved | 251 // Let the plugin know that it has been moved |
252 WindowedSetWindow(); | 252 WindowedSetWindow(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 resource_id, url, std::string(), notify_id); | 291 resource_id, url, std::string(), notify_id); |
292 } | 292 } |
293 | 293 |
294 WebPluginResourceClient* WebPluginDelegateImpl::CreateSeekableResourceClient( | 294 WebPluginResourceClient* WebPluginDelegateImpl::CreateSeekableResourceClient( |
295 unsigned long resource_id, int range_request_id) { | 295 unsigned long resource_id, int range_request_id) { |
296 return instance()->GetRangeRequest(range_request_id); | 296 return instance()->GetRangeRequest(range_request_id); |
297 } | 297 } |
298 | 298 |
299 } // namespace npapi | 299 } // namespace npapi |
300 } // namespace webkit | 300 } // namespace webkit |
OLD | NEW |