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/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "content/public/browser/render_frame_host.h" | 8 #include "content/public/browser/render_frame_host.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void OutputDeveloperNotShownMessage(content::WebContents* web_contents, | 60 void OutputDeveloperNotShownMessage(content::WebContents* web_contents, |
61 OutputDeveloperMessageCode code, | 61 OutputDeveloperMessageCode code, |
62 const std::string& param, | 62 const std::string& param, |
63 bool is_debug_mode) { | 63 bool is_debug_mode) { |
64 if (!is_debug_mode || !web_contents) | 64 if (!is_debug_mode || !web_contents) |
65 return; | 65 return; |
66 | 66 |
67 const char* pattern; | 67 const char* pattern; |
68 content::ConsoleMessageLevel severity = content::CONSOLE_MESSAGE_LEVEL_ERROR; | 68 content::ConsoleMessageLevel severity = content::CONSOLE_MESSAGE_LEVEL_ERROR; |
69 switch (code) { | 69 switch (code) { |
| 70 case OutputDeveloperMessageCode::kNone: |
| 71 return; |
70 case OutputDeveloperMessageCode::kRendererRequestCancel: | 72 case OutputDeveloperMessageCode::kRendererRequestCancel: |
71 pattern = kRendererRequestCancelMessage; | 73 pattern = kRendererRequestCancelMessage; |
72 severity = content::CONSOLE_MESSAGE_LEVEL_LOG; | 74 severity = content::CONSOLE_MESSAGE_LEVEL_LOG; |
73 break; | 75 break; |
74 case OutputDeveloperMessageCode::kManifestEmpty: | 76 case OutputDeveloperMessageCode::kManifestEmpty: |
75 pattern = kManifestEmptyMessage; | 77 pattern = kManifestEmptyMessage; |
76 break; | 78 break; |
77 case OutputDeveloperMessageCode::kNoManifest: | 79 case OutputDeveloperMessageCode::kNoManifest: |
78 pattern = kNoManifestMessage; | 80 pattern = kNoManifestMessage; |
79 break; | 81 break; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return; | 128 return; |
127 } | 129 } |
128 std::string message = param.empty() ? | 130 std::string message = param.empty() ? |
129 pattern : base::StringPrintf(pattern, param.c_str()); | 131 pattern : base::StringPrintf(pattern, param.c_str()); |
130 web_contents->GetMainFrame()->AddMessageToConsole( | 132 web_contents->GetMainFrame()->AddMessageToConsole( |
131 severity, "App banner not shown: " + message); | 133 severity, "App banner not shown: " + message); |
132 | 134 |
133 } | 135 } |
134 | 136 |
135 } // namespace banners | 137 } // namespace banners |
OLD | NEW |