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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #include "chrome/browser/prerender/prerender_manager.h" | 49 #include "chrome/browser/prerender/prerender_manager.h" |
50 #include "chrome/browser/prerender/prerender_manager_factory.h" | 50 #include "chrome/browser/prerender/prerender_manager_factory.h" |
51 #include "chrome/browser/prerender/prerender_message_filter.h" | 51 #include "chrome/browser/prerender/prerender_message_filter.h" |
52 #include "chrome/browser/prerender/prerender_tracker.h" | 52 #include "chrome/browser/prerender/prerender_tracker.h" |
53 #include "chrome/browser/printing/printing_message_filter.h" | 53 #include "chrome/browser/printing/printing_message_filter.h" |
54 #include "chrome/browser/profiles/profile.h" | 54 #include "chrome/browser/profiles/profile.h" |
55 #include "chrome/browser/profiles/profile_io_data.h" | 55 #include "chrome/browser/profiles/profile_io_data.h" |
56 #include "chrome/browser/profiles/profile_manager.h" | 56 #include "chrome/browser/profiles/profile_manager.h" |
57 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" | 57 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
58 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" | 58 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
| 59 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory
.h" |
59 #include "chrome/browser/renderer_host/plugin_info_message_filter.h" | 60 #include "chrome/browser/renderer_host/plugin_info_message_filter.h" |
60 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" | 61 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" |
61 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" | 62 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" |
62 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" | 63 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" |
63 #include "chrome/browser/ssl/ssl_add_cert_handler.h" | 64 #include "chrome/browser/ssl/ssl_add_cert_handler.h" |
64 #include "chrome/browser/ssl/ssl_blocking_page.h" | 65 #include "chrome/browser/ssl/ssl_blocking_page.h" |
65 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" | 66 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" |
66 #include "chrome/browser/tab_contents/tab_util.h" | 67 #include "chrome/browser/tab_contents/tab_util.h" |
67 #include "chrome/browser/toolkit_extra_parts.h" | 68 #include "chrome/browser/toolkit_extra_parts.h" |
68 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 69 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
69 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 70 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
70 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 71 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
71 #include "chrome/browser/user_style_sheet_watcher.h" | 72 #include "chrome/browser/user_style_sheet_watcher.h" |
72 #include "chrome/browser/user_style_sheet_watcher_factory.h" | 73 #include "chrome/browser/user_style_sheet_watcher_factory.h" |
73 #include "chrome/browser/view_type_utils.h" | 74 #include "chrome/browser/view_type_utils.h" |
74 #include "chrome/common/child_process_logging.h" | 75 #include "chrome/common/child_process_logging.h" |
75 #include "chrome/common/chrome_constants.h" | 76 #include "chrome/common/chrome_constants.h" |
76 #include "chrome/common/chrome_switches.h" | 77 #include "chrome/common/chrome_switches.h" |
77 #include "chrome/common/extensions/extension.h" | 78 #include "chrome/common/extensions/extension.h" |
78 #include "chrome/common/extensions/extension_process_policy.h" | 79 #include "chrome/common/extensions/extension_process_policy.h" |
79 #include "chrome/common/extensions/extension_set.h" | 80 #include "chrome/common/extensions/extension_set.h" |
80 #include "chrome/common/logging_chrome.h" | 81 #include "chrome/common/logging_chrome.h" |
81 #include "chrome/common/pref_names.h" | 82 #include "chrome/common/pref_names.h" |
82 #include "chrome/common/render_messages.h" | 83 #include "chrome/common/render_messages.h" |
83 #include "chrome/common/url_constants.h" | 84 #include "chrome/common/url_constants.h" |
84 #include "content/public/browser/browser_child_process_host.h" | 85 #include "content/public/browser/browser_child_process_host.h" |
85 #include "content/public/browser/browser_main_parts.h" | 86 #include "content/public/browser/browser_main_parts.h" |
| 87 #include "content/public/browser/browser_ppapi_host.h" |
86 #include "content/public/browser/browser_url_handler.h" | 88 #include "content/public/browser/browser_url_handler.h" |
87 #include "content/public/browser/child_process_security_policy.h" | 89 #include "content/public/browser/child_process_security_policy.h" |
88 #include "content/public/browser/render_process_host.h" | 90 #include "content/public/browser/render_process_host.h" |
89 #include "content/public/browser/render_view_host.h" | 91 #include "content/public/browser/render_view_host.h" |
90 #include "content/public/browser/resource_context.h" | 92 #include "content/public/browser/resource_context.h" |
91 #include "content/public/browser/site_instance.h" | 93 #include "content/public/browser/site_instance.h" |
92 #include "content/public/browser/web_contents.h" | 94 #include "content/public/browser/web_contents.h" |
93 #include "content/public/browser/web_contents_view.h" | 95 #include "content/public/browser/web_contents_view.h" |
94 #include "content/public/common/child_process_host.h" | 96 #include "content/public/common/child_process_host.h" |
95 #include "content/public/common/compositor_util.h" | 97 #include "content/public/common/compositor_util.h" |
96 #include "content/public/common/content_descriptors.h" | 98 #include "content/public/common/content_descriptors.h" |
97 #include "grit/generated_resources.h" | 99 #include "grit/generated_resources.h" |
98 #include "grit/ui_resources.h" | 100 #include "grit/ui_resources.h" |
99 #include "net/base/ssl_cert_request_info.h" | 101 #include "net/base/ssl_cert_request_info.h" |
100 #include "net/cookies/canonical_cookie.h" | 102 #include "net/cookies/canonical_cookie.h" |
101 #include "net/cookies/cookie_options.h" | 103 #include "net/cookies/cookie_options.h" |
| 104 #include "ppapi/host/ppapi_host.h" |
102 #include "ui/base/l10n/l10n_util.h" | 105 #include "ui/base/l10n/l10n_util.h" |
103 #include "ui/base/resource/resource_bundle.h" | 106 #include "ui/base/resource/resource_bundle.h" |
104 #include "webkit/glue/webpreferences.h" | 107 #include "webkit/glue/webpreferences.h" |
105 #include "webkit/plugins/plugin_switches.h" | 108 #include "webkit/plugins/plugin_switches.h" |
106 | 109 |
107 #if defined(OS_WIN) | 110 #if defined(OS_WIN) |
108 #include "chrome/browser/chrome_browser_main_win.h" | 111 #include "chrome/browser/chrome_browser_main_win.h" |
109 #elif defined(OS_MACOSX) | 112 #elif defined(OS_MACOSX) |
110 #include "chrome/browser/chrome_browser_main_mac.h" | 113 #include "chrome/browser/chrome_browser_main_mac.h" |
111 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" | 114 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 } | 1587 } |
1585 | 1588 |
1586 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { | 1589 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { |
1587 return download_util::GetDefaultDownloadDirectory(); | 1590 return download_util::GetDefaultDownloadDirectory(); |
1588 } | 1591 } |
1589 | 1592 |
1590 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { | 1593 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { |
1591 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); | 1594 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); |
1592 } | 1595 } |
1593 | 1596 |
| 1597 void ChromeContentBrowserClient::DidCreatePpapiPlugin( |
| 1598 content::BrowserPpapiHost* browser_host) { |
| 1599 browser_host->GetPpapiHost()->AddHostFactoryFilter( |
| 1600 scoped_ptr<ppapi::host::HostFactory>( |
| 1601 new ChromeBrowserPepperHostFactory(browser_host))); |
| 1602 } |
| 1603 |
1594 bool ChromeContentBrowserClient::AllowPepperSocketAPI( | 1604 bool ChromeContentBrowserClient::AllowPepperSocketAPI( |
1595 content::BrowserContext* browser_context, const GURL& url) { | 1605 content::BrowserContext* browser_context, const GURL& url) { |
1596 if (!url.is_valid()) | 1606 if (!url.is_valid()) |
1597 return false; | 1607 return false; |
1598 | 1608 |
1599 std::string host = url.host(); | 1609 std::string host = url.host(); |
1600 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host)) | 1610 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host)) |
1601 return true; | 1611 return true; |
1602 | 1612 |
1603 Profile* profile = Profile::FromBrowserContext(browser_context); | 1613 Profile* profile = Profile::FromBrowserContext(browser_context); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 partition_id = extension->id(); | 1714 partition_id = extension->id(); |
1705 } | 1715 } |
1706 | 1716 |
1707 // Enforce that IsValidStoragePartitionId() implementation stays in sync. | 1717 // Enforce that IsValidStoragePartitionId() implementation stays in sync. |
1708 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 1718 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
1709 return partition_id; | 1719 return partition_id; |
1710 } | 1720 } |
1711 | 1721 |
1712 | 1722 |
1713 } // namespace chrome | 1723 } // namespace chrome |
OLD | NEW |