| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/plugin/webplugin_delegate_stub.h" | 5 #include "chrome/plugin/webplugin_delegate_stub.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "chrome/common/plugin_messages.h" | 11 #include "chrome/common/plugin_messages.h" |
| 12 #include "chrome/plugin/npobject_stub.h" | 12 #include "chrome/plugin/npobject_stub.h" |
| 13 #include "chrome/plugin/plugin_channel.h" | 13 #include "chrome/plugin/plugin_channel.h" |
| 14 #include "chrome/plugin/plugin_thread.h" | 14 #include "chrome/plugin/plugin_thread.h" |
| 15 #include "chrome/plugin/webplugin_proxy.h" | 15 #include "chrome/plugin/webplugin_proxy.h" |
| 16 #include "printing/native_metafile.h" | 16 #include "printing/native_metafile.h" |
| 17 #include "third_party/npapi/bindings/npapi.h" | 17 #include "third_party/npapi/bindings/npapi.h" |
| 18 #include "third_party/npapi/bindings/npruntime.h" | 18 #include "third_party/npapi/bindings/npruntime.h" |
| 19 #include "skia/ext/platform_device.h" | 19 #include "skia/ext/platform_device.h" |
| 20 #include "webkit/api/public/WebCursorInfo.h" |
| 20 #include "webkit/glue/webcursor.h" | 21 #include "webkit/glue/webcursor.h" |
| 21 #include "webkit/glue/webplugin_delegate.h" | 22 #include "webkit/glue/webplugin_delegate.h" |
| 22 | 23 |
| 24 using WebKit::WebCursorInfo; |
| 25 |
| 23 class FinishDestructionTask : public Task { | 26 class FinishDestructionTask : public Task { |
| 24 public: | 27 public: |
| 25 FinishDestructionTask(WebPluginDelegate* delegate, WebPlugin* webplugin) | 28 FinishDestructionTask(WebPluginDelegate* delegate, WebPlugin* webplugin) |
| 26 : delegate_(delegate), webplugin_(webplugin) { } | 29 : delegate_(delegate), webplugin_(webplugin) { } |
| 27 | 30 |
| 28 void Run() { | 31 void Run() { |
| 29 // WebPlugin must outlive WebPluginDelegate. | 32 // WebPlugin must outlive WebPluginDelegate. |
| 30 if (delegate_) | 33 if (delegate_) |
| 31 delegate_->PluginDestroyed(); | 34 delegate_->PluginDestroyed(); |
| 32 | 35 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 210 } |
| 208 | 211 |
| 209 void WebPluginDelegateStub::OnSetFocus() { | 212 void WebPluginDelegateStub::OnSetFocus() { |
| 210 delegate_->SetFocus(); | 213 delegate_->SetFocus(); |
| 211 } | 214 } |
| 212 | 215 |
| 213 void WebPluginDelegateStub::OnHandleInputEvent( | 216 void WebPluginDelegateStub::OnHandleInputEvent( |
| 214 const WebKit::WebInputEvent *event, | 217 const WebKit::WebInputEvent *event, |
| 215 bool* handled, | 218 bool* handled, |
| 216 WebCursor* cursor) { | 219 WebCursor* cursor) { |
| 217 *handled = delegate_->HandleInputEvent(*event, cursor); | 220 WebCursorInfo cursor_info; |
| 221 *handled = delegate_->HandleInputEvent(*event, &cursor_info); |
| 222 cursor->InitFromCursorInfo(cursor_info); |
| 218 } | 223 } |
| 219 | 224 |
| 220 void WebPluginDelegateStub::OnPaint(const gfx::Rect& damaged_rect) { | 225 void WebPluginDelegateStub::OnPaint(const gfx::Rect& damaged_rect) { |
| 221 webplugin_->Paint(damaged_rect); | 226 webplugin_->Paint(damaged_rect); |
| 222 } | 227 } |
| 223 | 228 |
| 224 void WebPluginDelegateStub::OnDidPaint() { | 229 void WebPluginDelegateStub::OnDidPaint() { |
| 225 webplugin_->DidPaint(); | 230 webplugin_->DidPaint(); |
| 226 } | 231 } |
| 227 | 232 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 params.notify_data, | 363 params.notify_data, |
| 359 params.stream); | 364 params.stream); |
| 360 webplugin_->OnResourceCreated(params.resource_id, resource_client); | 365 webplugin_->OnResourceCreated(params.resource_id, resource_client); |
| 361 } | 366 } |
| 362 | 367 |
| 363 void WebPluginDelegateStub::OnURLRequestRouted(const std::string& url, | 368 void WebPluginDelegateStub::OnURLRequestRouted(const std::string& url, |
| 364 bool notify_needed, | 369 bool notify_needed, |
| 365 intptr_t notify_data) { | 370 intptr_t notify_data) { |
| 366 delegate_->URLRequestRouted(url, notify_needed, notify_data); | 371 delegate_->URLRequestRouted(url, notify_needed, notify_data); |
| 367 } | 372 } |
| OLD | NEW |