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

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

Issue 7387010: Add PluginServiceFilter interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit test Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/plugin_data_remover_browsertest.cc ('k') | chrome/browser/plugin_prefs.cc » ('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) 2011 The Chromium Authors. All rights reserved. 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 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/plugin_data_remover_helper.h" 5 #include "chrome/browser/plugin_data_remover_helper.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/plugin_data_remover.h" 10 #include "chrome/browser/plugin_data_remover.h"
11 #include "chrome/browser/plugin_prefs.h" 11 #include "chrome/browser/plugin_prefs.h"
12 #include "chrome/browser/prefs/pref_service.h" 12 #include "chrome/browser/prefs/pref_service.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/common/chrome_notification_types.h"
14 #include "content/browser/browser_thread.h" 15 #include "content/browser/browser_thread.h"
15 #include "content/common/notification_service.h" 16 #include "content/common/notification_service.h"
16 17
17 // The internal class is refcounted so it can outlive PluginDataRemoverHelper. 18 // The internal class is refcounted so it can outlive PluginDataRemoverHelper.
18 class PluginDataRemoverHelper::Internal 19 class PluginDataRemoverHelper::Internal
19 : public base::RefCountedThreadSafe<PluginDataRemoverHelper::Internal> { 20 : public base::RefCountedThreadSafe<PluginDataRemoverHelper::Internal> {
20 public: 21 public:
21 Internal(const char* pref_name, Profile* profile) 22 Internal(const char* pref_name, Profile* profile)
22 : pref_name_(pref_name), profile_(profile) {} 23 : pref_name_(pref_name), profile_(profile) {}
23 24
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 PluginDataRemoverHelper::~PluginDataRemoverHelper() { 70 PluginDataRemoverHelper::~PluginDataRemoverHelper() {
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 71 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
71 if (internal_) 72 if (internal_)
72 internal_->Invalidate(); 73 internal_->Invalidate();
73 } 74 }
74 75
75 void PluginDataRemoverHelper::Init(const char* pref_name, 76 void PluginDataRemoverHelper::Init(const char* pref_name,
76 Profile* profile, 77 Profile* profile,
77 NotificationObserver* observer) { 78 NotificationObserver* observer) {
78 pref_.Init(pref_name, profile->GetPrefs(), observer); 79 pref_.Init(pref_name, profile->GetPrefs(), observer);
79 registrar_.Add(this, content::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, 80 registrar_.Add(this, chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED,
80 NotificationService::AllSources()); 81 NotificationService::AllSources());
81 internal_ = make_scoped_refptr(new Internal(pref_name, profile)); 82 internal_ = make_scoped_refptr(new Internal(pref_name, profile));
82 internal_->StartUpdate(); 83 internal_->StartUpdate();
83 } 84 }
84 85
85 void PluginDataRemoverHelper::Observe(int type, 86 void PluginDataRemoverHelper::Observe(int type,
86 const NotificationSource& source, 87 const NotificationSource& source,
87 const NotificationDetails& details) { 88 const NotificationDetails& details) {
88 if (type == content::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED) { 89 if (type == chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED) {
89 internal_->StartUpdate(); 90 internal_->StartUpdate();
90 } else { 91 } else {
91 NOTREACHED(); 92 NOTREACHED();
92 } 93 }
93 } 94 }
OLDNEW
« no previous file with comments | « chrome/browser/plugin_data_remover_browsertest.cc ('k') | chrome/browser/plugin_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698