Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: chrome/browser/banners/app_banner_debug_log.cc

Issue 1569893003: Add "Request app banner" context menu in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated dominickn's comment Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/banners/app_banner_debug_log.cc
diff --git a/chrome/browser/banners/app_banner_debug_log.cc b/chrome/browser/banners/app_banner_debug_log.cc
index e1b06f91b5a42ee79b917a32db5ae27d3406a3d8..b804f3bb67041ae34435389292e20a7a9aa3f22d 100644
--- a/chrome/browser/banners/app_banner_debug_log.cc
+++ b/chrome/browser/banners/app_banner_debug_log.cc
@@ -33,6 +33,7 @@ const char kManifestMissingNameOrShortName[] =
const char kManifestMissingSuitableIcon[] =
"manifest does not contain a suitable icon - PNG format of at least "
"144x144px is required, and the sizes attribute must be set";
+const char kNotLoadedInMainFrame[] = "page not loaded in the main frame";
const char kNotServedFromSecureOrigin[] =
"page not served from a secure origin";
// The leading space is intentional as another string is prepended.
@@ -44,15 +45,19 @@ const char kIgnoredIdsDoNotMatch[] =
"manifest, but they do not match";
void OutputDeveloperNotShownMessage(content::WebContents* web_contents,
- const std::string& message) {
- OutputDeveloperDebugMessage(web_contents, "not shown: " + message);
+ const std::string& message,
+ bool is_debug_mode) {
+ OutputDeveloperDebugMessage(web_contents, "not shown: " + message,
+ is_debug_mode);
}
void OutputDeveloperDebugMessage(content::WebContents* web_contents,
- const std::string& message) {
+ const std::string& message,
+ bool is_debug_mode) {
std::string log_message = "App banner " + message;
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kBypassAppBannerEngagementChecks) &&
+ if ((is_debug_mode ||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kBypassAppBannerEngagementChecks)) &&
dominickn 2016/01/18 23:20:41 With is_debug_mode incorporating the CommandLine c
horo 2016/01/19 01:45:43 Done.
web_contents) {
web_contents->GetMainFrame()->AddMessageToConsole(
content::CONSOLE_MESSAGE_LEVEL_DEBUG, log_message);

Powered by Google App Engine
This is Rietveld 408576698