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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 updating_preferences_ = true; | 699 updating_preferences_ = true; |
700 prefs->ClearPref(prefs::kDefaultContentSettings); | 700 prefs->ClearPref(prefs::kDefaultContentSettings); |
701 prefs->ClearPref(prefs::kContentSettingsPatterns); | 701 prefs->ClearPref(prefs::kContentSettingsPatterns); |
702 prefs->ClearPref(prefs::kBlockThirdPartyCookies); | 702 prefs->ClearPref(prefs::kBlockThirdPartyCookies); |
703 updating_preferences_ = false; | 703 updating_preferences_ = false; |
704 NotifyObservers( | 704 NotifyObservers( |
705 ContentSettingsDetails(Pattern(), CONTENT_SETTINGS_TYPE_DEFAULT, "")); | 705 ContentSettingsDetails(Pattern(), CONTENT_SETTINGS_TYPE_DEFAULT, "")); |
706 } | 706 } |
707 } | 707 } |
708 | 708 |
709 bool HostContentSettingsMap::IsOffTheRecord() { | |
710 return profile_->IsOffTheRecord(); | |
711 } | |
712 | |
713 void HostContentSettingsMap::Observe(NotificationType type, | 709 void HostContentSettingsMap::Observe(NotificationType type, |
714 const NotificationSource& source, | 710 const NotificationSource& source, |
715 const NotificationDetails& details) { | 711 const NotificationDetails& details) { |
716 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 712 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
717 | 713 |
718 if (NotificationType::PREF_CHANGED == type) { | 714 if (NotificationType::PREF_CHANGED == type) { |
719 if (updating_preferences_) | 715 if (updating_preferences_) |
720 return; | 716 return; |
721 | 717 |
722 std::string* name = Details<std::string>(details).ptr(); | 718 std::string* name = Details<std::string>(details).ptr(); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 if (!profile_) | 874 if (!profile_) |
879 return; | 875 return; |
880 PrefService* prefs = profile_->GetPrefs(); | 876 PrefService* prefs = profile_->GetPrefs(); |
881 prefs->RemovePrefObserver(prefs::kDefaultContentSettings, this); | 877 prefs->RemovePrefObserver(prefs::kDefaultContentSettings, this); |
882 prefs->RemovePrefObserver(prefs::kContentSettingsPatterns, this); | 878 prefs->RemovePrefObserver(prefs::kContentSettingsPatterns, this); |
883 prefs->RemovePrefObserver(prefs::kBlockThirdPartyCookies, this); | 879 prefs->RemovePrefObserver(prefs::kBlockThirdPartyCookies, this); |
884 notification_registrar_.Remove(this, NotificationType::PROFILE_DESTROYED, | 880 notification_registrar_.Remove(this, NotificationType::PROFILE_DESTROYED, |
885 Source<Profile>(profile_)); | 881 Source<Profile>(profile_)); |
886 profile_ = NULL; | 882 profile_ = NULL; |
887 } | 883 } |
OLD | NEW |