Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 // Convenience method to return the ErrorConsole for a given profile. | 58 // Convenience method to return the ErrorConsole for a given profile. |
| 59 static ErrorConsole* Get(Profile* profile); | 59 static ErrorConsole* Get(Profile* profile); |
| 60 | 60 |
| 61 // Set whether or not errors of the specified |type| are stored for the | 61 // Set whether or not errors of the specified |type| are stored for the |
| 62 // extension with the given |extension_id|. This will be stored in the | 62 // extension with the given |extension_id|. This will be stored in the |
| 63 // preferences. | 63 // preferences. |
| 64 void SetReportingForExtension(const std::string& extension_id, | 64 void SetReportingForExtension(const std::string& extension_id, |
| 65 ExtensionError::Type type, | 65 ExtensionError::Type type, |
| 66 bool enabled); | 66 bool enabled); |
| 67 | 67 |
| 68 // Returns true if reporting for either manifest or runtime errors is enabled | |
| 69 // for the extension with the given |extension_id|. | |
| 70 bool IsReportingEnabledForExtension(const std::string& extension_id) const; | |
| 71 | |
| 68 // Restore default reporting to the given extension. | 72 // Restore default reporting to the given extension. |
| 69 void UseDefaultReportingForExtension(const std::string& extension_id); | 73 void UseDefaultReportingForExtension(const std::string& extension_id); |
| 70 | 74 |
| 71 // Report an extension error, and add it to the list. | 75 // Report an extension error, and add it to the list. |
| 72 void ReportError(scoped_ptr<ExtensionError> error); | 76 void ReportError(scoped_ptr<ExtensionError> error); |
| 73 | 77 |
| 74 // Get a collection of weak pointers to all errors relating to the extension | 78 // Get a collection of weak pointers to all errors relating to the extension |
| 75 // with the given |extension_id|. | 79 // with the given |extension_id|. |
| 76 const ErrorList& GetErrorsForExtension(const std::string& extension_id) const; | 80 const ErrorList& GetErrorsForExtension(const std::string& extension_id) const; |
| 77 | 81 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 const Extension* extension) OVERRIDE; | 135 const Extension* extension) OVERRIDE; |
| 132 | 136 |
| 133 // Add manifest errors from an extension's install warnings. | 137 // Add manifest errors from an extension's install warnings. |
| 134 void AddManifestErrorsForExtension(const Extension* extension); | 138 void AddManifestErrorsForExtension(const Extension* extension); |
| 135 | 139 |
| 136 // content::NotificationObserver implementation. | 140 // content::NotificationObserver implementation. |
| 137 virtual void Observe(int type, | 141 virtual void Observe(int type, |
| 138 const content::NotificationSource& source, | 142 const content::NotificationSource& source, |
| 139 const content::NotificationDetails& details) OVERRIDE; | 143 const content::NotificationDetails& details) OVERRIDE; |
| 140 | 144 |
| 145 // Returns true if we should report the error of the given type for the | |
| 146 // extension. | |
| 147 bool ShouldReportErrorForExtension(const std::string& extension_id, | |
| 148 ExtensionError::Type type) const; | |
|
not at google - send to devlin
2014/04/15 21:57:41
making callers specify |type| all the time is a bi
Devlin
2014/04/16 18:10:48
Different function added.
| |
| 149 | |
| 141 // Whether or not the error console should record errors. This is true if | 150 // Whether or not the error console should record errors. This is true if |
| 142 // the user is in developer mode, and at least one of the following is true: | 151 // the user is in developer mode, and at least one of the following is true: |
| 143 // - The Chrome Apps Developer Tools are installed. | 152 // - The Chrome Apps Developer Tools are installed. |
| 144 // - FeatureSwitch::error_console() is enabled. | 153 // - FeatureSwitch::error_console() is enabled. |
| 145 // - This is a Dev Channel release. | 154 // - This is a Dev Channel release. |
| 146 bool enabled_; | 155 bool enabled_; |
| 147 | 156 |
| 148 // Needed because ObserverList is not thread-safe. | 157 // Needed because ObserverList is not thread-safe. |
| 149 base::ThreadChecker thread_checker_; | 158 base::ThreadChecker thread_checker_; |
| 150 | 159 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 170 | 179 |
| 171 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 180 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 172 registry_observer_; | 181 registry_observer_; |
| 173 | 182 |
| 174 DISALLOW_COPY_AND_ASSIGN(ErrorConsole); | 183 DISALLOW_COPY_AND_ASSIGN(ErrorConsole); |
| 175 }; | 184 }; |
| 176 | 185 |
| 177 } // namespace extensions | 186 } // namespace extensions |
| 178 | 187 |
| 179 #endif // CHROME_BROWSER_EXTENSIONS_ERROR_CONSOLE_ERROR_CONSOLE_H_ | 188 #endif // CHROME_BROWSER_EXTENSIONS_ERROR_CONSOLE_ERROR_CONSOLE_H_ |
| OLD | NEW |