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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 #endif | 236 #endif |
237 | 237 |
238 #if defined(ENABLE_SPELLCHECK) | 238 #if defined(ENABLE_SPELLCHECK) |
239 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" | 239 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" |
240 #endif | 240 #endif |
241 | 241 |
242 #if defined(ENABLE_SERVICE_DISCOVERY) | 242 #if defined(ENABLE_SERVICE_DISCOVERY) |
243 #include "chrome/browser/local_discovery/storage/privet_filesystem_backend.h" | 243 #include "chrome/browser/local_discovery/storage/privet_filesystem_backend.h" |
244 #endif | 244 #endif |
245 | 245 |
246 using base::FileDescriptor; | |
Andrew T Wilson (Slow)
2014/05/23 15:20:55
Ah, the tyranny of alphabetical order.
| |
246 using blink::WebWindowFeatures; | 247 using blink::WebWindowFeatures; |
247 using base::FileDescriptor; | |
248 using content::AccessTokenStore; | 248 using content::AccessTokenStore; |
249 using content::BrowserChildProcessHostIterator; | 249 using content::BrowserChildProcessHostIterator; |
250 using content::BrowserThread; | 250 using content::BrowserThread; |
251 using content::BrowserURLHandler; | 251 using content::BrowserURLHandler; |
252 using content::ChildProcessSecurityPolicy; | 252 using content::ChildProcessSecurityPolicy; |
253 using content::QuotaPermissionContext; | 253 using content::QuotaPermissionContext; |
254 using content::RenderFrameHost; | 254 using content::RenderFrameHost; |
255 using content::RenderViewHost; | 255 using content::RenderViewHost; |
256 using content::SiteInstance; | 256 using content::SiteInstance; |
257 using content::WebContents; | 257 using content::WebContents; |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
650 void ChromeContentBrowserClient::RegisterProfilePrefs( | 650 void ChromeContentBrowserClient::RegisterProfilePrefs( |
651 user_prefs::PrefRegistrySyncable* registry) { | 651 user_prefs::PrefRegistrySyncable* registry) { |
652 registry->RegisterBooleanPref( | 652 registry->RegisterBooleanPref( |
653 prefs::kDisable3DAPIs, | 653 prefs::kDisable3DAPIs, |
654 false, | 654 false, |
655 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 655 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
656 registry->RegisterBooleanPref( | 656 registry->RegisterBooleanPref( |
657 prefs::kEnableHyperlinkAuditing, | 657 prefs::kEnableHyperlinkAuditing, |
658 true, | 658 true, |
659 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 659 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
660 registry->RegisterListPref( | |
661 prefs::kWebKitEnableDeprecatedFeatures, | |
662 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
660 } | 663 } |
661 | 664 |
662 // static | 665 // static |
663 void ChromeContentBrowserClient::SetApplicationLocale( | 666 void ChromeContentBrowserClient::SetApplicationLocale( |
664 const std::string& locale) { | 667 const std::string& locale) { |
665 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 668 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
666 | 669 |
667 // This object is guaranteed to outlive all threads so we don't have to | 670 // This object is guaranteed to outlive all threads so we don't have to |
668 // worry about the lack of refcounting and can just post as Unretained. | 671 // worry about the lack of refcounting and can just post as Unretained. |
669 // | 672 // |
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2374 service->extensions()->GetByID(site_url.host()); | 2377 service->extensions()->GetByID(site_url.host()); |
2375 // Ensure that we are only granting extension preferences to URLs with | 2378 // Ensure that we are only granting extension preferences to URLs with |
2376 // the correct scheme. Without this check, chrome-guest:// schemes used by | 2379 // the correct scheme. Without this check, chrome-guest:// schemes used by |
2377 // webview tags as well as hosts that happen to match the id of an | 2380 // webview tags as well as hosts that happen to match the id of an |
2378 // installed extension would get the wrong preferences. | 2381 // installed extension would get the wrong preferences. |
2379 if (site_url.SchemeIs(extensions::kExtensionScheme)) { | 2382 if (site_url.SchemeIs(extensions::kExtensionScheme)) { |
2380 extension_webkit_preferences::SetPreferences( | 2383 extension_webkit_preferences::SetPreferences( |
2381 extension, view_type, web_prefs); | 2384 extension, view_type, web_prefs); |
2382 } | 2385 } |
2383 } | 2386 } |
2387 | |
2388 // Set list of deprecated features to enable. | |
2389 web_prefs->deprecated_features_to_enable.clear(); | |
2390 web_prefs->deprecated_features_to_enable.resize( | |
2391 webkit_glue::DEPRECATED_FEATURE_COUNT, false); | |
2392 const base::ListValue* deprecated_features_list = | |
2393 prefs->GetList(prefs::kWebKitEnableDeprecatedFeatures); | |
2394 for (base::ListValue::const_iterator feature( | |
2395 deprecated_features_list->begin()); | |
2396 feature != deprecated_features_list->end(); | |
2397 ++feature) { | |
2398 int value = -1; | |
2399 if ((*feature)->GetAsInteger(&value) && value >= 0 && | |
2400 value < webkit_glue::DEPRECATED_FEATURE_COUNT) { | |
2401 web_prefs->deprecated_features_to_enable[value] = true; | |
2402 } | |
2403 } | |
2384 } | 2404 } |
2385 | 2405 |
2386 void ChromeContentBrowserClient::UpdateInspectorSetting( | 2406 void ChromeContentBrowserClient::UpdateInspectorSetting( |
2387 RenderViewHost* rvh, const std::string& key, const std::string& value) { | 2407 RenderViewHost* rvh, const std::string& key, const std::string& value) { |
2388 content::BrowserContext* browser_context = | 2408 content::BrowserContext* browser_context = |
2389 rvh->GetProcess()->GetBrowserContext(); | 2409 rvh->GetProcess()->GetBrowserContext(); |
2390 DictionaryPrefUpdate update( | 2410 DictionaryPrefUpdate update( |
2391 Profile::FromBrowserContext(browser_context)->GetPrefs(), | 2411 Profile::FromBrowserContext(browser_context)->GetPrefs(), |
2392 prefs::kWebKitInspectorSettings); | 2412 prefs::kWebKitInspectorSettings); |
2393 base::DictionaryValue* inspector_settings = update.Get(); | 2413 base::DictionaryValue* inspector_settings = update.Get(); |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2752 switches::kDisableWebRtcEncryption, | 2772 switches::kDisableWebRtcEncryption, |
2753 }; | 2773 }; |
2754 to_command_line->CopySwitchesFrom(from_command_line, | 2774 to_command_line->CopySwitchesFrom(from_command_line, |
2755 kWebRtcDevSwitchNames, | 2775 kWebRtcDevSwitchNames, |
2756 arraysize(kWebRtcDevSwitchNames)); | 2776 arraysize(kWebRtcDevSwitchNames)); |
2757 } | 2777 } |
2758 } | 2778 } |
2759 #endif // defined(ENABLE_WEBRTC) | 2779 #endif // defined(ENABLE_WEBRTC) |
2760 | 2780 |
2761 } // namespace chrome | 2781 } // namespace chrome |
OLD | NEW |