Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_INSTALLABLE_INSTALLABLE_LOGGING_H_ | 5 #ifndef CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_ |
| 6 #define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_ | 6 #define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 class WebContents; | 11 class WebContents; |
| 12 } | 12 } |
| 13 | 13 |
| 14 // These values are a central reference for installability errors. The | 14 // These values are a central reference for installability errors. The |
| 15 // InstallableManager will specify an InstallableStatusCode (or | 15 // InstallableManager will specify an InstallableStatusCode (or |
| 16 // NO_ERROR_DETECTED) in its result. Clients may also add their own error codes, | 16 // NO_ERROR_DETECTED) in its result. Clients may also add their own error codes, |
| 17 // and utilise LogErrorToConsole to write a message to the devtools console. | 17 // and utilise LogErrorToConsole to write a message to the devtools console. |
| 18 // This enum backs an UMA histogram, so it must be treated as append-only. | 18 // This enum backs an UMA histogram, so it must be treated as append-only. |
| 19 enum InstallableStatusCode { | 19 enum InstallableStatusCode { |
| 20 NO_ERROR_DETECTED, | 20 NO_ERROR_DETECTED, |
| 21 RENDERER_EXITING, | 21 RENDERER_EXITING, |
| 22 RENDERER_CANCELLED, | 22 RENDERER_CANCELLED, |
| 23 USER_NAVIGATED, | 23 USER_NAVIGATED, |
| 24 NOT_IN_MAIN_FRAME, | 24 NOT_IN_MAIN_FRAME, |
| 25 NOT_FROM_SECURE_ORIGIN, | 25 NOT_FROM_SECURE_ORIGIN, |
| 26 NO_MANIFEST, | 26 NO_MANIFEST, |
| 27 MANIFEST_EMPTY, | 27 MANIFEST_EMPTY, |
| 28 START_URL_NOT_VALID, | 28 START_URL_NOT_VALID, |
| 29 URL_USERNAME_AND_PASSWORD_NOT_SUPPORTED, | |
|
dominickn
2016/08/17 22:54:43
Add this to the end prior to MAX_ERROR_CODE. This
| |
| 29 MANIFEST_MISSING_NAME_OR_SHORT_NAME, | 30 MANIFEST_MISSING_NAME_OR_SHORT_NAME, |
| 30 MANIFEST_DISPLAY_NOT_SUPPORTED, | 31 MANIFEST_DISPLAY_NOT_SUPPORTED, |
| 31 MANIFEST_MISSING_SUITABLE_ICON, | 32 MANIFEST_MISSING_SUITABLE_ICON, |
| 32 NO_MATCHING_SERVICE_WORKER, | 33 NO_MATCHING_SERVICE_WORKER, |
| 33 NO_ACCEPTABLE_ICON, | 34 NO_ACCEPTABLE_ICON, |
| 34 CANNOT_DOWNLOAD_ICON, | 35 CANNOT_DOWNLOAD_ICON, |
| 35 NO_ICON_AVAILABLE, | 36 NO_ICON_AVAILABLE, |
| 36 PLATFORM_NOT_SUPPORTED_ON_ANDROID, | 37 PLATFORM_NOT_SUPPORTED_ON_ANDROID, |
| 37 NO_ID_SPECIFIED, | 38 NO_ID_SPECIFIED, |
| 38 IDS_DO_NOT_MATCH, | 39 IDS_DO_NOT_MATCH, |
| 39 ALREADY_INSTALLED, | 40 ALREADY_INSTALLED, |
| 40 INSUFFICIENT_ENGAGEMENT, | 41 INSUFFICIENT_ENGAGEMENT, |
| 41 PACKAGE_NAME_OR_START_URL_EMPTY, | 42 PACKAGE_NAME_OR_START_URL_EMPTY, |
| 42 PREVIOUSLY_BLOCKED, | 43 PREVIOUSLY_BLOCKED, |
| 43 PREVIOUSLY_IGNORED, | 44 PREVIOUSLY_IGNORED, |
| 44 SHOWING_NATIVE_APP_BANNER, | 45 SHOWING_NATIVE_APP_BANNER, |
| 45 SHOWING_WEB_APP_BANNER, | 46 SHOWING_WEB_APP_BANNER, |
| 46 FAILED_TO_CREATE_BANNER, | 47 FAILED_TO_CREATE_BANNER, |
| 47 MAX_ERROR_CODE, | 48 MAX_ERROR_CODE, |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 // Logs a message associated with |code| with a parameter |param| to the | 51 // Logs a message associated with |code| with a parameter |param| to the |
| 51 // devtools console attached to |web_contents|. Does nothing if |web_contents| | 52 // devtools console attached to |web_contents|. Does nothing if |web_contents| |
| 52 // is nullptr. | 53 // is nullptr. |
| 53 void LogErrorToConsole(content::WebContents* web_contents, | 54 void LogErrorToConsole(content::WebContents* web_contents, |
| 54 InstallableStatusCode code, | 55 InstallableStatusCode code, |
| 55 const std::string& param); | 56 const std::string& param); |
| 56 | 57 |
| 57 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_ | 58 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_ |
| OLD | NEW |