| 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 "content/plugin/webplugin_delegate_stub.h" | 5 #include "content/plugin/webplugin_delegate_stub.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 *result = false; | 158 *result = false; |
| 159 if (params.arg_names.size() != params.arg_values.size()) { | 159 if (params.arg_names.size() != params.arg_values.size()) { |
| 160 NOTREACHED(); | 160 NOTREACHED(); |
| 161 return; | 161 return; |
| 162 } | 162 } |
| 163 | 163 |
| 164 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 164 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 165 base::FilePath path = | 165 base::FilePath path = |
| 166 command_line.GetSwitchValuePath(switches::kPluginPath); | 166 command_line.GetSwitchValuePath(switches::kPluginPath); |
| 167 | 167 |
| 168 webplugin_ = new WebPluginProxy( | 168 webplugin_ = new WebPluginProxy(channel_.get(), |
| 169 channel_, instance_id_, page_url_, params.host_render_view_routing_id); | 169 instance_id_, |
| 170 page_url_, |
| 171 params.host_render_view_routing_id); |
| 170 delegate_ = webkit::npapi::WebPluginDelegateImpl::Create(path, mime_type_); | 172 delegate_ = webkit::npapi::WebPluginDelegateImpl::Create(path, mime_type_); |
| 171 if (delegate_) { | 173 if (delegate_) { |
| 172 webplugin_->set_delegate(delegate_); | 174 webplugin_->set_delegate(delegate_); |
| 173 std::vector<std::string> arg_names = params.arg_names; | 175 std::vector<std::string> arg_names = params.arg_names; |
| 174 std::vector<std::string> arg_values = params.arg_values; | 176 std::vector<std::string> arg_values = params.arg_values; |
| 175 | 177 |
| 176 *result = delegate_->Initialize(params.url, | 178 *result = delegate_->Initialize(params.url, |
| 177 arg_names, | 179 arg_names, |
| 178 arg_values, | 180 arg_values, |
| 179 webplugin_, | 181 webplugin_, |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 } | 392 } |
| 391 | 393 |
| 392 void WebPluginDelegateStub::OnHTTPRangeRequestReply( | 394 void WebPluginDelegateStub::OnHTTPRangeRequestReply( |
| 393 unsigned long resource_id, int range_request_id) { | 395 unsigned long resource_id, int range_request_id) { |
| 394 WebPluginResourceClient* resource_client = | 396 WebPluginResourceClient* resource_client = |
| 395 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); | 397 delegate_->CreateSeekableResourceClient(resource_id, range_request_id); |
| 396 webplugin_->OnResourceCreated(resource_id, resource_client); | 398 webplugin_->OnResourceCreated(resource_id, resource_client); |
| 397 } | 399 } |
| 398 | 400 |
| 399 } // namespace content | 401 } // namespace content |
| OLD | NEW |