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

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

Issue 344693004: Add a policy to re-enable deprecated web platform features. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to ToT Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 #endif 244 #endif
245 245
246 #if defined(ENABLE_SERVICE_DISCOVERY) 246 #if defined(ENABLE_SERVICE_DISCOVERY)
247 #include "chrome/browser/local_discovery/storage/privet_filesystem_backend.h" 247 #include "chrome/browser/local_discovery/storage/privet_filesystem_backend.h"
248 #endif 248 #endif
249 249
250 #if defined(ENABLE_WEBRTC) 250 #if defined(ENABLE_WEBRTC)
251 #include "chrome/browser/media/webrtc_logging_handler_host.h" 251 #include "chrome/browser/media/webrtc_logging_handler_host.h"
252 #endif 252 #endif
253 253
254 using base::FileDescriptor;
254 using blink::WebWindowFeatures; 255 using blink::WebWindowFeatures;
255 using base::FileDescriptor;
256 using content::AccessTokenStore; 256 using content::AccessTokenStore;
257 using content::BrowserChildProcessHostIterator; 257 using content::BrowserChildProcessHostIterator;
258 using content::BrowserThread; 258 using content::BrowserThread;
259 using content::BrowserURLHandler; 259 using content::BrowserURLHandler;
260 using content::ChildProcessSecurityPolicy; 260 using content::ChildProcessSecurityPolicy;
261 using content::QuotaPermissionContext; 261 using content::QuotaPermissionContext;
262 using content::RenderFrameHost; 262 using content::RenderFrameHost;
263 using content::RenderViewHost; 263 using content::RenderViewHost;
264 using content::SiteInstance; 264 using content::SiteInstance;
265 using content::WebContents; 265 using content::WebContents;
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 void ChromeContentBrowserClient::RegisterProfilePrefs( 659 void ChromeContentBrowserClient::RegisterProfilePrefs(
660 user_prefs::PrefRegistrySyncable* registry) { 660 user_prefs::PrefRegistrySyncable* registry) {
661 registry->RegisterBooleanPref( 661 registry->RegisterBooleanPref(
662 prefs::kDisable3DAPIs, 662 prefs::kDisable3DAPIs,
663 false, 663 false,
664 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 664 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
665 registry->RegisterBooleanPref( 665 registry->RegisterBooleanPref(
666 prefs::kEnableHyperlinkAuditing, 666 prefs::kEnableHyperlinkAuditing,
667 true, 667 true,
668 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 668 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
669 registry->RegisterListPref(
670 prefs::kEnableDeprecatedWebPlatformFeatures,
671 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
669 } 672 }
670 673
671 // static 674 // static
672 void ChromeContentBrowserClient::SetApplicationLocale( 675 void ChromeContentBrowserClient::SetApplicationLocale(
673 const std::string& locale) { 676 const std::string& locale) {
674 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 677 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
675 678
676 // This object is guaranteed to outlive all threads so we don't have to 679 // This object is guaranteed to outlive all threads so we don't have to
677 // worry about the lack of refcounting and can just post as Unretained. 680 // worry about the lack of refcounting and can just post as Unretained.
678 // 681 //
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 command_line->AppendSwitch(extensions::switches::kExtensionProcess); 1607 command_line->AppendSwitch(extensions::switches::kExtensionProcess);
1605 1608
1606 PrefService* prefs = profile->GetPrefs(); 1609 PrefService* prefs = profile->GetPrefs();
1607 // Currently this pref is only registered if applied via a policy. 1610 // Currently this pref is only registered if applied via a policy.
1608 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && 1611 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) &&
1609 prefs->GetBoolean(prefs::kDisable3DAPIs)) { 1612 prefs->GetBoolean(prefs::kDisable3DAPIs)) {
1610 // Turn this policy into a command line switch. 1613 // Turn this policy into a command line switch.
1611 command_line->AppendSwitch(switches::kDisable3DAPIs); 1614 command_line->AppendSwitch(switches::kDisable3DAPIs);
1612 } 1615 }
1613 1616
1617 const base::ListValue* switches =
1618 prefs->GetList(prefs::kEnableDeprecatedWebPlatformFeatures);
1619 if (switches) {
1620 // Enable any deprecated features that have been re-enabled by policy.
1621 for (base::ListValue::const_iterator it = switches->begin();
1622 it != switches->end(); ++it) {
1623 std::string switch_to_enable;
1624 if ((*it)->GetAsString(&switch_to_enable))
1625 command_line->AppendSwitch(switch_to_enable);
1626 }
1627 }
1628
1614 // Disable client-side phishing detection in the renderer if it is 1629 // Disable client-side phishing detection in the renderer if it is
1615 // disabled in the Profile preferences or the browser process. 1630 // disabled in the Profile preferences or the browser process.
1616 if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) || 1631 if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) ||
1617 !g_browser_process->safe_browsing_detection_service()) { 1632 !g_browser_process->safe_browsing_detection_service()) {
1618 command_line->AppendSwitch( 1633 command_line->AppendSwitch(
1619 switches::kDisableClientSidePhishingDetection); 1634 switches::kDisableClientSidePhishingDetection);
1620 } 1635 }
1621 1636
1622 if (!prefs->GetBoolean(prefs::kPrintPreviewDisabled)) 1637 if (!prefs->GetBoolean(prefs::kPrintPreviewDisabled))
1623 command_line->AppendSwitch(switches::kRendererPrintPreview); 1638 command_line->AppendSwitch(switches::kRendererPrintPreview);
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2851 switches::kDisableWebRtcEncryption, 2866 switches::kDisableWebRtcEncryption,
2852 }; 2867 };
2853 to_command_line->CopySwitchesFrom(from_command_line, 2868 to_command_line->CopySwitchesFrom(from_command_line,
2854 kWebRtcDevSwitchNames, 2869 kWebRtcDevSwitchNames,
2855 arraysize(kWebRtcDevSwitchNames)); 2870 arraysize(kWebRtcDevSwitchNames));
2856 } 2871 }
2857 } 2872 }
2858 #endif // defined(ENABLE_WEBRTC) 2873 #endif // defined(ENABLE_WEBRTC)
2859 2874
2860 } // namespace chrome 2875 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698