Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: chrome/browser/host_content_settings_map.cc

Issue 3446013: Refcount the host content settings map from the content exceptions table model. (Closed)
Patch Set: updates Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/host_content_settings_map.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/host_content_settings_map.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698