| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 command_line->AppendSwitch(extensions::switches::kExtensionProcess); | 1605 command_line->AppendSwitch(extensions::switches::kExtensionProcess); |
| 1603 | 1606 |
| 1604 PrefService* prefs = profile->GetPrefs(); | 1607 PrefService* prefs = profile->GetPrefs(); |
| 1605 // Currently this pref is only registered if applied via a policy. | 1608 // Currently this pref is only registered if applied via a policy. |
| 1606 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && | 1609 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && |
| 1607 prefs->GetBoolean(prefs::kDisable3DAPIs)) { | 1610 prefs->GetBoolean(prefs::kDisable3DAPIs)) { |
| 1608 // Turn this policy into a command line switch. | 1611 // Turn this policy into a command line switch. |
| 1609 command_line->AppendSwitch(switches::kDisable3DAPIs); | 1612 command_line->AppendSwitch(switches::kDisable3DAPIs); |
| 1610 } | 1613 } |
| 1611 | 1614 |
| 1615 const base::ListValue* switches = |
| 1616 prefs->GetList(prefs::kEnableDeprecatedWebPlatformFeatures); |
| 1617 if (switches) { |
| 1618 // Enable any deprecated features that have been re-enabled by policy. |
| 1619 for (base::ListValue::const_iterator it = switches->begin(); |
| 1620 it != switches->end(); ++it) { |
| 1621 std::string switch_to_enable; |
| 1622 if ((*it)->GetAsString(&switch_to_enable)) |
| 1623 command_line->AppendSwitch(switch_to_enable); |
| 1624 } |
| 1625 } |
| 1626 |
| 1612 // Disable client-side phishing detection in the renderer if it is | 1627 // Disable client-side phishing detection in the renderer if it is |
| 1613 // disabled in the Profile preferences or the browser process. | 1628 // disabled in the Profile preferences or the browser process. |
| 1614 if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) || | 1629 if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) || |
| 1615 !g_browser_process->safe_browsing_detection_service()) { | 1630 !g_browser_process->safe_browsing_detection_service()) { |
| 1616 command_line->AppendSwitch( | 1631 command_line->AppendSwitch( |
| 1617 switches::kDisableClientSidePhishingDetection); | 1632 switches::kDisableClientSidePhishingDetection); |
| 1618 } | 1633 } |
| 1619 | 1634 |
| 1620 if (!prefs->GetBoolean(prefs::kPrintPreviewDisabled)) | 1635 if (!prefs->GetBoolean(prefs::kPrintPreviewDisabled)) |
| 1621 command_line->AppendSwitch(switches::kRendererPrintPreview); | 1636 command_line->AppendSwitch(switches::kRendererPrintPreview); |
| (...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2849 switches::kDisableWebRtcEncryption, | 2864 switches::kDisableWebRtcEncryption, |
| 2850 }; | 2865 }; |
| 2851 to_command_line->CopySwitchesFrom(from_command_line, | 2866 to_command_line->CopySwitchesFrom(from_command_line, |
| 2852 kWebRtcDevSwitchNames, | 2867 kWebRtcDevSwitchNames, |
| 2853 arraysize(kWebRtcDevSwitchNames)); | 2868 arraysize(kWebRtcDevSwitchNames)); |
| 2854 } | 2869 } |
| 2855 } | 2870 } |
| 2856 #endif // defined(ENABLE_WEBRTC) | 2871 #endif // defined(ENABLE_WEBRTC) |
| 2857 | 2872 |
| 2858 } // namespace chrome | 2873 } // namespace chrome |
| OLD | NEW |