OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "extensions/browser/updater/extension_downloader.h" | 5 #include "extensions/browser/updater/extension_downloader.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 } | 433 } |
434 | 434 |
435 void ExtensionDownloader::StartUpdateCheck( | 435 void ExtensionDownloader::StartUpdateCheck( |
436 scoped_ptr<ManifestFetchData> fetch_data) { | 436 scoped_ptr<ManifestFetchData> fetch_data) { |
437 const std::set<std::string>& id_set(fetch_data->extension_ids()); | 437 const std::set<std::string>& id_set(fetch_data->extension_ids()); |
438 | 438 |
439 if (!ExtensionsBrowserClient::Get()->IsBackgroundUpdateAllowed()) { | 439 if (!ExtensionsBrowserClient::Get()->IsBackgroundUpdateAllowed()) { |
440 NotifyExtensionsDownloadFailed(id_set, | 440 NotifyExtensionsDownloadFailed(id_set, |
441 fetch_data->request_ids(), | 441 fetch_data->request_ids(), |
442 ExtensionDownloaderDelegate::DISABLED); | 442 ExtensionDownloaderDelegate::DISABLED); |
| 443 return; |
443 } | 444 } |
444 | 445 |
445 RequestQueue<ManifestFetchData>::iterator i; | 446 RequestQueue<ManifestFetchData>::iterator i; |
446 for (i = manifests_queue_.begin(); i != manifests_queue_.end(); ++i) { | 447 for (i = manifests_queue_.begin(); i != manifests_queue_.end(); ++i) { |
447 if (fetch_data->full_url() == i->full_url()) { | 448 if (fetch_data->full_url() == i->full_url()) { |
448 // This url is already scheduled to be fetched. | 449 // This url is already scheduled to be fetched. |
449 i->Merge(*fetch_data); | 450 i->Merge(*fetch_data); |
450 return; | 451 return; |
451 } | 452 } |
452 } | 453 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 const GURL& update_url, | 969 const GURL& update_url, |
969 int request_id) { | 970 int request_id) { |
970 ManifestFetchData::PingMode ping_mode = ManifestFetchData::NO_PING; | 971 ManifestFetchData::PingMode ping_mode = ManifestFetchData::NO_PING; |
971 if (update_url.DomainIs(ping_enabled_domain_.c_str())) | 972 if (update_url.DomainIs(ping_enabled_domain_.c_str())) |
972 ping_mode = ManifestFetchData::PING_WITH_ENABLED_STATE; | 973 ping_mode = ManifestFetchData::PING_WITH_ENABLED_STATE; |
973 return new ManifestFetchData( | 974 return new ManifestFetchData( |
974 update_url, request_id, brand_code_, manifest_query_params_, ping_mode); | 975 update_url, request_id, brand_code_, manifest_query_params_, ping_mode); |
975 } | 976 } |
976 | 977 |
977 } // namespace extensions | 978 } // namespace extensions |
OLD | NEW |