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

Unified Diff: chrome/browser/content_settings/mock_settings_observer.cc

Issue 7088017: Split incognito extension content settings in session-only and persistent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/content_settings/mock_settings_observer.cc
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 0000000000000000000000000000000000000000..e5c64708aa4972269c61f467052ee234edde52e4
--- /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/"));
+}
« no previous file with comments | « chrome/browser/content_settings/mock_settings_observer.h ('k') | chrome/browser/content_settings/stub_settings_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698