| 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/browser/plugin_service_impl.h" | 5 #include "content/browser/plugin_service_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 GetPlugins(base::Bind( | 330 GetPlugins(base::Bind( |
| 331 &PluginServiceImpl::ForwardGetAllowedPluginForOpenChannelToPlugin, | 331 &PluginServiceImpl::ForwardGetAllowedPluginForOpenChannelToPlugin, |
| 332 base::Unretained(this), params, url, mime_type, client)); | 332 base::Unretained(this), params, url, mime_type, client)); |
| 333 } | 333 } |
| 334 | 334 |
| 335 void PluginServiceImpl::OpenChannelToPpapiPlugin( | 335 void PluginServiceImpl::OpenChannelToPpapiPlugin( |
| 336 const FilePath& path, | 336 const FilePath& path, |
| 337 PpapiPluginProcessHost::PluginClient* client) { | 337 PpapiPluginProcessHost::PluginClient* client) { |
| 338 PpapiPluginProcessHost* plugin_host = FindOrStartPpapiPluginProcess( | 338 PpapiPluginProcessHost* plugin_host = FindOrStartPpapiPluginProcess( |
| 339 path, client); | 339 path, client); |
| 340 if (plugin_host) | 340 if (plugin_host) { |
| 341 plugin_host->OpenChannelToPlugin(client); | 341 plugin_host->OpenChannelToPlugin(client); |
| 342 else // Send error. | 342 } else { |
| 343 client->OnChannelOpened(base::kNullProcessHandle, IPC::ChannelHandle()); | 343 // Send error. |
| 344 client->OnPpapiChannelOpened(base::kNullProcessHandle, |
| 345 IPC::ChannelHandle()); |
| 346 } |
| 344 } | 347 } |
| 345 | 348 |
| 346 void PluginServiceImpl::OpenChannelToPpapiBroker( | 349 void PluginServiceImpl::OpenChannelToPpapiBroker( |
| 347 const FilePath& path, | 350 const FilePath& path, |
| 348 PpapiPluginProcessHost::BrokerClient* client) { | 351 PpapiPluginProcessHost::BrokerClient* client) { |
| 349 PpapiPluginProcessHost* plugin_host = FindOrStartPpapiBrokerProcess(path); | 352 PpapiPluginProcessHost* plugin_host = FindOrStartPpapiBrokerProcess(path); |
| 350 if (plugin_host) | 353 if (plugin_host) { |
| 351 plugin_host->OpenChannelToPlugin(client); | 354 plugin_host->OpenChannelToPlugin(client); |
| 352 else // Send error. | 355 } else { |
| 353 client->OnChannelOpened(base::kNullProcessHandle, IPC::ChannelHandle()); | 356 // Send error. |
| 357 client->OnPpapiChannelOpened(base::kNullProcessHandle, |
| 358 IPC::ChannelHandle()); |
| 359 } |
| 354 } | 360 } |
| 355 | 361 |
| 356 void PluginServiceImpl::CancelOpenChannelToNpapiPlugin( | 362 void PluginServiceImpl::CancelOpenChannelToNpapiPlugin( |
| 357 PluginProcessHost::Client* client) { | 363 PluginProcessHost::Client* client) { |
| 358 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 364 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 359 DCHECK(ContainsKey(pending_plugin_clients_, client)); | 365 DCHECK(ContainsKey(pending_plugin_clients_, client)); |
| 360 pending_plugin_clients_.erase(client); | 366 pending_plugin_clients_.erase(client); |
| 361 } | 367 } |
| 362 | 368 |
| 363 void PluginServiceImpl::ForwardGetAllowedPluginForOpenChannelToPlugin( | 369 void PluginServiceImpl::ForwardGetAllowedPluginForOpenChannelToPlugin( |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 plugin_list_->RegisterInternalPlugin(info, add_at_beginning); | 692 plugin_list_->RegisterInternalPlugin(info, add_at_beginning); |
| 687 } | 693 } |
| 688 | 694 |
| 689 string16 PluginServiceImpl::GetPluginGroupName(const std::string& plugin_name) { | 695 string16 PluginServiceImpl::GetPluginGroupName(const std::string& plugin_name) { |
| 690 return plugin_list_->GetPluginGroupName(plugin_name); | 696 return plugin_list_->GetPluginGroupName(plugin_name); |
| 691 } | 697 } |
| 692 | 698 |
| 693 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { | 699 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { |
| 694 return plugin_list_; | 700 return plugin_list_; |
| 695 } | 701 } |
| OLD | NEW |