| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ERROR_CONSOLE_ERROR_CONSOLE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ERROR_CONSOLE_ERROR_CONSOLE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_ERROR_CONSOLE_ERROR_CONSOLE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ERROR_CONSOLE_ERROR_CONSOLE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 // Get a collection of weak pointers to all errors relating to the extension | 63 // Get a collection of weak pointers to all errors relating to the extension |
| 64 // with the given |extension_id|. | 64 // with the given |extension_id|. |
| 65 const ErrorList& GetErrorsForExtension(const std::string& extension_id) const; | 65 const ErrorList& GetErrorsForExtension(const std::string& extension_id) const; |
| 66 | 66 |
| 67 // Add or remove observers of the ErrorConsole to be notified of any errors | 67 // Add or remove observers of the ErrorConsole to be notified of any errors |
| 68 // added. | 68 // added. |
| 69 void AddObserver(Observer* observer); | 69 void AddObserver(Observer* observer); |
| 70 void RemoveObserver(Observer* observer); | 70 void RemoveObserver(Observer* observer); |
| 71 | 71 |
| 72 bool enabled() const { return enabled_; } |
| 72 const ErrorMap& errors() const { return errors_; } | 73 const ErrorMap& errors() const { return errors_; } |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 FRIEND_TEST_ALL_PREFIXES(ErrorConsoleUnitTest, AddAndRemoveErrors); | 76 FRIEND_TEST_ALL_PREFIXES(ErrorConsoleUnitTest, AddAndRemoveErrors); |
| 76 | 77 |
| 77 // Enable the error console for error collection and retention. This involves | 78 // Enable the error console for error collection and retention. This involves |
| 78 // subscribing to the appropriate notifications and fetching manifest errors. | 79 // subscribing to the appropriate notifications and fetching manifest errors. |
| 79 void Enable(ExtensionService* extension_service); | 80 void Enable(ExtensionService* extension_service); |
| 80 // Disable the error console, removing the subscriptions to notifications and | 81 // Disable the error console, removing the subscriptions to notifications and |
| 81 // removing all current errors. | 82 // removing all current errors. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 126 |
| 126 content::NotificationRegistrar notification_registrar_; | 127 content::NotificationRegistrar notification_registrar_; |
| 127 PrefChangeRegistrar pref_registrar_; | 128 PrefChangeRegistrar pref_registrar_; |
| 128 | 129 |
| 129 DISALLOW_COPY_AND_ASSIGN(ErrorConsole); | 130 DISALLOW_COPY_AND_ASSIGN(ErrorConsole); |
| 130 }; | 131 }; |
| 131 | 132 |
| 132 } // namespace extensions | 133 } // namespace extensions |
| 133 | 134 |
| 134 #endif // CHROME_BROWSER_EXTENSIONS_ERROR_CONSOLE_ERROR_CONSOLE_H_ | 135 #endif // CHROME_BROWSER_EXTENSIONS_ERROR_CONSOLE_ERROR_CONSOLE_H_ |
| OLD | NEW |