Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/plugin_process_host.h" | 5 #include "chrome/browser/plugin_process_host.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "app/app_switches.h" | 15 #include "app/app_switches.h" |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/file_path.h" | 17 #include "base/file_path.h" |
| 18 #include "base/file_util.h" | 18 #include "base/file_util.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 21 #include "base/string_util.h" | 21 #include "base/string_util.h" |
| 22 #include "base/utf_string_conversions.h" | 22 #include "base/utf_string_conversions.h" |
| 23 #include "chrome/browser/browser_process.h" | |
| 23 #include "chrome/browser/browser_thread.h" | 24 #include "chrome/browser/browser_thread.h" |
| 24 #include "chrome/browser/child_process_security_policy.h" | 25 #include "chrome/browser/child_process_security_policy.h" |
| 25 #include "chrome/browser/chrome_plugin_browsing_context.h" | 26 #include "chrome/browser/chrome_plugin_browsing_context.h" |
| 26 #include "chrome/browser/net/url_request_tracking.h" | 27 #include "chrome/browser/net/url_request_tracking.h" |
| 27 #include "chrome/browser/plugin_download_helper.h" | 28 #include "chrome/browser/plugin_download_helper.h" |
| 28 #include "chrome/browser/plugin_service.h" | 29 #include "chrome/browser/plugin_service.h" |
| 30 #include "chrome/browser/prefs/pref_service.h" | |
| 29 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| 30 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 32 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 31 #include "chrome/browser/renderer_host/resource_message_filter.h" | 33 #include "chrome/browser/renderer_host/resource_message_filter.h" |
| 32 #include "chrome/common/chrome_paths.h" | 34 #include "chrome/common/chrome_paths.h" |
| 33 #include "chrome/common/chrome_plugin_lib.h" | 35 #include "chrome/common/chrome_plugin_lib.h" |
| 34 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/common/logging_chrome.h" | 37 #include "chrome/common/logging_chrome.h" |
| 36 #include "chrome/common/net/url_request_context_getter.h" | 38 #include "chrome/common/net/url_request_context_getter.h" |
| 37 #include "chrome/common/plugin_messages.h" | 39 #include "chrome/common/plugin_messages.h" |
| 40 #include "chrome/common/pref_names.h" | |
| 38 #include "chrome/common/render_messages.h" | 41 #include "chrome/common/render_messages.h" |
| 39 #include "chrome/common/render_messages_params.h" | 42 #include "chrome/common/render_messages_params.h" |
| 40 #include "ipc/ipc_switches.h" | 43 #include "ipc/ipc_switches.h" |
| 41 #include "net/base/cookie_store.h" | 44 #include "net/base/cookie_store.h" |
| 42 #include "net/base/io_buffer.h" | 45 #include "net/base/io_buffer.h" |
| 43 #include "net/url_request/url_request.h" | 46 #include "net/url_request/url_request.h" |
| 44 #include "net/url_request/url_request_context.h" | 47 #include "net/url_request/url_request_context.h" |
| 45 #include "ui/base/ui_base_switches.h" | 48 #include "ui/base/ui_base_switches.h" |
| 46 #include "ui/gfx/native_widget_types.h" | 49 #include "ui/gfx/native_widget_types.h" |
| 47 | 50 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 | 455 |
| 453 client->OnChannelOpened(channel_handle); | 456 client->OnChannelOpened(channel_handle); |
| 454 sent_requests_.pop(); | 457 sent_requests_.pop(); |
| 455 } | 458 } |
| 456 | 459 |
| 457 void PluginProcessHost::OnGetPluginFinderUrl(std::string* plugin_finder_url) { | 460 void PluginProcessHost::OnGetPluginFinderUrl(std::string* plugin_finder_url) { |
| 458 if (!plugin_finder_url) { | 461 if (!plugin_finder_url) { |
| 459 NOTREACHED(); | 462 NOTREACHED(); |
| 460 return; | 463 return; |
| 461 } | 464 } |
| 462 | 465 if (!g_browser_process->disable_plugin_finder_pref()) { |
|
Bernhard Bauer
2011/02/24 10:37:07
Why is this no longer in the newest version of the
pastarmovj
2011/02/24 16:02:20
Sorry when rebasing to ToT this file got lost as i
| |
| 463 // TODO(iyengar) Add the plumbing to retrieve the default | 466 // TODO(iyengar) Add the plumbing to retrieve the default |
| 464 // plugin finder URL. | 467 // plugin finder URL. |
| 465 *plugin_finder_url = kDefaultPluginFinderURL; | 468 *plugin_finder_url = kDefaultPluginFinderURL; |
| 469 } else { | |
| 470 plugin_finder_url->clear(); | |
| 471 } | |
| 466 } | 472 } |
| 467 | 473 |
| 468 void PluginProcessHost::OnPluginMessage( | 474 void PluginProcessHost::OnPluginMessage( |
| 469 const std::vector<uint8>& data) { | 475 const std::vector<uint8>& data) { |
| 470 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 476 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 471 | 477 |
| 472 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); | 478 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); |
| 473 if (chrome_plugin) { | 479 if (chrome_plugin) { |
| 474 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); | 480 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); |
| 475 uint32 data_len = static_cast<uint32>(data.size()); | 481 uint32 data_len = static_cast<uint32>(data.size()); |
| 476 chrome_plugin->functions().on_message(data_ptr, data_len); | 482 chrome_plugin->functions().on_message(data_ptr, data_len); |
| 477 } | 483 } |
| 478 } | 484 } |
| OLD | NEW |