| 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 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 } | 1597 } |
| 1595 | 1598 |
| 1596 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { | 1599 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { |
| 1597 return download_util::GetDefaultDownloadDirectory(); | 1600 return download_util::GetDefaultDownloadDirectory(); |
| 1598 } | 1601 } |
| 1599 | 1602 |
| 1600 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { | 1603 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { |
| 1601 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); | 1604 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); |
| 1602 } | 1605 } |
| 1603 | 1606 |
| 1607 void ChromeContentBrowserClient::DidCreatePpapiPlugin( |
| 1608 content::BrowserPpapiHost* browser_host) { |
| 1609 browser_host->GetPpapiHost()->AddHostFactoryFilter( |
| 1610 scoped_ptr<ppapi::host::HostFactory>( |
| 1611 new ChromeBrowserPepperHostFactory(browser_host))); |
| 1612 } |
| 1613 |
| 1604 bool ChromeContentBrowserClient::AllowPepperSocketAPI( | 1614 bool ChromeContentBrowserClient::AllowPepperSocketAPI( |
| 1605 content::BrowserContext* browser_context, const GURL& url) { | 1615 content::BrowserContext* browser_context, const GURL& url) { |
| 1606 if (!url.is_valid()) | 1616 if (!url.is_valid()) |
| 1607 return false; | 1617 return false; |
| 1608 | 1618 |
| 1609 std::string host = url.host(); | 1619 std::string host = url.host(); |
| 1610 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host)) | 1620 if (url.SchemeIs(kExtensionScheme) && allowed_socket_origins_.count(host)) |
| 1611 return true; | 1621 return true; |
| 1612 | 1622 |
| 1613 Profile* profile = Profile::FromBrowserContext(browser_context); | 1623 Profile* profile = Profile::FromBrowserContext(browser_context); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1714 partition_id = extension->id(); | 1724 partition_id = extension->id(); |
| 1715 } | 1725 } |
| 1716 | 1726 |
| 1717 // Enforce that IsValidStoragePartitionId() implementation stays in sync. | 1727 // Enforce that IsValidStoragePartitionId() implementation stays in sync. |
| 1718 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); | 1728 DCHECK(IsValidStoragePartitionId(browser_context, partition_id)); |
| 1719 return partition_id; | 1729 return partition_id; |
| 1720 } | 1730 } |
| 1721 | 1731 |
| 1722 | 1732 |
| 1723 } // namespace chrome | 1733 } // namespace chrome |
| OLD | NEW |