OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BANNERS_APP_BANNER_DEBUG_LOG_H_ | 5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_DEBUG_LOG_H_ |
6 #define CHROME_BROWSER_BANNERS_APP_BANNER_DEBUG_LOG_H_ | 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_DEBUG_LOG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 class WebContents; | 11 class WebContents; |
12 } // namespace content | 12 } // namespace content |
13 | 13 |
14 namespace banners { | 14 namespace banners { |
15 | 15 |
16 // Error message strings used to notify developers via the console. | 16 // Error message strings used to notify developers via the console. |
17 extern const char kRendererRequestCancel[]; | 17 |
18 extern const char kManifestEmpty[]; | 18 enum OutputDeveloperMessageCode { |
19 extern const char kNoManifest[]; | 19 kRendererRequestCancel, |
20 extern const char kNoIconMatchingRequirements[]; | 20 kManifestEmpty, |
21 extern const char kCannotDownloadIcon[]; | 21 kNoManifest, |
22 extern const char kNoMatchingServiceWorker[]; | 22 kNoIconMatchingRequirements, |
23 extern const char kNoIconAvailable[]; | 23 kCannotDownloadIcon, |
24 extern const char kUserNavigatedBeforeBannerShown[]; | 24 kNoMatchingServiceWorker, |
25 extern const char kStartURLNotValid[]; | 25 kNoIconAvailable, |
26 extern const char kManifestMissingNameOrShortName[]; | 26 kUserNavigatedBeforeBannerShown, |
27 extern const char kManifestMissingSuitableIcon[]; | 27 kStartURLNotValid, |
28 extern const char kNotLoadedInMainFrame[]; | 28 kManifestMissingNameOrShortName, |
29 extern const char kNotServedFromSecureOrigin[]; | 29 kManifestMissingSuitableIcon, |
30 extern const char kIgnoredNotSupportedOnAndroid[]; | 30 kNotLoadedInMainFrame, |
31 extern const char kIgnoredNoId[]; | 31 kNotServedFromSecureOrigin, |
32 extern const char kIgnoredIdsDoNotMatch[]; | 32 kIgnoredNotSupportedOnAndroid, |
| 33 kIgnoredNoId, |
| 34 kIgnoredIdsDoNotMatch, |
| 35 }; |
33 | 36 |
34 // Logs a message to the main console if a banner could not be shown | 37 // Logs a message to the main console if a banner could not be shown |
35 // and the engagement checks have been bypassed. | 38 // and the engagement checks have been bypassed. |
36 void OutputDeveloperNotShownMessage(content::WebContents* web_contents, | 39 void OutputDeveloperNotShownMessage(content::WebContents* web_contents, |
37 const std::string& message, | 40 OutputDeveloperMessageCode code, |
38 bool is_debug_mode); | 41 bool is_debug_mode); |
39 | 42 |
40 // Logs a debugging message to the main console if the engagement checks have | 43 // Logs a message to the main console if a banner could not be shown |
41 // been bypassed. | 44 // and the engagement checks have been bypassed. |
42 void OutputDeveloperDebugMessage(content::WebContents* web_contents, | 45 void OutputDeveloperNotShownMessage(content::WebContents* web_contents, |
43 const std::string& message, | 46 OutputDeveloperMessageCode code, |
44 bool is_debug_mode); | 47 const std::string& param, |
| 48 bool is_debug_mode); |
45 | 49 |
46 } // namespace banners | 50 } // namespace banners |
47 | 51 |
48 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_DEBUG_LOG_H_ | 52 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_DEBUG_LOG_H_ |
OLD | NEW |