OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_ |
| 6 #define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 namespace content { |
| 11 class WebContents; |
| 12 } |
| 13 |
| 14 // These values are a central reference for installability errors. The |
| 15 // InstallableManager will specify an InstallableErrorCode (or |
| 16 // NO_ERROR_DETECTED) in its result. Clients may also add their own error codes |
| 17 // to this list, and utilise LogErrorToConsole to write a message to the |
| 18 // devtools console. |
| 19 // TODO(dominickn) add an UMA metric for this enum. |
| 20 enum InstallableErrorCode { |
| 21 NO_ERROR_DETECTED, |
| 22 RENDERER_EXITING, |
| 23 RENDERER_CANCELLED, |
| 24 USER_NAVIGATED, |
| 25 NOT_IN_MAIN_FRAME, |
| 26 NOT_FROM_SECURE_ORIGIN, |
| 27 NO_MANIFEST, |
| 28 MANIFEST_EMPTY, |
| 29 START_URL_NOT_VALID, |
| 30 MANIFEST_MISSING_NAME_OR_SHORT_NAME, |
| 31 MANIFEST_DISPLAY_NOT_SUPPORTED, |
| 32 MANIFEST_MISSING_SUITABLE_ICON, |
| 33 NO_MATCHING_SERVICE_WORKER, |
| 34 NO_ACCEPTABLE_ICON, |
| 35 CANNOT_DOWNLOAD_ICON, |
| 36 NO_ICON_AVAILABLE, |
| 37 PLATFORM_NOT_SUPPORTED_ON_ANDROID, |
| 38 NO_ID_SPECIFIED, |
| 39 IDS_DO_NOT_MATCH, |
| 40 MAX_ERROR_CODE, |
| 41 }; |
| 42 |
| 43 // Logs a message associated with |code| with a parameter |param| to the |
| 44 // devtools console attached to |web_contents|. Does nothing if |web_contents| |
| 45 // is nullptr. |
| 46 void LogErrorToConsole(content::WebContents* web_contents, |
| 47 InstallableErrorCode code, |
| 48 const std::string& param); |
| 49 |
| 50 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_ |
OLD | NEW |