| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_EXTENSION_WARNING_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SERVICE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SERVICE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // Manages a set of warnings caused by extensions. These warnings (e.g. | 30 // Manages a set of warnings caused by extensions. These warnings (e.g. |
| 31 // conflicting modifications of network requests by extensions, slow extensions, | 31 // conflicting modifications of network requests by extensions, slow extensions, |
| 32 // etc.) trigger a warning badge in the UI and and provide means to resolve | 32 // etc.) trigger a warning badge in the UI and and provide means to resolve |
| 33 // them. This class must be used on the UI thread only. | 33 // them. This class must be used on the UI thread only. |
| 34 class ExtensionWarningService : public content::NotificationObserver, | 34 class ExtensionWarningService : public content::NotificationObserver, |
| 35 public base::NonThreadSafe { | 35 public base::NonThreadSafe { |
| 36 public: | 36 public: |
| 37 class Observer { | 37 class Observer { |
| 38 public: | 38 public: |
| 39 virtual ~Observer() { } | |
| 40 | |
| 41 virtual void ExtensionWarningsChanged() = 0; | 39 virtual void ExtensionWarningsChanged() = 0; |
| 42 }; | 40 }; |
| 43 | 41 |
| 44 // |profile| may be NULL for testing. In this case, be sure to not insert | 42 // |profile| may be NULL for testing. In this case, be sure to not insert |
| 45 // any warnings. | 43 // any warnings. |
| 46 explicit ExtensionWarningService(Profile* profile); | 44 explicit ExtensionWarningService(Profile* profile); |
| 47 virtual ~ExtensionWarningService(); | 45 virtual ~ExtensionWarningService(); |
| 48 | 46 |
| 49 // Clears all warnings of types contained in |types| and notifies observers | 47 // Clears all warnings of types contained in |types| and notifies observers |
| 50 // of the changed warnings. | 48 // of the changed warnings. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 content::NotificationRegistrar registrar_; | 83 content::NotificationRegistrar registrar_; |
| 86 | 84 |
| 87 Profile* profile_; | 85 Profile* profile_; |
| 88 | 86 |
| 89 ObserverList<Observer> observer_list_; | 87 ObserverList<Observer> observer_list_; |
| 90 }; | 88 }; |
| 91 | 89 |
| 92 } // namespace extensions | 90 } // namespace extensions |
| 93 | 91 |
| 94 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SERVICE_H_ | 92 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SERVICE_H_ |
| OLD | NEW |