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 namespace installable { | |
15 | |
16 // These values are a central reference for installability errors. The | |
17 // InstallableChecker will specify an ErrorCode (or NoErrorDetected) in its | |
18 // result. Clients of the InstallableChecker may also add their own error codes | |
19 // to this list, and utilise the LogErrorToConsole method to write a message to | |
20 // the devtools console informing users of any issues. | |
21 // TODO(dominickn) add an UMA metric for this enum. | |
22 enum ErrorCode { | |
gone
2016/07/20 22:21:35
I think enums are generally easier to read when de
dominickn
2016/07/21 00:24:47
Made CAPS_WITH_UNDERSCORES.
| |
23 NoErrorDetected, | |
24 RendererExiting, | |
25 RendererRequestCancel, | |
26 UserNavigatedBeforeBannerShown, | |
27 NotLoadedInMainFrame, | |
28 NotServedFromSecureOrigin, | |
29 NoManifest, | |
30 ManifestEmpty, | |
31 StartUrlNotValid, | |
32 ManifestMissingNameOrShortName, | |
33 ManifestDisplayIsNotStandaloneOrFullscreen, | |
34 ManifestMissingSuitableIcon, | |
35 NoMatchingServiceWorker, | |
36 NoIconMatchingRequirements, | |
37 CannotDownloadIcon, | |
38 NoIconAvailable, | |
39 IgnoredNotSupportedOnAndroid, | |
40 IgnoredNoId, | |
41 IgnoredIdsDoNotMatch, | |
42 MaxErrorCode, | |
43 }; | |
44 | |
45 // Logs a message associated with |code| with a parameter |param| to the | |
46 // devtools console attached to |web_contents|. Does nothing if |web_contents| | |
47 // is nullptr. | |
48 void LogErrorToConsole(content::WebContents* web_contents, | |
49 ErrorCode code, | |
50 const std::string& param); | |
51 | |
52 } // namespace installable | |
53 | |
54 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_ | |
OLD | NEW |