| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 "%spx is required, the sizes attribute must be set, and the purpose " | 43 "%spx is required, the sizes attribute must be set, and the purpose " |
| 44 "attribute, if set, must include \"any\"."; | 44 "attribute, if set, must include \"any\"."; |
| 45 static const char kNoMatchingServiceWorkerMessage[] = | 45 static const char kNoMatchingServiceWorkerMessage[] = |
| 46 "no matching service worker detected. You may need to reload the page, or " | 46 "no matching service worker detected. You may need to reload the page, or " |
| 47 "check that the service worker for the current page also controls the " | 47 "check that the service worker for the current page also controls the " |
| 48 "start URL from the manifest"; | 48 "start URL from the manifest"; |
| 49 static const char kNoAcceptableIconMessage[] = | 49 static const char kNoAcceptableIconMessage[] = |
| 50 "a %spx square icon is required, but no supplied icon meets this " | 50 "a %spx square icon is required, but no supplied icon meets this " |
| 51 "requirement"; | 51 "requirement"; |
| 52 static const char kCannotDownloadIconMessage[] = | 52 static const char kCannotDownloadIconMessage[] = |
| 53 "could not download the specified icon"; | 53 "could not download a required icon from the manifest"; |
| 54 static const char kNoIconAvailableMessage[] = | 54 static const char kNoIconAvailableMessage[] = |
| 55 "no icon available to display"; | 55 "icon downloaded from the manifest was empty or corrupted"; |
| 56 static const char kPlatformNotSupportedOnAndroidMessage[] = | 56 static const char kPlatformNotSupportedOnAndroidMessage[] = |
| 57 "the specified application platform is not supported on Android"; | 57 "the specified application platform is not supported on Android"; |
| 58 static const char kNoIdSpecifiedMessage[] = | 58 static const char kNoIdSpecifiedMessage[] = |
| 59 "no Play store ID provided"; | 59 "no Play store ID provided"; |
| 60 static const char kIdsDoNotMatchMessage[] = | 60 static const char kIdsDoNotMatchMessage[] = |
| 61 "a Play Store app URL and Play Store ID were specified in the manifest, " | 61 "a Play Store app URL and Play Store ID were specified in the manifest, " |
| 62 "but they do not match"; | 62 "but they do not match"; |
| 63 static const char kUrlNotSupportedForWebApkMessage[] = | 63 static const char kUrlNotSupportedForWebApkMessage[] = |
| 64 "a URL in the web manifest contains a username, password, or port"; | 64 "a URL in the web manifest contains a username, password, or port"; |
| 65 static const char kInIncognitoMessage[] = | 65 static const char kInIncognitoMessage[] = |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 break; | 156 break; |
| 157 } | 157 } |
| 158 | 158 |
| 159 if (!pattern) | 159 if (!pattern) |
| 160 return; | 160 return; |
| 161 std::string message = param.empty() ? | 161 std::string message = param.empty() ? |
| 162 pattern : base::StringPrintf(pattern, param.c_str()); | 162 pattern : base::StringPrintf(pattern, param.c_str()); |
| 163 web_contents->GetMainFrame()->AddMessageToConsole( | 163 web_contents->GetMainFrame()->AddMessageToConsole( |
| 164 severity, GetMessagePrefix() + message); | 164 severity, GetMessagePrefix() + message); |
| 165 } | 165 } |
| OLD | NEW |