| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
| 10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 13 | 13 |
| 14 namespace banners { | 14 namespace banners { |
| 15 | 15 |
| 16 const char kRendererRequestCancel[] = | 16 const char kRendererRequestCancel[] = |
| 17 "renderer has requested the banner prompt be cancelled"; | 17 "renderer has requested the banner prompt be cancelled"; |
| 18 const char kManifestEmpty[] = "manifest is empty or missing"; | 18 const char kManifestEmpty[] = "manifest is empty or missing"; |
| 19 const char kCannotDetermineBestIcon[] = | 19 const char kCannotDetermineBestIcon[] = |
| 20 "could not determine the best icon to use"; | 20 "could not determine the best icon to use"; |
| 21 const char kCannotDetermineBestSplashIcon[] = |
| 22 "could not determine the best splashscreen icon to use"; |
| 21 const char kNoMatchingServiceWorker[] = | 23 const char kNoMatchingServiceWorker[] = |
| 22 "no matching service worker detected. You may need to reload the page, or " | 24 "no matching service worker detected. You may need to reload the page, or " |
| 23 "check that the service worker for the current page also controls the " | 25 "check that the service worker for the current page also controls the " |
| 24 "start URL from the manifest"; | 26 "start URL from the manifest"; |
| 25 const char kNoIconAvailable[] = "no icon available to display"; | 27 const char kNoIconAvailable[] = "no icon available to display"; |
| 28 const char kNoSplashIconAvailable[] = |
| 29 "no splashscreen icon available to display"; |
| 26 const char kBannerAlreadyAdded[] = | 30 const char kBannerAlreadyAdded[] = |
| 27 "site requesting the banner has already been added"; | 31 "site requesting the banner has already been added"; |
| 28 const char kUserNavigatedBeforeBannerShown[] = | 32 const char kUserNavigatedBeforeBannerShown[] = |
| 29 "the user navigated before the banner could be shown"; | 33 "the user navigated before the banner could be shown"; |
| 30 const char kStartURLNotValid[] = "start URL in manifest is not valid"; | 34 const char kStartURLNotValid[] = "start URL in manifest is not valid"; |
| 31 const char kManifestMissingNameOrShortName[] = | 35 const char kManifestMissingNameOrShortName[] = |
| 32 "one of manifest name or short name must be specified"; | 36 "one of manifest name or short name must be specified"; |
| 33 const char kManifestMissingSuitableIcon[] = | 37 const char kManifestMissingSuitableIcon[] = |
| 34 "manifest does not contain a suitable icon - PNG format of at least " | 38 "manifest does not contain a suitable icon - PNG format of at least " |
| 35 "144x144px is required"; | 39 "144x144px is required"; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 53 std::string log_message = "App banner " + message; | 57 std::string log_message = "App banner " + message; |
| 54 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 58 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 55 switches::kBypassAppBannerEngagementChecks) && web_contents) { | 59 switches::kBypassAppBannerEngagementChecks) && web_contents) { |
| 56 web_contents->GetMainFrame()->Send( | 60 web_contents->GetMainFrame()->Send( |
| 57 new ChromeViewMsg_AppBannerDebugMessageRequest( | 61 new ChromeViewMsg_AppBannerDebugMessageRequest( |
| 58 web_contents->GetMainFrame()->GetRoutingID(), log_message)); | 62 web_contents->GetMainFrame()->GetRoutingID(), log_message)); |
| 59 } | 63 } |
| 60 } | 64 } |
| 61 | 65 |
| 62 } // namespace banners | 66 } // namespace banners |
| OLD | NEW |