OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions/extension_updater.h" | 5 #include "chrome/browser/extensions/extension_updater.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 | 785 |
786 continue; | 786 continue; |
787 } | 787 } |
788 } | 788 } |
789 result.push_back(i); | 789 result.push_back(i); |
790 } | 790 } |
791 return result; | 791 return result; |
792 } | 792 } |
793 | 793 |
794 void ExtensionUpdater::StartUpdateCheck(ManifestFetchData* fetch_data) { | 794 void ExtensionUpdater::StartUpdateCheck(ManifestFetchData* fetch_data) { |
| 795 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 796 switches::kDisableBackgroundNetworking)) |
| 797 return; |
| 798 |
795 std::deque<ManifestFetchData*>::const_iterator i; | 799 std::deque<ManifestFetchData*>::const_iterator i; |
796 for (i = manifests_pending_.begin(); i != manifests_pending_.end(); i++) { | 800 for (i = manifests_pending_.begin(); i != manifests_pending_.end(); i++) { |
797 if (fetch_data->full_url() == (*i)->full_url()) { | 801 if (fetch_data->full_url() == (*i)->full_url()) { |
798 // This url is already scheduled to be fetched. | 802 // This url is already scheduled to be fetched. |
799 delete fetch_data; | 803 delete fetch_data; |
800 return; | 804 return; |
801 } | 805 } |
802 } | 806 } |
803 | 807 |
804 if (manifest_fetcher_.get() != NULL) { | 808 if (manifest_fetcher_.get() != NULL) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 extension_fetcher_.reset( | 844 extension_fetcher_.reset( |
841 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); | 845 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); |
842 extension_fetcher_->set_request_context( | 846 extension_fetcher_->set_request_context( |
843 Profile::GetDefaultRequestContext()); | 847 Profile::GetDefaultRequestContext()); |
844 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | | 848 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | |
845 net::LOAD_DO_NOT_SAVE_COOKIES); | 849 net::LOAD_DO_NOT_SAVE_COOKIES); |
846 extension_fetcher_->Start(); | 850 extension_fetcher_->Start(); |
847 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); | 851 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); |
848 } | 852 } |
849 } | 853 } |
OLD | NEW |