| OLD | NEW |
| 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/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "content/browser/browser_thread.h" | 13 #include "content/browser/browser_thread.h" |
| 14 #include "content/common/notification_service.h" | 14 #include "content/common/notification_service.h" |
| 15 | 15 |
| 16 // The internal class is refcounted so it can outlive PluginDataRemoverHelper. | 16 // The internal class is refcounted so it can outlive PluginDataRemoverHelper. |
| 17 class PluginDataRemoverHelper::Internal | 17 class PluginDataRemoverHelper::Internal |
| 18 : public base::RefCountedThreadSafe<PluginDataRemoverHelper::Internal> { | 18 : public base::RefCountedThreadSafe<PluginDataRemoverHelper::Internal> { |
| 19 public: | 19 public: |
| 20 explicit Internal(const char* pref_name, PrefService* prefs) | 20 Internal(const char* pref_name, PrefService* prefs) |
| 21 : pref_name_(pref_name), prefs_(prefs) {} | 21 : pref_name_(pref_name), prefs_(prefs) {} |
| 22 | 22 |
| 23 void StartUpdate() { | 23 void StartUpdate() { |
| 24 BrowserThread::PostTask( | 24 BrowserThread::PostTask( |
| 25 BrowserThread::FILE, | 25 BrowserThread::FILE, |
| 26 FROM_HERE, | 26 FROM_HERE, |
| 27 NewRunnableMethod( | 27 NewRunnableMethod( |
| 28 this, | 28 this, |
| 29 &PluginDataRemoverHelper::Internal::UpdateOnFileThread)); | 29 &PluginDataRemoverHelper::Internal::UpdateOnFileThread)); |
| 30 } | 30 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 void PluginDataRemoverHelper::Observe(int type, | 83 void PluginDataRemoverHelper::Observe(int type, |
| 84 const NotificationSource& source, | 84 const NotificationSource& source, |
| 85 const NotificationDetails& details) { | 85 const NotificationDetails& details) { |
| 86 if (type == content::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED) { | 86 if (type == content::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED) { |
| 87 internal_->StartUpdate(); | 87 internal_->StartUpdate(); |
| 88 } else { | 88 } else { |
| 89 NOTREACHED(); | 89 NOTREACHED(); |
| 90 } | 90 } |
| 91 } | 91 } |
| OLD | NEW |