Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1706503002: Add enterprise policy to turn off Bluetooth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Switch to a unified browsertest Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 const GURL& url, 1981 const GURL& url,
1982 content::ResourceContext* context) { 1982 content::ResourceContext* context) {
1983 HostContentSettingsMap* content_settings = 1983 HostContentSettingsMap* content_settings =
1984 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); 1984 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap();
1985 1985
1986 return content_settings->GetContentSetting( 1986 return content_settings->GetContentSetting(
1987 url, url, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()) == 1987 url, url, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()) ==
1988 CONTENT_SETTING_ALLOW; 1988 CONTENT_SETTING_ALLOW;
1989 } 1989 }
1990 1990
1991 bool ChromeContentBrowserClient::AllowWebBluetooth(
1992 content::BrowserContext* browser_context,
1993 const url::Origin& requesting_origin,
1994 const url::Origin& embedding_origin) {
1995 HostContentSettingsMap* content_settings =
bartfab (slow) 2016/02/26 18:00:44 Nit: Const pointer to const.
Jeffrey Yasskin 2016/02/26 18:21:24 Done.
1996 HostContentSettingsMapFactory::GetForProfile(
1997 Profile::FromBrowserContext(browser_context));
1998
1999 return content_settings->GetContentSetting(
2000 GURL(requesting_origin.Serialize()),
bartfab (slow) 2016/02/26 18:00:45 Nit 1: #include "url/gurl.h" Nit 2: #include "url/
Jeffrey Yasskin 2016/02/26 18:21:25 Done.
2001 GURL(embedding_origin.Serialize()),
2002 CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD,
bartfab (slow) 2016/02/26 18:00:45 Nit: #include "components/content_settings/core/co
Jeffrey Yasskin 2016/02/26 18:21:25 Done.
2003 std::string()) != CONTENT_SETTING_BLOCK;
2004 }
2005
1991 net::URLRequestContext* 2006 net::URLRequestContext*
1992 ChromeContentBrowserClient::OverrideRequestContextForURL( 2007 ChromeContentBrowserClient::OverrideRequestContextForURL(
1993 const GURL& url, content::ResourceContext* context) { 2008 const GURL& url, content::ResourceContext* context) {
1994 DCHECK_CURRENTLY_ON(BrowserThread::IO); 2009 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1995 #if defined(ENABLE_EXTENSIONS) 2010 #if defined(ENABLE_EXTENSIONS)
1996 if (url.SchemeIs(extensions::kExtensionScheme)) { 2011 if (url.SchemeIs(extensions::kExtensionScheme)) {
1997 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); 2012 ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
1998 return io_data->extensions_request_context(); 2013 return io_data->extensions_request_context();
1999 } 2014 }
2000 #endif 2015 #endif
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2924 if (channel <= kMaxDisableEncryptionChannel) { 2939 if (channel <= kMaxDisableEncryptionChannel) {
2925 static const char* const kWebRtcDevSwitchNames[] = { 2940 static const char* const kWebRtcDevSwitchNames[] = {
2926 switches::kDisableWebRtcEncryption, 2941 switches::kDisableWebRtcEncryption,
2927 }; 2942 };
2928 to_command_line->CopySwitchesFrom(from_command_line, 2943 to_command_line->CopySwitchesFrom(from_command_line,
2929 kWebRtcDevSwitchNames, 2944 kWebRtcDevSwitchNames,
2930 arraysize(kWebRtcDevSwitchNames)); 2945 arraysize(kWebRtcDevSwitchNames));
2931 } 2946 }
2932 } 2947 }
2933 #endif // defined(ENABLE_WEBRTC) 2948 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698