summaryrefslogtreecommitdiffstats
path: root/chrome/browser/content_settings/mock_settings_observer.cc
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-03 22:50:56 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-03 22:50:56 +0000
commite3569db2b5837e69628e91fcbd23884c70891a36 (patch)
tree19cd864ea37a616e8f1f5f5a47b7473719c99cf8 /chrome/browser/content_settings/mock_settings_observer.cc
parentfb48d81d37434f4f77deabbeaf1fb197cdd8788e (diff)
downloadchromium_src-e3569db2b5837e69628e91fcbd23884c70891a36.zip
chromium_src-e3569db2b5837e69628e91fcbd23884c70891a36.tar.gz
chromium_src-e3569db2b5837e69628e91fcbd23884c70891a36.tar.bz2
Split incognito extension content settings in session-only and persistent.
BUG=71067 TEST=none Review URL: http://codereview.chromium.org/7088017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87891 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_settings/mock_settings_observer.cc')
-rw-r--r--chrome/browser/content_settings/mock_settings_observer.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/browser/content_settings/mock_settings_observer.cc b/chrome/browser/content_settings/mock_settings_observer.cc
new file mode 100644
index 0000000..e5c6470
--- /dev/null
+++ b/chrome/browser/content_settings/mock_settings_observer.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/content_settings/mock_settings_observer.h"
+
+#include "chrome/browser/content_settings/content_settings_details.h"
+#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "content/common/notification_service.h"
+#include "content/common/notification_source.h"
+#include "googleurl/src/gurl.h"
+
+MockSettingsObserver::MockSettingsObserver() {
+ registrar_.Add(this, NotificationType::CONTENT_SETTINGS_CHANGED,
+ NotificationService::AllSources());
+}
+
+MockSettingsObserver::~MockSettingsObserver() {}
+
+void MockSettingsObserver::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ HostContentSettingsMap* map =
+ Source<HostContentSettingsMap>(source).ptr();
+ ContentSettingsDetails* settings_details =
+ Details<ContentSettingsDetails>(details).ptr();
+ OnContentSettingsChanged(map,
+ settings_details->type(),
+ settings_details->update_all_types(),
+ settings_details->pattern(),
+ settings_details->update_all());
+ // This checks that calling a Get function from an observer doesn't
+ // deadlock.
+ map->GetContentSettings(GURL("http://random-hostname.com/"));
+}