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" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 return; | 116 return; |
117 } | 117 } |
118 | 118 |
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 CommandLine command_line; | 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_ = WebPluginDelegateImpl::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 } |
(...skipping 196 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 |