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

Side by Side Diff: chrome/browser/banners/app_banner_debug_log.cc

Issue 1396293003: Use RenderFrameHost::AddMessageToConsole for app banner debug logging. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/render_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
10 #include "content/public/browser/render_frame_host.h" 9 #include "content/public/browser/render_frame_host.h"
11 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
12 #include "content/public/browser/web_contents_observer.h"
13 11
14 namespace banners { 12 namespace banners {
15 13
16 const char kRendererRequestCancel[] = 14 const char kRendererRequestCancel[] =
17 "renderer has requested the banner prompt be cancelled"; 15 "renderer has requested the banner prompt be cancelled";
18 const char kManifestEmpty[] = "manifest is empty or missing"; 16 const char kManifestEmpty[] = "manifest is empty or missing";
19 const char kCannotDetermineBestIcon[] = 17 const char kCannotDetermineBestIcon[] =
20 "could not determine the best icon to use"; 18 "could not determine the best icon to use";
21 const char kNoMatchingServiceWorker[] = 19 const char kNoMatchingServiceWorker[] =
22 "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 "
(...skipping 22 matching lines...) Expand all
45 43
46 void OutputDeveloperNotShownMessage(content::WebContents* web_contents, 44 void OutputDeveloperNotShownMessage(content::WebContents* web_contents,
47 const std::string& message) { 45 const std::string& message) {
48 OutputDeveloperDebugMessage(web_contents, "not shown: " + message); 46 OutputDeveloperDebugMessage(web_contents, "not shown: " + message);
49 } 47 }
50 48
51 void OutputDeveloperDebugMessage(content::WebContents* web_contents, 49 void OutputDeveloperDebugMessage(content::WebContents* web_contents,
52 const std::string& message) { 50 const std::string& message) {
53 std::string log_message = "App banner " + message; 51 std::string log_message = "App banner " + message;
54 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 52 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
55 switches::kBypassAppBannerEngagementChecks) && web_contents) { 53 switches::kBypassAppBannerEngagementChecks) &&
56 web_contents->GetMainFrame()->Send( 54 web_contents) {
57 new ChromeViewMsg_AppBannerDebugMessageRequest( 55 web_contents->GetMainFrame()->AddMessageToConsole(
58 web_contents->GetMainFrame()->GetRoutingID(), log_message)); 56 content::CONSOLE_MESSAGE_LEVEL_DEBUG, log_message);
59 } 57 }
60 } 58 }
61 59
62 } // namespace banners 60 } // namespace banners
OLDNEW
« no previous file with comments | « no previous file | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698