Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: chrome/browser/installable/installable_manager.cc

Issue 2791923005: Fails InstallableManager if a selected badge icon cannot be fetched. (Closed)
Patch Set: Addressing comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_manager.h" 5 #include "chrome/browser/installable/installable_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/manifest/manifest_icon_downloader.h" 10 #include "chrome/browser/manifest/manifest_icon_downloader.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 if (params.check_installable && installable_->error != NO_ERROR_DETECTED) 224 if (params.check_installable && installable_->error != NO_ERROR_DETECTED)
225 return installable_->error; 225 return installable_->error;
226 226
227 if (params.fetch_valid_primary_icon) { 227 if (params.fetch_valid_primary_icon) {
228 IconProperty& icon = icons_[ParamsForPrimaryIcon(params)]; 228 IconProperty& icon = icons_[ParamsForPrimaryIcon(params)];
229 if (icon.error != NO_ERROR_DETECTED) 229 if (icon.error != NO_ERROR_DETECTED)
230 return icon.error; 230 return icon.error;
231 } 231 }
232 232
233 // Do not report badge icon's error because badge icon is optional. 233 if (params.fetch_valid_badge_icon) {
234 IconProperty& icon = icons_[ParamsForBadgeIcon(params)];
235
236 // If the error is NO_ACCEPTABLE_ICON, there is no icon suitable as a badge
237 // in the manifest. Ignore this case since we only want to fail the check if
238 // there was a suitable badge icon specified and we couldn't fetch it.
239 if (icon.error != NO_ERROR_DETECTED && icon.error != NO_ACCEPTABLE_ICON)
240 return icon.error;
241 }
242
234 return NO_ERROR_DETECTED; 243 return NO_ERROR_DETECTED;
235 } 244 }
236 245
237 InstallableStatusCode InstallableManager::manifest_error() const { 246 InstallableStatusCode InstallableManager::manifest_error() const {
238 return manifest_->error; 247 return manifest_->error;
239 } 248 }
240 249
241 InstallableStatusCode InstallableManager::installable_error() const { 250 InstallableStatusCode InstallableManager::installable_error() const {
242 return installable_->error; 251 return installable_->error;
243 } 252 }
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 return manifest_->url; 580 return manifest_->url;
572 } 581 }
573 582
574 const content::Manifest& InstallableManager::manifest() const { 583 const content::Manifest& InstallableManager::manifest() const {
575 return manifest_->manifest; 584 return manifest_->manifest;
576 } 585 }
577 586
578 bool InstallableManager::is_installable() const { 587 bool InstallableManager::is_installable() const {
579 return installable_->installable; 588 return installable_->installable;
580 } 589 }
OLDNEW
« no previous file with comments | « chrome/browser/installable/installable_logging.cc ('k') | chrome/browser/installable/installable_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698