| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/gfx/emf.h" | 10 #include "chrome/common/gfx/emf.h" |
| 11 #include "chrome/common/plugin_messages.h" | 11 #include "chrome/common/plugin_messages.h" |
| 12 #include "chrome/common/win_util.h" | 12 #include "chrome/common/win_util.h" |
| 13 #include "chrome/plugin/npobject_stub.h" | 13 #include "chrome/plugin/npobject_stub.h" |
| 14 #include "chrome/plugin/plugin_channel.h" | 14 #include "chrome/plugin/plugin_channel.h" |
| 15 #include "chrome/plugin/plugin_thread.h" | 15 #include "chrome/plugin/plugin_thread.h" |
| 16 #include "chrome/plugin/webplugin_proxy.h" | 16 #include "chrome/plugin/webplugin_proxy.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/glue/plugins/webplugin_delegate_impl.h" | |
| 21 #include "webkit/glue/webcursor.h" | 20 #include "webkit/glue/webcursor.h" |
| 21 #include "webkit/glue/webplugin_delegate.h" |
| 22 | 22 |
| 23 class FinishDestructionTask : public Task { | 23 class FinishDestructionTask : public Task { |
| 24 public: | 24 public: |
| 25 FinishDestructionTask(WebPluginDelegate* delegate, WebPlugin* webplugin) | 25 FinishDestructionTask(WebPluginDelegate* delegate, WebPlugin* webplugin) |
| 26 : delegate_(delegate), webplugin_(webplugin) { } | 26 : delegate_(delegate), webplugin_(webplugin) { } |
| 27 | 27 |
| 28 void Run() { | 28 void Run() { |
| 29 // WebPlugin must outlive WebPluginDelegate. | 29 // WebPlugin must outlive WebPluginDelegate. |
| 30 if (delegate_) | 30 if (delegate_) |
| 31 delegate_->PluginDestroyed(); | 31 delegate_->PluginDestroyed(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 char **argn = new char*[argc]; | 119 char **argn = new char*[argc]; |
| 120 char **argv = new char*[argc]; | 120 char **argv = new char*[argc]; |
| 121 for (int i = 0; i < argc; ++i) { | 121 for (int i = 0; i < argc; ++i) { |
| 122 argn[i] = const_cast<char*>(params.arg_names[i].c_str()); | 122 argn[i] = const_cast<char*>(params.arg_names[i].c_str()); |
| 123 argv[i] = const_cast<char*>(params.arg_values[i].c_str()); | 123 argv[i] = const_cast<char*>(params.arg_values[i].c_str()); |
| 124 } | 124 } |
| 125 | 125 |
| 126 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 126 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 127 FilePath path = | 127 FilePath path = |
| 128 FilePath(command_line.GetSwitchValue(switches::kPluginPath)); | 128 FilePath(command_line.GetSwitchValue(switches::kPluginPath)); |
| 129 delegate_ = WebPluginDelegateImpl::Create( | 129 delegate_ = WebPluginDelegate::Create( |
| 130 path, mime_type_, params.containing_window); | 130 path, mime_type_, params.containing_window); |
| 131 if (delegate_) { | 131 if (delegate_) { |
| 132 webplugin_ = new WebPluginProxy( | 132 webplugin_ = new WebPluginProxy( |
| 133 channel_, instance_id_, delegate_, params.modal_dialog_event); | 133 channel_, instance_id_, delegate_, params.modal_dialog_event); |
| 134 *result = delegate_->Initialize( | 134 *result = delegate_->Initialize( |
| 135 params.url, argn, argv, argc, webplugin_, params.load_manually); | 135 params.url, argn, argv, argc, webplugin_, params.load_manually); |
| 136 } | 136 } |
| 137 | 137 |
| 138 delete[] argn; | 138 delete[] argn; |
| 139 delete[] argv; | 139 delete[] argv; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 params.stream); | 333 params.stream); |
| 334 webplugin_->OnResourceCreated(params.resource_id, resource_client); | 334 webplugin_->OnResourceCreated(params.resource_id, resource_client); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void WebPluginDelegateStub::OnURLRequestRouted(const std::string& url, | 337 void WebPluginDelegateStub::OnURLRequestRouted(const std::string& url, |
| 338 bool notify_needed, | 338 bool notify_needed, |
| 339 HANDLE notify_data) { | 339 HANDLE notify_data) { |
| 340 delegate_->URLRequestRouted(url, notify_needed, notify_data); | 340 delegate_->URLRequestRouted(url, notify_needed, notify_data); |
| 341 } | 341 } |
| 342 | 342 |
| OLD | NEW |