Chromium Code Reviews

Side by Side 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: fix Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/content_settings/mock_settings_observer.h"
6
7 #include "chrome/browser/content_settings/content_settings_details.h"
8 #include "chrome/browser/content_settings/host_content_settings_map.h"
9 #include "content/common/notification_service.h"
10 #include "content/common/notification_source.h"
11 #include "googleurl/src/gurl.h"
12
13 MockSettingsObserver::MockSettingsObserver() {
14 registrar_.Add(this, NotificationType::CONTENT_SETTINGS_CHANGED,
15 NotificationService::AllSources());
16 }
17
18 MockSettingsObserver::~MockSettingsObserver() {}
19
20 void MockSettingsObserver::Observe(NotificationType type,
21 const NotificationSource& source,
22 const NotificationDetails& details) {
23 HostContentSettingsMap* map =
24 Source<HostContentSettingsMap>(source).ptr();
25 ContentSettingsDetails* settings_details =
26 Details<ContentSettingsDetails>(details).ptr();
27 OnContentSettingsChanged(map,
28 settings_details->type(),
29 settings_details->update_all_types(),
30 settings_details->pattern(),
31 settings_details->update_all());
32 // This checks that calling a Get function from an observer doesn't
33 // deadlock.
34 map->GetContentSettings(GURL("http://random-hostname.com/"));
35 }
OLDNEW

Powered by Google App Engine