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

Side by Side Diff: chrome/browser/content_settings/stub_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, 6 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 | 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/stub_settings_observer.h"
6
7 #include "chrome/browser/content_settings/host_content_settings_map.h"
8 #include "googleurl/src/gurl.h"
9
10 StubSettingsObserver::StubSettingsObserver()
11 : last_notifier(NULL),
12 counter(0) {
13 registrar_.Add(this, NotificationType::CONTENT_SETTINGS_CHANGED,
14 NotificationService::AllSources());
15 }
16
17 StubSettingsObserver::~StubSettingsObserver() {}
18
19 void StubSettingsObserver::Observe(NotificationType type,
20 const NotificationSource& source,
21 const NotificationDetails& details) {
22 ++counter;
23 Source<HostContentSettingsMap> content_settings(source);
24 Details<ContentSettingsDetails> settings_details(details);
25 last_notifier = content_settings.ptr();
26 last_pattern = settings_details.ptr()->pattern();
27 last_update_all = settings_details.ptr()->update_all();
28 last_update_all_types = settings_details.ptr()->update_all_types();
29 last_type = settings_details.ptr()->type();
30 // This checks that calling a Get function from an observer doesn't
31 // deadlock.
32 last_notifier->GetContentSettings(GURL("http://random-hostname.com/"));
33 }
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/stub_settings_observer.h ('k') | chrome/browser/cookies_tree_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698