| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 #include "components/nacl/common/nacl_process_type.h" | 109 #include "components/nacl/common/nacl_process_type.h" |
| 110 #include "components/user_prefs/pref_registry_syncable.h" | 110 #include "components/user_prefs/pref_registry_syncable.h" |
| 111 #include "content/public/browser/browser_child_process_host.h" | 111 #include "content/public/browser/browser_child_process_host.h" |
| 112 #include "content/public/browser/browser_main_parts.h" | 112 #include "content/public/browser/browser_main_parts.h" |
| 113 #include "content/public/browser/browser_ppapi_host.h" | 113 #include "content/public/browser/browser_ppapi_host.h" |
| 114 #include "content/public/browser/browser_thread.h" | 114 #include "content/public/browser/browser_thread.h" |
| 115 #include "content/public/browser/browser_url_handler.h" | 115 #include "content/public/browser/browser_url_handler.h" |
| 116 #include "content/public/browser/child_process_data.h" | 116 #include "content/public/browser/child_process_data.h" |
| 117 #include "content/public/browser/child_process_security_policy.h" | 117 #include "content/public/browser/child_process_security_policy.h" |
| 118 #include "content/public/browser/compositor_util.h" | 118 #include "content/public/browser/compositor_util.h" |
| 119 #include "content/public/browser/cookie_store_factory.h" |
| 120 #include "content/public/browser/cookie_store_map.h" |
| 119 #include "content/public/browser/render_process_host.h" | 121 #include "content/public/browser/render_process_host.h" |
| 120 #include "content/public/browser/render_view_host.h" | 122 #include "content/public/browser/render_view_host.h" |
| 121 #include "content/public/browser/resource_context.h" | 123 #include "content/public/browser/resource_context.h" |
| 122 #include "content/public/browser/site_instance.h" | 124 #include "content/public/browser/site_instance.h" |
| 123 #include "content/public/browser/web_contents.h" | 125 #include "content/public/browser/web_contents.h" |
| 124 #include "content/public/browser/web_contents_view.h" | 126 #include "content/public/browser/web_contents_view.h" |
| 125 #include "content/public/common/child_process_host.h" | 127 #include "content/public/common/child_process_host.h" |
| 128 #include "content/public/common/content_constants.h" |
| 126 #include "content/public/common/content_descriptors.h" | 129 #include "content/public/common/content_descriptors.h" |
| 127 #include "extensions/browser/view_type_utils.h" | 130 #include "extensions/browser/view_type_utils.h" |
| 128 #include "extensions/common/constants.h" | 131 #include "extensions/common/constants.h" |
| 129 #include "extensions/common/switches.h" | 132 #include "extensions/common/switches.h" |
| 130 #include "grit/generated_resources.h" | 133 #include "grit/generated_resources.h" |
| 131 #include "grit/ui_resources.h" | 134 #include "grit/ui_resources.h" |
| 132 #include "net/base/escape.h" | 135 #include "net/base/escape.h" |
| 133 #include "net/base/mime_util.h" | 136 #include "net/base/mime_util.h" |
| 134 #include "net/cookies/canonical_cookie.h" | 137 #include "net/cookies/canonical_cookie.h" |
| 135 #include "net/cookies/cookie_options.h" | 138 #include "net/cookies/cookie_options.h" |
| 139 #include "net/cookies/cookie_store.h" |
| 136 #include "net/ssl/ssl_cert_request_info.h" | 140 #include "net/ssl/ssl_cert_request_info.h" |
| 137 #include "ppapi/host/ppapi_host.h" | 141 #include "ppapi/host/ppapi_host.h" |
| 138 #include "ui/base/l10n/l10n_util.h" | 142 #include "ui/base/l10n/l10n_util.h" |
| 139 #include "ui/base/resource/resource_bundle.h" | 143 #include "ui/base/resource/resource_bundle.h" |
| 140 #include "ui/message_center/message_center_util.h" | 144 #include "ui/message_center/message_center_util.h" |
| 141 #include "webkit/browser/fileapi/external_mount_points.h" | 145 #include "webkit/browser/fileapi/external_mount_points.h" |
| 142 #include "webkit/common/webpreferences.h" | 146 #include "webkit/common/webpreferences.h" |
| 143 #include "webkit/plugins/plugin_switches.h" | 147 #include "webkit/plugins/plugin_switches.h" |
| 144 | 148 |
| 145 #if defined(OS_WIN) | 149 #if defined(OS_WIN) |
| (...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 for (i = render_views.begin(); i != render_views.end(); ++i) { | 1692 for (i = render_views.begin(); i != render_views.end(); ++i) { |
| 1689 BrowserThread::PostTask( | 1693 BrowserThread::PostTask( |
| 1690 BrowserThread::UI, FROM_HERE, | 1694 BrowserThread::UI, FROM_HERE, |
| 1691 base::Bind(&TabSpecificContentSettings::IndexedDBAccessed, | 1695 base::Bind(&TabSpecificContentSettings::IndexedDBAccessed, |
| 1692 i->first, i->second, url, name, !allow)); | 1696 i->first, i->second, url, name, !allow)); |
| 1693 } | 1697 } |
| 1694 | 1698 |
| 1695 return allow; | 1699 return allow; |
| 1696 } | 1700 } |
| 1697 | 1701 |
| 1698 net::URLRequestContext* | 1702 void ChromeContentBrowserClient::OverrideCookieStoreMap( |
| 1699 ChromeContentBrowserClient::OverrideRequestContextForURL( | 1703 content::BrowserContext* browser_context, |
| 1700 const GURL& url, content::ResourceContext* context) { | 1704 bool in_memory, |
| 1701 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1705 const base::FilePath& partition_path, |
| 1702 if (url.SchemeIs(extensions::kExtensionScheme)) { | 1706 bool is_default, |
| 1703 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | 1707 content::CookieStoreMap* cookie_store_map) { |
| 1704 return io_data->extensions_request_context(); | 1708 using content::CreateCookieStore; |
| 1709 using content::CookieStoreConfig; |
| 1710 |
| 1711 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1712 net::CookieStore* cookie_store = NULL; |
| 1713 // This is called for each StoragePartition. Currently Extensions |
| 1714 // should only execute on the default partition. |
| 1715 if (is_default) { |
| 1716 if (in_memory) { |
| 1717 cookie_store = CreateCookieStore(CookieStoreConfig::InMemory()); |
| 1718 } else { |
| 1719 base::FilePath cookie_path = partition_path.Append( |
| 1720 chrome::kExtensionsCookieFilename); |
| 1721 cookie_store = CreateCookieStore( |
| 1722 CookieStoreConfig::Persistent( |
| 1723 cookie_path, |
| 1724 browser_context->GetCookieStoreConfig() |
| 1725 .restore_old_session_cookies)); |
| 1726 } |
| 1727 |
| 1728 |
| 1729 static const char* schemes[] = { extensions::kExtensionScheme }; |
| 1730 cookie_store->GetCookieMonster()->SetCookieableSchemes(schemes, 1); |
| 1731 cookie_store_map->SetForScheme(extensions::kExtensionScheme, cookie_store); |
| 1705 } | 1732 } |
| 1706 | |
| 1707 return NULL; | |
| 1708 } | 1733 } |
| 1709 | 1734 |
| 1710 QuotaPermissionContext* | 1735 QuotaPermissionContext* |
| 1711 ChromeContentBrowserClient::CreateQuotaPermissionContext() { | 1736 ChromeContentBrowserClient::CreateQuotaPermissionContext() { |
| 1712 return new ChromeQuotaPermissionContext(); | 1737 return new ChromeQuotaPermissionContext(); |
| 1713 } | 1738 } |
| 1714 | 1739 |
| 1715 void ChromeContentBrowserClient::AllowCertificateError( | 1740 void ChromeContentBrowserClient::AllowCertificateError( |
| 1716 int render_process_id, | 1741 int render_process_id, |
| 1717 int render_view_id, | 1742 int render_view_id, |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2579 #if defined(USE_NSS) | 2604 #if defined(USE_NSS) |
| 2580 crypto::CryptoModuleBlockingPasswordDelegate* | 2605 crypto::CryptoModuleBlockingPasswordDelegate* |
| 2581 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 2606 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 2582 const GURL& url) { | 2607 const GURL& url) { |
| 2583 return chrome::NewCryptoModuleBlockingDialogDelegate( | 2608 return chrome::NewCryptoModuleBlockingDialogDelegate( |
| 2584 chrome::kCryptoModulePasswordKeygen, url.host()); | 2609 chrome::kCryptoModulePasswordKeygen, url.host()); |
| 2585 } | 2610 } |
| 2586 #endif | 2611 #endif |
| 2587 | 2612 |
| 2588 } // namespace chrome | 2613 } // namespace chrome |
| OLD | NEW |