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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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/data_reduction_proxy/content/browser/data_reduction_proxy_m essage_filter.h" | 113 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_m essage_filter.h" |
114 #include "components/dom_distiller/core/dom_distiller_switches.h" | 114 #include "components/dom_distiller/core/dom_distiller_switches.h" |
115 #include "components/dom_distiller/core/url_constants.h" | 115 #include "components/dom_distiller/core/url_constants.h" |
116 #include "components/error_page/common/error_page_switches.h" | 116 #include "components/error_page/common/error_page_switches.h" |
117 #include "components/google/core/browser/google_util.h" | 117 #include "components/google/core/browser/google_util.h" |
118 #include "components/metrics/client_info.h" | 118 #include "components/metrics/client_info.h" |
119 #include "components/net_log/chrome_net_log.h" | 119 #include "components/net_log/chrome_net_log.h" |
120 #include "components/policy/core/common/policy_service.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" |
123 #include "components/rappor/rappor_utils.h" | 124 #include "components/rappor/rappor_utils.h" |
124 #include "components/security_interstitials/core/ssl_error_ui.h" | 125 #include "components/security_interstitials/core/ssl_error_ui.h" |
125 #include "components/signin/core/common/profile_management_switches.h" | 126 #include "components/signin/core/common/profile_management_switches.h" |
126 #include "components/startup_metric_utils/browser/startup_metric_message_filter. h" | 127 #include "components/startup_metric_utils/browser/startup_metric_message_filter. h" |
127 #include "components/translate/core/common/translate_switches.h" | 128 #include "components/translate/core/common/translate_switches.h" |
128 #include "components/url_formatter/url_fixer.h" | 129 #include "components/url_formatter/url_fixer.h" |
129 #include "components/variations/variations_associated_data.h" | 130 #include "components/variations/variations_associated_data.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
151 #include "content/public/common/service_registry.h" | 152 #include "content/public/common/service_registry.h" |
152 #include "content/public/common/url_utils.h" | 153 #include "content/public/common/url_utils.h" |
153 #include "content/public/common/web_preferences.h" | 154 #include "content/public/common/web_preferences.h" |
154 #include "device/usb/public/interfaces/device_manager.mojom.h" | 155 #include "device/usb/public/interfaces/device_manager.mojom.h" |
155 #include "gin/v8_initializer.h" | 156 #include "gin/v8_initializer.h" |
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" |
162 #include "policy/policy_constants.h" | |
161 #include "ppapi/host/ppapi_host.h" | 163 #include "ppapi/host/ppapi_host.h" |
162 #include "storage/browser/fileapi/external_mount_points.h" | 164 #include "storage/browser/fileapi/external_mount_points.h" |
163 #include "ui/base/l10n/l10n_util.h" | 165 #include "ui/base/l10n/l10n_util.h" |
164 #include "ui/base/resource/resource_bundle.h" | 166 #include "ui/base/resource/resource_bundle.h" |
165 #include "ui/resources/grit/ui_resources.h" | 167 #include "ui/resources/grit/ui_resources.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 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1979 const GURL& url, | 1982 const GURL& url, |
1980 content::ResourceContext* context) { | 1983 content::ResourceContext* context) { |
1981 HostContentSettingsMap* content_settings = | 1984 HostContentSettingsMap* content_settings = |
1982 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); | 1985 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); |
1983 | 1986 |
1984 return content_settings->GetContentSetting( | 1987 return content_settings->GetContentSetting( |
1985 url, url, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()) == | 1988 url, url, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()) == |
1986 CONTENT_SETTING_ALLOW; | 1989 CONTENT_SETTING_ALLOW; |
1987 } | 1990 } |
1988 | 1991 |
1992 bool ChromeContentBrowserClient::AllowWebBluetooth() { | |
1993 const base::Value* policy_value = | |
bartfab (slow)
2016/02/25 17:37:50
Nit 1: #include "base/values.h"
Nit 2: const point
| |
1994 g_browser_process->policy_service() | |
1995 ->GetPolicies(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | |
bartfab (slow)
2016/02/25 17:37:50
Nit: #include "components/policy/core/common/polic
| |
1996 std::string())) | |
1997 .GetValue(policy::key::kDefaultWebBluetoothGuardSetting); | |
bartfab (slow)
2016/02/25 17:37:50
You documented this policy as being per-profile, b
| |
1998 int int_value; | |
1999 if (policy_value && policy_value->GetAsInteger(&int_value)) { | |
bartfab (slow)
2016/02/25 17:37:50
99% of policies are implemented differently:
- Def
Jeffrey Yasskin
2016/02/25 20:38:50
Done, which covers the previous 3 comments too.
| |
2000 return int_value != CONTENT_SETTING_BLOCK; | |
2001 } | |
2002 return true; | |
2003 } | |
2004 | |
1989 net::URLRequestContext* | 2005 net::URLRequestContext* |
1990 ChromeContentBrowserClient::OverrideRequestContextForURL( | 2006 ChromeContentBrowserClient::OverrideRequestContextForURL( |
1991 const GURL& url, content::ResourceContext* context) { | 2007 const GURL& url, content::ResourceContext* context) { |
1992 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 2008 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1993 #if defined(ENABLE_EXTENSIONS) | 2009 #if defined(ENABLE_EXTENSIONS) |
1994 if (url.SchemeIs(extensions::kExtensionScheme)) { | 2010 if (url.SchemeIs(extensions::kExtensionScheme)) { |
1995 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); | 2011 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); |
1996 return io_data->extensions_request_context(); | 2012 return io_data->extensions_request_context(); |
1997 } | 2013 } |
1998 #endif | 2014 #endif |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2907 if (channel <= kMaxDisableEncryptionChannel) { | 2923 if (channel <= kMaxDisableEncryptionChannel) { |
2908 static const char* const kWebRtcDevSwitchNames[] = { | 2924 static const char* const kWebRtcDevSwitchNames[] = { |
2909 switches::kDisableWebRtcEncryption, | 2925 switches::kDisableWebRtcEncryption, |
2910 }; | 2926 }; |
2911 to_command_line->CopySwitchesFrom(from_command_line, | 2927 to_command_line->CopySwitchesFrom(from_command_line, |
2912 kWebRtcDevSwitchNames, | 2928 kWebRtcDevSwitchNames, |
2913 arraysize(kWebRtcDevSwitchNames)); | 2929 arraysize(kWebRtcDevSwitchNames)); |
2914 } | 2930 } |
2915 } | 2931 } |
2916 #endif // defined(ENABLE_WEBRTC) | 2932 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |