| 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/ui/prefs/prefs_tab_helper.h" | 5 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 chrome::NOTIFICATION_BROWSER_FLING_CURVE_PARAMETERS_CHANGED, | 484 chrome::NOTIFICATION_BROWSER_FLING_CURVE_PARAMETERS_CHANGED, |
| 485 content::NotificationService::AllSources()); | 485 content::NotificationService::AllSources()); |
| 486 #endif | 486 #endif |
| 487 } | 487 } |
| 488 | 488 |
| 489 PrefsTabHelper::~PrefsTabHelper() { | 489 PrefsTabHelper::~PrefsTabHelper() { |
| 490 PrefWatcher::Get(profile_)->UnregisterHelper(this); | 490 PrefWatcher::Get(profile_)->UnregisterHelper(this); |
| 491 } | 491 } |
| 492 | 492 |
| 493 // static | 493 // static |
| 494 void PrefsTabHelper::InitIncognitoUserPrefStore( | |
| 495 OverlayUserPrefStore* pref_store) { | |
| 496 // List of keys that cannot be changed in the user prefs file by the incognito | |
| 497 // profile. All preferences that store information about the browsing history | |
| 498 // or behavior of the user should have this property. | |
| 499 pref_store->RegisterOverlayPref(prefs::kBrowserWindowPlacement); | |
| 500 pref_store->RegisterOverlayPref(prefs::kSaveFileDefaultDirectory); | |
| 501 #if defined(OS_ANDROID) || defined(OS_IOS) | |
| 502 pref_store->RegisterOverlayPref(proxy_config::prefs::kProxy); | |
| 503 #endif // defined(OS_ANDROID) || defined(OS_IOS) | |
| 504 } | |
| 505 | |
| 506 // static | |
| 507 void PrefsTabHelper::RegisterProfilePrefs( | 494 void PrefsTabHelper::RegisterProfilePrefs( |
| 508 user_prefs::PrefRegistrySyncable* registry) { | 495 user_prefs::PrefRegistrySyncable* registry) { |
| 509 WebPreferences pref_defaults; | 496 WebPreferences pref_defaults; |
| 510 registry->RegisterBooleanPref(prefs::kWebKitJavascriptEnabled, | 497 registry->RegisterBooleanPref(prefs::kWebKitJavascriptEnabled, |
| 511 pref_defaults.javascript_enabled); | 498 pref_defaults.javascript_enabled); |
| 512 registry->RegisterBooleanPref(prefs::kWebKitWebSecurityEnabled, | 499 registry->RegisterBooleanPref(prefs::kWebKitWebSecurityEnabled, |
| 513 pref_defaults.web_security_enabled); | 500 pref_defaults.web_security_enabled); |
| 514 registry->RegisterBooleanPref( | 501 registry->RegisterBooleanPref( |
| 515 prefs::kWebKitJavascriptCanOpenWindowsAutomatically, true); | 502 prefs::kWebKitJavascriptCanOpenWindowsAutomatically, true); |
| 516 registry->RegisterBooleanPref(prefs::kWebKitLoadsImagesAutomatically, | 503 registry->RegisterBooleanPref(prefs::kWebKitLoadsImagesAutomatically, |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 } | 656 } |
| 670 } | 657 } |
| 671 | 658 |
| 672 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { | 659 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { |
| 673 #if !defined(OS_ANDROID) | 660 #if !defined(OS_ANDROID) |
| 674 OnFontFamilyPrefChanged(pref_name); | 661 OnFontFamilyPrefChanged(pref_name); |
| 675 #endif | 662 #endif |
| 676 | 663 |
| 677 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); | 664 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); |
| 678 } | 665 } |
| OLD | NEW |