| 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 22 matching lines...) Expand all Loading... |
| 33 static const char kManifestEmptyMessage[] = | 33 static const char kManifestEmptyMessage[] = |
| 34 "the manifest could not be fetched, is empty, or could not be parsed"; | 34 "the manifest could not be fetched, is empty, or could not be parsed"; |
| 35 static const char kStartUrlNotValidMessage[] = | 35 static const char kStartUrlNotValidMessage[] = |
| 36 "the start URL in manifest is not valid"; | 36 "the start URL in manifest is not valid"; |
| 37 static const char kManifestMissingNameOrShortNameMessage[] = | 37 static const char kManifestMissingNameOrShortNameMessage[] = |
| 38 "one of manifest name or short name must be specified"; | 38 "one of manifest name or short name must be specified"; |
| 39 static const char kManifestDisplayNotSupportedMessage[] = | 39 static const char kManifestDisplayNotSupportedMessage[] = |
| 40 "the manifest display property must be set to 'standalone' or 'fullscreen'"; | 40 "the manifest display property must be set to 'standalone' or 'fullscreen'"; |
| 41 static const char kManifestMissingSuitableIconMessage[] = | 41 static const char kManifestMissingSuitableIconMessage[] = |
| 42 "the manifest does not contain a suitable icon - PNG format of at least " | 42 "the manifest does not contain a suitable icon - PNG format of at least " |
| 43 "%spx is required, and the sizes attribute must be set"; | 43 "%spx is required, the sizes attribute must be set, and the purpose " |
| 44 "attribute, if set, must include \"any\"."; |
| 44 static const char kNoMatchingServiceWorkerMessage[] = | 45 static const char kNoMatchingServiceWorkerMessage[] = |
| 45 "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 " |
| 46 "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 " |
| 47 "start URL from the manifest"; | 48 "start URL from the manifest"; |
| 48 static const char kNoAcceptableIconMessage[] = | 49 static const char kNoAcceptableIconMessage[] = |
| 49 "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 " |
| 50 "requirement"; | 51 "requirement"; |
| 51 static const char kCannotDownloadIconMessage[] = | 52 static const char kCannotDownloadIconMessage[] = |
| 52 "could not download the specified icon"; | 53 "could not download the specified icon"; |
| 53 static const char kNoIconAvailableMessage[] = | 54 static const char kNoIconAvailableMessage[] = |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 break; | 153 break; |
| 153 } | 154 } |
| 154 | 155 |
| 155 if (!pattern) | 156 if (!pattern) |
| 156 return; | 157 return; |
| 157 std::string message = param.empty() ? | 158 std::string message = param.empty() ? |
| 158 pattern : base::StringPrintf(pattern, param.c_str()); | 159 pattern : base::StringPrintf(pattern, param.c_str()); |
| 159 web_contents->GetMainFrame()->AddMessageToConsole( | 160 web_contents->GetMainFrame()->AddMessageToConsole( |
| 160 severity, GetMessagePrefix() + message); | 161 severity, GetMessagePrefix() + message); |
| 161 } | 162 } |
| OLD | NEW |