| Index: chrome/browser/installable/installable_manager.cc
|
| diff --git a/chrome/browser/installable/installable_manager.cc b/chrome/browser/installable/installable_manager.cc
|
| index 1e0618691ead5ef36d216bf862cac37da25ea6c5..95bffb9c9d4b8cc4be7a57de0efeb93cba78a29f 100644
|
| --- a/chrome/browser/installable/installable_manager.cc
|
| +++ b/chrome/browser/installable/installable_manager.cc
|
| @@ -4,7 +4,10 @@
|
|
|
| #include "chrome/browser/installable/installable_manager.h"
|
|
|
| +#include <algorithm>
|
| +
|
| #include "base/bind.h"
|
| +#include "base/stl_util.h"
|
| #include "base/strings/string_util.h"
|
| #include "chrome/browser/manifest/manifest_icon_downloader.h"
|
| #include "chrome/browser/manifest/manifest_icon_selector.h"
|
| @@ -19,6 +22,8 @@
|
| #include "net/base/url_util.h"
|
| #include "third_party/WebKit/public/platform/WebDisplayMode.h"
|
|
|
| +using IconPurpose = content::Manifest::Icon::IconPurpose;
|
| +
|
| namespace {
|
|
|
| const char kPngExtension[] = ".png";
|
| @@ -30,7 +35,8 @@ const char kPngExtension[] = ".png";
|
| // TODO(dominickn): consolidate with minimum_icon_size_in_px across platforms.
|
| const int kIconMinimumSizeInPx = 144;
|
|
|
| -// Returns true if |manifest| specifies a PNG icon >= 144x144px (or size "any").
|
| +// Returns true if |manifest| specifies a PNG icon >= 144x144px (or size "any"),
|
| +// and of icon purpose IconPurpose::ANY.
|
| bool DoesManifestContainRequiredIcon(const content::Manifest& manifest) {
|
| for (const auto& icon : manifest.icons) {
|
| // The type field is optional. If it isn't present, fall back on checking
|
| @@ -41,6 +47,9 @@ bool DoesManifestContainRequiredIcon(const content::Manifest& manifest) {
|
| base::CompareCase::INSENSITIVE_ASCII)))
|
| continue;
|
|
|
| + if (!base::ContainsValue(icon.purpose, IconPurpose::ANY))
|
| + continue;
|
| +
|
| for (const auto& size : icon.sizes) {
|
| if (size.IsEmpty()) // "any"
|
| return true;
|
|
|