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 |
39 virtual void ExtensionWarningsChanged() = 0; | 41 virtual void ExtensionWarningsChanged() = 0; |
40 }; | 42 }; |
41 | 43 |
42 // |profile| may be NULL for testing. In this case, be sure to not insert | 44 // |profile| may be NULL for testing. In this case, be sure to not insert |
43 // any warnings. | 45 // any warnings. |
44 explicit ExtensionWarningService(Profile* profile); | 46 explicit ExtensionWarningService(Profile* profile); |
45 virtual ~ExtensionWarningService(); | 47 virtual ~ExtensionWarningService(); |
46 | 48 |
47 // Clears all warnings of types contained in |types| and notifies observers | 49 // Clears all warnings of types contained in |types| and notifies observers |
48 // of the changed warnings. | 50 // of the changed warnings. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 content::NotificationRegistrar registrar_; | 85 content::NotificationRegistrar registrar_; |
84 | 86 |
85 Profile* profile_; | 87 Profile* profile_; |
86 | 88 |
87 ObserverList<Observer> observer_list_; | 89 ObserverList<Observer> observer_list_; |
88 }; | 90 }; |
89 | 91 |
90 } // namespace extensions | 92 } // namespace extensions |
91 | 93 |
92 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SERVICE_H_ | 94 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SERVICE_H_ |
OLD | NEW |