| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_MANAGER_H_ | 6 #define CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 virtual std::vector<FilePath> GetTransientBlacklistPaths() = 0; | 26 virtual std::vector<FilePath> GetTransientBlacklistPaths() = 0; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // Updates one compiled binary blacklist based on a list of plaintext | 29 // Updates one compiled binary blacklist based on a list of plaintext |
| 30 // blacklists. | 30 // blacklists. |
| 31 class BlacklistManager | 31 class BlacklistManager |
| 32 : public NotificationObserver, | 32 : public NotificationObserver, |
| 33 public base::RefCountedThreadSafe<BlacklistManager, | 33 public base::RefCountedThreadSafe<BlacklistManager, |
| 34 ChromeThread::DeleteOnUIThread> { | 34 ChromeThread::DeleteOnUIThread> { |
| 35 public: | 35 public: |
| 36 BlacklistManager(Profile* profile, BlacklistPathProvider* path_provider); | 36 BlacklistManager(); |
| 37 void Initialize(Profile* profile, BlacklistPathProvider* path_provider); |
| 37 | 38 |
| 38 const Blacklist* GetCompiledBlacklist() const { | 39 const Blacklist* GetCompiledBlacklist() const { |
| 39 // TODO(phajdan.jr): Determine on which thread this should be invoked (IO?). | 40 // TODO(phajdan.jr): Determine on which thread this should be invoked (IO?). |
| 40 return compiled_blacklist_.get(); | 41 return compiled_blacklist_.get(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 // NotificationObserver | 44 // NotificationObserver |
| 44 virtual void Observe(NotificationType type, | 45 virtual void Observe(NotificationType type, |
| 45 const NotificationSource& source, | 46 const NotificationSource& source, |
| 46 const NotificationDetails& details); | 47 const NotificationDetails& details); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 scoped_ptr<Blacklist> compiled_blacklist_; | 81 scoped_ptr<Blacklist> compiled_blacklist_; |
| 81 | 82 |
| 82 BlacklistPathProvider* path_provider_; | 83 BlacklistPathProvider* path_provider_; |
| 83 | 84 |
| 84 NotificationRegistrar registrar_; | 85 NotificationRegistrar registrar_; |
| 85 | 86 |
| 86 DISALLOW_COPY_AND_ASSIGN(BlacklistManager); | 87 DISALLOW_COPY_AND_ASSIGN(BlacklistManager); |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 #endif // CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_MANAGER_H_ | 90 #endif // CHROME_BROWSER_PRIVACY_BLACKLIST_BLACKLIST_MANAGER_H_ |
| OLD | NEW |