OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/installable/installable_logging.h" | 5 #include "chrome/browser/installable/installable_logging.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 case SHOWING_NATIVE_APP_BANNER: | 85 case SHOWING_NATIVE_APP_BANNER: |
86 case SHOWING_WEB_APP_BANNER: | 86 case SHOWING_WEB_APP_BANNER: |
87 case FAILED_TO_CREATE_BANNER: | 87 case FAILED_TO_CREATE_BANNER: |
88 case MAX_ERROR_CODE: | 88 case MAX_ERROR_CODE: |
89 return; | 89 return; |
90 case RENDERER_EXITING: | 90 case RENDERER_EXITING: |
91 pattern = kRendererExitingMessage; | 91 pattern = kRendererExitingMessage; |
92 break; | 92 break; |
93 case RENDERER_CANCELLED: | 93 case RENDERER_CANCELLED: |
94 pattern = kRendererCancelledMessage; | 94 pattern = kRendererCancelledMessage; |
95 severity = content::CONSOLE_MESSAGE_LEVEL_LOG; | 95 severity = content::CONSOLE_MESSAGE_LEVEL_INFO; |
96 break; | 96 break; |
97 case USER_NAVIGATED: | 97 case USER_NAVIGATED: |
98 pattern = kUserNavigatedMessage; | 98 pattern = kUserNavigatedMessage; |
99 severity = content::CONSOLE_MESSAGE_LEVEL_WARNING; | 99 severity = content::CONSOLE_MESSAGE_LEVEL_WARNING; |
100 break; | 100 break; |
101 case NOT_IN_MAIN_FRAME: | 101 case NOT_IN_MAIN_FRAME: |
102 pattern = kNotInMainFrameMessage; | 102 pattern = kNotInMainFrameMessage; |
103 break; | 103 break; |
104 case NOT_FROM_SECURE_ORIGIN: | 104 case NOT_FROM_SECURE_ORIGIN: |
105 pattern = kNotFromSecureOriginMessage; | 105 pattern = kNotFromSecureOriginMessage; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 break; | 152 break; |
153 } | 153 } |
154 | 154 |
155 if (!pattern) | 155 if (!pattern) |
156 return; | 156 return; |
157 std::string message = param.empty() ? | 157 std::string message = param.empty() ? |
158 pattern : base::StringPrintf(pattern, param.c_str()); | 158 pattern : base::StringPrintf(pattern, param.c_str()); |
159 web_contents->GetMainFrame()->AddMessageToConsole( | 159 web_contents->GetMainFrame()->AddMessageToConsole( |
160 severity, GetMessagePrefix() + message); | 160 severity, GetMessagePrefix() + message); |
161 } | 161 } |
OLD | NEW |