| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 if (!check_passed || IsComplete(params)) { | 366 if (!check_passed || IsComplete(params)) { |
| 367 RecordQueuedMetricsOnTaskCompletion(params, check_passed); | 367 RecordQueuedMetricsOnTaskCompletion(params, check_passed); |
| 368 RunCallback(task, code); | 368 RunCallback(task, code); |
| 369 tasks_.erase(tasks_.begin()); | 369 tasks_.erase(tasks_.begin()); |
| 370 StartNextTask(); | 370 StartNextTask(); |
| 371 return; | 371 return; |
| 372 } | 372 } |
| 373 | 373 |
| 374 if (!manifest_->fetched) { | 374 if (!manifest_->fetched) { |
| 375 FetchManifest(); | 375 FetchManifest(); |
| 376 } else if (params.check_installable && !installable_->fetched) { | |
| 377 CheckInstallable(); | |
| 378 } else if (params.fetch_valid_primary_icon && | 376 } else if (params.fetch_valid_primary_icon && |
| 379 !IsIconFetched(ParamsForPrimaryIcon(params))) { | 377 !IsIconFetched(ParamsForPrimaryIcon(params))) { |
| 380 CheckAndFetchBestIcon(ParamsForPrimaryIcon(params)); | 378 CheckAndFetchBestIcon(ParamsForPrimaryIcon(params)); |
| 379 } else if (params.check_installable && !installable_->fetched) { |
| 380 CheckInstallable(); |
| 381 } else if (params.fetch_valid_badge_icon && | 381 } else if (params.fetch_valid_badge_icon && |
| 382 !IsIconFetched(ParamsForBadgeIcon(params))) { | 382 !IsIconFetched(ParamsForBadgeIcon(params))) { |
| 383 CheckAndFetchBestIcon(ParamsForBadgeIcon(params)); | 383 CheckAndFetchBestIcon(ParamsForBadgeIcon(params)); |
| 384 } else { | 384 } else { |
| 385 NOTREACHED(); | 385 NOTREACHED(); |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 | 388 |
| 389 void InstallableManager::FetchManifest() { | 389 void InstallableManager::FetchManifest() { |
| 390 DCHECK(!manifest_->fetched); | 390 DCHECK(!manifest_->fetched); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 return manifest_->url; | 571 return manifest_->url; |
| 572 } | 572 } |
| 573 | 573 |
| 574 const content::Manifest& InstallableManager::manifest() const { | 574 const content::Manifest& InstallableManager::manifest() const { |
| 575 return manifest_->manifest; | 575 return manifest_->manifest; |
| 576 } | 576 } |
| 577 | 577 |
| 578 bool InstallableManager::is_installable() const { | 578 bool InstallableManager::is_installable() const { |
| 579 return installable_->installable; | 579 return installable_->installable; |
| 580 } | 580 } |
| OLD | NEW |