| 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 #include "chrome/browser/banners/app_banner_debug_log.h" | 5 #include "chrome/browser/banners/app_banner_debug_log.h" |
| 6 | 6 |
| 7 #include "content/public/browser/render_frame_host.h" | 7 #include "content/public/browser/render_frame_host.h" |
| 8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 9 | 9 |
| 10 namespace banners { | 10 namespace banners { |
| 11 | 11 |
| 12 const char kRendererRequestCancel[] = | 12 const char kRendererRequestCancel[] = |
| 13 "renderer has requested the banner prompt be cancelled"; | 13 "renderer has requested the banner prompt be cancelled"; |
| 14 const char kManifestEmpty[] = | 14 const char kManifestEmpty[] = |
| 15 "manifest could not be fetched, is empty, or could not be parsed"; | 15 "manifest could not be fetched, is empty, or could not be parsed"; |
| 16 const char kNoManifest[] = "site has no manifest <link> URL"; | 16 const char kNoManifest[] = "site has no manifest <link> URL"; |
| 17 const char kCannotDetermineBestIcon[] = | 17 const char kCannotDetermineBestIcon[] = |
| 18 "could not determine the best icon to use"; | 18 "could not determine the best icon to use"; |
| 19 const char kNoMatchingServiceWorker[] = | 19 const char kNoMatchingServiceWorker[] = |
| 20 "no matching service worker detected. You may need to reload the page, or " | 20 "no matching service worker detected. You may need to reload the page, or " |
| 21 "check that the service worker for the current page also controls the " | 21 "check that the service worker for the current page also controls the " |
| 22 "start URL from the manifest"; | 22 "start URL from the manifest"; |
| 23 const char kNoIconAvailable[] = "no icon available to display"; | 23 const char kNoIconAvailable[] = "no icon available to display"; |
| 24 const char kUserNavigatedBeforeBannerShown[] = | 24 const char kUserNavigatedBeforeBannerShown[] = |
| 25 "the user navigated before the banner could be shown"; | 25 "the user navigated before the banner could be shown"; |
| 26 const char kStartURLNotValid[] = "start URL in manifest is not valid"; | 26 const char kStartURLNotValid[] = "start URL in manifest is not valid"; |
| 27 const char kManifestMissingNameOrShortName[] = | 27 const char kManifestMissingNameOrShortName[] = |
| 28 "one of manifest name or short name must be specified"; | 28 "one of manifest name or short name must be specified"; |
| 29 const char kManifestDisplayStandaloneFullscreen[] = |
| 30 "manifest display property must be set to 'standalone' or 'fullscreen'"; |
| 29 const char kManifestMissingSuitableIcon[] = | 31 const char kManifestMissingSuitableIcon[] = |
| 30 "manifest does not contain a suitable icon - PNG format of at least " | 32 "manifest does not contain a suitable icon - PNG format of at least " |
| 31 "144x144px is required, and the sizes attribute must be set"; | 33 "144x144px is required, and the sizes attribute must be set"; |
| 32 const char kNotLoadedInMainFrame[] = "page not loaded in the main frame"; | 34 const char kNotLoadedInMainFrame[] = "page not loaded in the main frame"; |
| 33 const char kNotServedFromSecureOrigin[] = | 35 const char kNotServedFromSecureOrigin[] = |
| 34 "page not served from a secure origin"; | 36 "page not served from a secure origin"; |
| 35 // The leading space is intentional as another string is prepended. | 37 // The leading space is intentional as another string is prepended. |
| 36 const char kIgnoredNotSupportedOnAndroid[] = | 38 const char kIgnoredNotSupportedOnAndroid[] = |
| 37 " application ignored: not supported on Android"; | 39 " application ignored: not supported on Android"; |
| 38 const char kIgnoredNoId[] = "play application ignored: no id provided"; | 40 const char kIgnoredNoId[] = "play application ignored: no id provided"; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 50 void OutputDeveloperDebugMessage(content::WebContents* web_contents, | 52 void OutputDeveloperDebugMessage(content::WebContents* web_contents, |
| 51 const std::string& message, | 53 const std::string& message, |
| 52 bool is_debug_mode) { | 54 bool is_debug_mode) { |
| 53 if (!is_debug_mode || !web_contents) | 55 if (!is_debug_mode || !web_contents) |
| 54 return; | 56 return; |
| 55 web_contents->GetMainFrame()->AddMessageToConsole( | 57 web_contents->GetMainFrame()->AddMessageToConsole( |
| 56 content::CONSOLE_MESSAGE_LEVEL_DEBUG, "App banner " + message); | 58 content::CONSOLE_MESSAGE_LEVEL_DEBUG, "App banner " + message); |
| 57 } | 59 } |
| 58 | 60 |
| 59 } // namespace banners | 61 } // namespace banners |
| OLD | NEW |