| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/host_content_settings_map.h" | 5 #include "chrome/browser/host_content_settings_map.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 prefs->ClearPref(prefs::kDefaultContentSettings); | 734 prefs->ClearPref(prefs::kDefaultContentSettings); |
| 735 prefs->ClearPref(prefs::kContentSettingsPatterns); | 735 prefs->ClearPref(prefs::kContentSettingsPatterns); |
| 736 prefs->ClearPref(prefs::kBlockThirdPartyCookies); | 736 prefs->ClearPref(prefs::kBlockThirdPartyCookies); |
| 737 prefs->ClearPref(prefs::kBlockNonsandboxedPlugins); | 737 prefs->ClearPref(prefs::kBlockNonsandboxedPlugins); |
| 738 updating_preferences_ = false; | 738 updating_preferences_ = false; |
| 739 NotifyObservers( | 739 NotifyObservers( |
| 740 ContentSettingsDetails(Pattern(), CONTENT_SETTINGS_TYPE_DEFAULT, "")); | 740 ContentSettingsDetails(Pattern(), CONTENT_SETTINGS_TYPE_DEFAULT, "")); |
| 741 } | 741 } |
| 742 } | 742 } |
| 743 | 743 |
| 744 bool HostContentSettingsMap::IsOffTheRecord() { | |
| 745 return profile_->IsOffTheRecord(); | |
| 746 } | |
| 747 | |
| 748 void HostContentSettingsMap::Observe(NotificationType type, | 744 void HostContentSettingsMap::Observe(NotificationType type, |
| 749 const NotificationSource& source, | 745 const NotificationSource& source, |
| 750 const NotificationDetails& details) { | 746 const NotificationDetails& details) { |
| 751 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 747 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
| 752 | 748 |
| 753 if (NotificationType::PREF_CHANGED == type) { | 749 if (NotificationType::PREF_CHANGED == type) { |
| 754 if (updating_preferences_) | 750 if (updating_preferences_) |
| 755 return; | 751 return; |
| 756 | 752 |
| 757 std::string* name = Details<std::string>(details).ptr(); | 753 std::string* name = Details<std::string>(details).ptr(); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 return; | 911 return; |
| 916 PrefService* prefs = profile_->GetPrefs(); | 912 PrefService* prefs = profile_->GetPrefs(); |
| 917 prefs->RemovePrefObserver(prefs::kDefaultContentSettings, this); | 913 prefs->RemovePrefObserver(prefs::kDefaultContentSettings, this); |
| 918 prefs->RemovePrefObserver(prefs::kContentSettingsPatterns, this); | 914 prefs->RemovePrefObserver(prefs::kContentSettingsPatterns, this); |
| 919 prefs->RemovePrefObserver(prefs::kBlockThirdPartyCookies, this); | 915 prefs->RemovePrefObserver(prefs::kBlockThirdPartyCookies, this); |
| 920 prefs->RemovePrefObserver(prefs::kBlockNonsandboxedPlugins, this); | 916 prefs->RemovePrefObserver(prefs::kBlockNonsandboxedPlugins, this); |
| 921 notification_registrar_.Remove(this, NotificationType::PROFILE_DESTROYED, | 917 notification_registrar_.Remove(this, NotificationType::PROFILE_DESTROYED, |
| 922 Source<Profile>(profile_)); | 918 Source<Profile>(profile_)); |
| 923 profile_ = NULL; | 919 profile_ = NULL; |
| 924 } | 920 } |
| OLD | NEW |