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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/extensions/extension_process_manager.h" | 33 #include "chrome/browser/extensions/extension_process_manager.h" |
34 #include "chrome/browser/extensions/extension_service.h" | 34 #include "chrome/browser/extensions/extension_service.h" |
35 #include "chrome/browser/extensions/extension_system.h" | 35 #include "chrome/browser/extensions/extension_system.h" |
36 #include "chrome/browser/extensions/extension_web_ui.h" | 36 #include "chrome/browser/extensions/extension_web_ui.h" |
37 #include "chrome/browser/extensions/extension_webkit_preferences.h" | 37 #include "chrome/browser/extensions/extension_webkit_preferences.h" |
38 #include "chrome/browser/extensions/message_handler.h" | 38 #include "chrome/browser/extensions/message_handler.h" |
39 #include "chrome/browser/geolocation/chrome_access_token_store.h" | 39 #include "chrome/browser/geolocation/chrome_access_token_store.h" |
40 #include "chrome/browser/google/google_util.h" | 40 #include "chrome/browser/google/google_util.h" |
41 #include "chrome/browser/infobars/infobar_tab_helper.h" | 41 #include "chrome/browser/infobars/infobar_tab_helper.h" |
42 #include "chrome/browser/media/media_internals.h" | 42 #include "chrome/browser/media/media_internals.h" |
| 43 #include "chrome/browser/nacl_host/nacl_process_host.h" |
43 #include "chrome/browser/net/chrome_net_log.h" | 44 #include "chrome/browser/net/chrome_net_log.h" |
44 #include "chrome/browser/notifications/desktop_notification_service.h" | 45 #include "chrome/browser/notifications/desktop_notification_service.h" |
45 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 46 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
46 #include "chrome/browser/pepper_gtalk_message_filter.h" | 47 #include "chrome/browser/pepper_gtalk_message_filter.h" |
47 #include "chrome/browser/platform_util.h" | 48 #include "chrome/browser/platform_util.h" |
48 #include "chrome/browser/prefs/pref_service.h" | 49 #include "chrome/browser/prefs/pref_service.h" |
49 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 50 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
50 #include "chrome/browser/prerender/prerender_manager.h" | 51 #include "chrome/browser/prerender/prerender_manager.h" |
51 #include "chrome/browser/prerender/prerender_manager_factory.h" | 52 #include "chrome/browser/prerender/prerender_manager_factory.h" |
52 #include "chrome/browser/prerender/prerender_message_filter.h" | 53 #include "chrome/browser/prerender/prerender_message_filter.h" |
(...skipping 28 matching lines...) Expand all Loading... |
81 #include "chrome/common/extensions/extension_process_policy.h" | 82 #include "chrome/common/extensions/extension_process_policy.h" |
82 #include "chrome/common/extensions/extension_set.h" | 83 #include "chrome/common/extensions/extension_set.h" |
83 #include "chrome/common/logging_chrome.h" | 84 #include "chrome/common/logging_chrome.h" |
84 #include "chrome/common/pref_names.h" | 85 #include "chrome/common/pref_names.h" |
85 #include "chrome/common/render_messages.h" | 86 #include "chrome/common/render_messages.h" |
86 #include "chrome/common/url_constants.h" | 87 #include "chrome/common/url_constants.h" |
87 #include "content/public/browser/browser_child_process_host.h" | 88 #include "content/public/browser/browser_child_process_host.h" |
88 #include "content/public/browser/browser_main_parts.h" | 89 #include "content/public/browser/browser_main_parts.h" |
89 #include "content/public/browser/browser_ppapi_host.h" | 90 #include "content/public/browser/browser_ppapi_host.h" |
90 #include "content/public/browser/browser_url_handler.h" | 91 #include "content/public/browser/browser_url_handler.h" |
| 92 #include "content/public/browser/child_process_data.h" |
91 #include "content/public/browser/child_process_security_policy.h" | 93 #include "content/public/browser/child_process_security_policy.h" |
92 #include "content/public/browser/render_process_host.h" | 94 #include "content/public/browser/render_process_host.h" |
93 #include "content/public/browser/render_view_host.h" | 95 #include "content/public/browser/render_view_host.h" |
94 #include "content/public/browser/resource_context.h" | 96 #include "content/public/browser/resource_context.h" |
95 #include "content/public/browser/site_instance.h" | 97 #include "content/public/browser/site_instance.h" |
96 #include "content/public/browser/web_contents.h" | 98 #include "content/public/browser/web_contents.h" |
97 #include "content/public/browser/web_contents_view.h" | 99 #include "content/public/browser/web_contents_view.h" |
98 #include "content/public/common/child_process_host.h" | 100 #include "content/public/common/child_process_host.h" |
99 #include "content/public/common/compositor_util.h" | 101 #include "content/public/common/compositor_util.h" |
100 #include "content/public/common/content_descriptors.h" | 102 #include "content/public/common/content_descriptors.h" |
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); | 1704 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); |
1703 } | 1705 } |
1704 | 1706 |
1705 void ChromeContentBrowserClient::DidCreatePpapiPlugin( | 1707 void ChromeContentBrowserClient::DidCreatePpapiPlugin( |
1706 content::BrowserPpapiHost* browser_host) { | 1708 content::BrowserPpapiHost* browser_host) { |
1707 browser_host->GetPpapiHost()->AddHostFactoryFilter( | 1709 browser_host->GetPpapiHost()->AddHostFactoryFilter( |
1708 scoped_ptr<ppapi::host::HostFactory>( | 1710 scoped_ptr<ppapi::host::HostFactory>( |
1709 new ChromeBrowserPepperHostFactory(browser_host))); | 1711 new ChromeBrowserPepperHostFactory(browser_host))); |
1710 } | 1712 } |
1711 | 1713 |
| 1714 content::BrowserPpapiHost* |
| 1715 ChromeContentBrowserClient::GetExternalBrowserPpapiHost( |
| 1716 int plugin_process_id) { |
| 1717 for (NaClProcessHostIterator iter; !iter.Done(); ++iter) { |
| 1718 if (iter->process() && |
| 1719 iter->process()->GetData().id == plugin_process_id) { |
| 1720 // Found the plugin. |
| 1721 return iter->browser_ppapi_host(); |
| 1722 } |
| 1723 } |
| 1724 |
| 1725 return NULL; |
| 1726 } |
| 1727 |
1712 bool ChromeContentBrowserClient::AllowPepperSocketAPI( | 1728 bool ChromeContentBrowserClient::AllowPepperSocketAPI( |
1713 content::BrowserContext* browser_context, const GURL& url) { | 1729 content::BrowserContext* browser_context, const GURL& url) { |
1714 if (!url.is_valid()) | 1730 if (!url.is_valid()) |
1715 return false; | 1731 return false; |
1716 | 1732 |
1717 std::string host = url.host(); | 1733 std::string host = url.host(); |
1718 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host)) | 1734 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host)) |
1719 return true; | 1735 return true; |
1720 | 1736 |
1721 Profile* profile = Profile::FromBrowserContext(browser_context); | 1737 Profile* profile = Profile::FromBrowserContext(browser_context); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 partition_id = extension->id(); | 1894 partition_id = extension->id(); |
1879 } | 1895 } |
1880 | 1896 |
1881 // Enforce that IsValidStoragePartitionId() implementation stays in sync. | 1897 // Enforce that IsValidStoragePartitionId() implementation stays in sync. |
1882 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 1898 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
1883 return partition_id; | 1899 return partition_id; |
1884 } | 1900 } |
1885 | 1901 |
1886 | 1902 |
1887 } // namespace chrome | 1903 } // namespace chrome |
OLD | NEW |