| 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_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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 InstallableStatusCode code = GetErrorCode(params); | 294 InstallableStatusCode code = GetErrorCode(params); |
| 295 if (code != NO_ERROR_DETECTED || IsComplete(params)) { | 295 if (code != NO_ERROR_DETECTED || IsComplete(params)) { |
| 296 RunCallback(task, code); | 296 RunCallback(task, code); |
| 297 tasks_.erase(tasks_.begin()); | 297 tasks_.erase(tasks_.begin()); |
| 298 StartNextTask(); | 298 StartNextTask(); |
| 299 return; | 299 return; |
| 300 } | 300 } |
| 301 | 301 |
| 302 if (!manifest_->fetched) { | 302 if (!manifest_->fetched) { |
| 303 FetchManifest(); | 303 FetchManifest(); |
| 304 } else if (params.check_installable && !installable_->fetched) { | |
| 305 CheckInstallable(); | |
| 306 } else if (params.fetch_valid_primary_icon && | 304 } else if (params.fetch_valid_primary_icon && |
| 307 !IsIconFetched(ParamsForPrimaryIcon(params))) { | 305 !IsIconFetched(ParamsForPrimaryIcon(params))) { |
| 308 CheckAndFetchBestIcon(ParamsForPrimaryIcon(params)); | 306 CheckAndFetchBestIcon(ParamsForPrimaryIcon(params)); |
| 307 } else if (params.check_installable && !installable_->fetched) { |
| 308 CheckInstallable(); |
| 309 } else if (params.fetch_valid_badge_icon && | 309 } else if (params.fetch_valid_badge_icon && |
| 310 !IsIconFetched(ParamsForBadgeIcon(params))) { | 310 !IsIconFetched(ParamsForBadgeIcon(params))) { |
| 311 CheckAndFetchBestIcon(ParamsForBadgeIcon(params)); | 311 CheckAndFetchBestIcon(ParamsForBadgeIcon(params)); |
| 312 } else { | 312 } else { |
| 313 NOTREACHED(); | 313 NOTREACHED(); |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 | 316 |
| 317 void InstallableManager::FetchManifest() { | 317 void InstallableManager::FetchManifest() { |
| 318 DCHECK(!manifest_->fetched); | 318 DCHECK(!manifest_->fetched); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 return manifest_->url; | 499 return manifest_->url; |
| 500 } | 500 } |
| 501 | 501 |
| 502 const content::Manifest& InstallableManager::manifest() const { | 502 const content::Manifest& InstallableManager::manifest() const { |
| 503 return manifest_->manifest; | 503 return manifest_->manifest; |
| 504 } | 504 } |
| 505 | 505 |
| 506 bool InstallableManager::is_installable() const { | 506 bool InstallableManager::is_installable() const { |
| 507 return installable_->installable; | 507 return installable_->installable; |
| 508 } | 508 } |
| OLD | NEW |