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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 #include "chrome/grit/generated_resources.h" | 103 #include "chrome/grit/generated_resources.h" |
104 #include "chrome/installer/util/google_update_settings.h" | 104 #include "chrome/installer/util/google_update_settings.h" |
105 #include "chromeos/chromeos_constants.h" | 105 #include "chromeos/chromeos_constants.h" |
106 #include "components/autofill/core/common/autofill_switches.h" | 106 #include "components/autofill/core/common/autofill_switches.h" |
107 #include "components/cdm/browser/cdm_message_filter_android.h" | 107 #include "components/cdm/browser/cdm_message_filter_android.h" |
108 #include "components/cloud_devices/common/cloud_devices_switches.h" | 108 #include "components/cloud_devices/common/cloud_devices_switches.h" |
109 #include "components/content_settings/core/browser/content_settings_utils.h" | 109 #include "components/content_settings/core/browser/content_settings_utils.h" |
110 #include "components/content_settings/core/browser/cookie_settings.h" | 110 #include "components/content_settings/core/browser/cookie_settings.h" |
111 #include "components/content_settings/core/browser/host_content_settings_map.h" | 111 #include "components/content_settings/core/browser/host_content_settings_map.h" |
112 #include "components/content_settings/core/common/content_settings.h" | 112 #include "components/content_settings/core/common/content_settings.h" |
| 113 #include "components/content_settings/core/common/content_settings_types.h" |
113 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_m
essage_filter.h" | 114 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_m
essage_filter.h" |
114 #include "components/dom_distiller/core/dom_distiller_switches.h" | 115 #include "components/dom_distiller/core/dom_distiller_switches.h" |
115 #include "components/dom_distiller/core/url_constants.h" | 116 #include "components/dom_distiller/core/url_constants.h" |
116 #include "components/error_page/common/error_page_switches.h" | 117 #include "components/error_page/common/error_page_switches.h" |
117 #include "components/google/core/browser/google_util.h" | 118 #include "components/google/core/browser/google_util.h" |
118 #include "components/metrics/client_info.h" | 119 #include "components/metrics/client_info.h" |
119 #include "components/net_log/chrome_net_log.h" | 120 #include "components/net_log/chrome_net_log.h" |
120 #include "components/pref_registry/pref_registry_syncable.h" | 121 #include "components/pref_registry/pref_registry_syncable.h" |
121 #include "components/prefs/pref_service.h" | 122 #include "components/prefs/pref_service.h" |
122 #include "components/prefs/scoped_user_pref_update.h" | 123 #include "components/prefs/scoped_user_pref_update.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 #include "mojo/shell/public/cpp/shell_client.h" | 157 #include "mojo/shell/public/cpp/shell_client.h" |
157 #include "net/base/mime_util.h" | 158 #include "net/base/mime_util.h" |
158 #include "net/cookies/canonical_cookie.h" | 159 #include "net/cookies/canonical_cookie.h" |
159 #include "net/cookies/cookie_options.h" | 160 #include "net/cookies/cookie_options.h" |
160 #include "net/ssl/ssl_cert_request_info.h" | 161 #include "net/ssl/ssl_cert_request_info.h" |
161 #include "ppapi/host/ppapi_host.h" | 162 #include "ppapi/host/ppapi_host.h" |
162 #include "storage/browser/fileapi/external_mount_points.h" | 163 #include "storage/browser/fileapi/external_mount_points.h" |
163 #include "ui/base/l10n/l10n_util.h" | 164 #include "ui/base/l10n/l10n_util.h" |
164 #include "ui/base/resource/resource_bundle.h" | 165 #include "ui/base/resource/resource_bundle.h" |
165 #include "ui/resources/grit/ui_resources.h" | 166 #include "ui/resources/grit/ui_resources.h" |
| 167 #include "url/gurl.h" |
| 168 #include "url/origin.h" |
166 | 169 |
167 #if defined(OS_WIN) | 170 #if defined(OS_WIN) |
168 #include "base/strings/string_tokenizer.h" | 171 #include "base/strings/string_tokenizer.h" |
169 #include "base/win/windows_version.h" | 172 #include "base/win/windows_version.h" |
170 #include "chrome/browser/chrome_browser_main_win.h" | 173 #include "chrome/browser/chrome_browser_main_win.h" |
171 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" | 174 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" |
172 #include "sandbox/win/src/sandbox_policy.h" | 175 #include "sandbox/win/src/sandbox_policy.h" |
173 #elif defined(OS_MACOSX) | 176 #elif defined(OS_MACOSX) |
174 #include "chrome/browser/chrome_browser_main_mac.h" | 177 #include "chrome/browser/chrome_browser_main_mac.h" |
175 #elif defined(OS_CHROMEOS) | 178 #elif defined(OS_CHROMEOS) |
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1981 const GURL& url, | 1984 const GURL& url, |
1982 content::ResourceContext* context) { | 1985 content::ResourceContext* context) { |
1983 HostContentSettingsMap* content_settings = | 1986 HostContentSettingsMap* content_settings = |
1984 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); | 1987 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); |
1985 | 1988 |
1986 return content_settings->GetContentSetting( | 1989 return content_settings->GetContentSetting( |
1987 url, url, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()) == | 1990 url, url, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()) == |
1988 CONTENT_SETTING_ALLOW; | 1991 CONTENT_SETTING_ALLOW; |
1989 } | 1992 } |
1990 | 1993 |
| 1994 bool ChromeContentBrowserClient::AllowWebBluetooth( |
| 1995 content::BrowserContext* browser_context, |
| 1996 const url::Origin& requesting_origin, |
| 1997 const url::Origin& embedding_origin) { |
| 1998 const HostContentSettingsMap* const content_settings = |
| 1999 HostContentSettingsMapFactory::GetForProfile( |
| 2000 Profile::FromBrowserContext(browser_context)); |
| 2001 |
| 2002 return content_settings->GetContentSetting( |
| 2003 GURL(requesting_origin.Serialize()), |
| 2004 GURL(embedding_origin.Serialize()), |
| 2005 CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, |
| 2006 std::string()) != CONTENT_SETTING_BLOCK; |
| 2007 } |
| 2008 |
1991 net::URLRequestContext* | 2009 net::URLRequestContext* |
1992 ChromeContentBrowserClient::OverrideRequestContextForURL( | 2010 ChromeContentBrowserClient::OverrideRequestContextForURL( |
1993 const GURL& url, content::ResourceContext* context) { | 2011 const GURL& url, content::ResourceContext* context) { |
1994 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 2012 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1995 #if defined(ENABLE_EXTENSIONS) | 2013 #if defined(ENABLE_EXTENSIONS) |
1996 if (url.SchemeIs(extensions::kExtensionScheme)) { | 2014 if (url.SchemeIs(extensions::kExtensionScheme)) { |
1997 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | 2015 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
1998 return io_data->extensions_request_context(); | 2016 return io_data->extensions_request_context(); |
1999 } | 2017 } |
2000 #endif | 2018 #endif |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2924 if (channel <= kMaxDisableEncryptionChannel) { | 2942 if (channel <= kMaxDisableEncryptionChannel) { |
2925 static const char* const kWebRtcDevSwitchNames[] = { | 2943 static const char* const kWebRtcDevSwitchNames[] = { |
2926 switches::kDisableWebRtcEncryption, | 2944 switches::kDisableWebRtcEncryption, |
2927 }; | 2945 }; |
2928 to_command_line->CopySwitchesFrom(from_command_line, | 2946 to_command_line->CopySwitchesFrom(from_command_line, |
2929 kWebRtcDevSwitchNames, | 2947 kWebRtcDevSwitchNames, |
2930 arraysize(kWebRtcDevSwitchNames)); | 2948 arraysize(kWebRtcDevSwitchNames)); |
2931 } | 2949 } |
2932 } | 2950 } |
2933 #endif // defined(ENABLE_WEBRTC) | 2951 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |