OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 152 } |
153 | 153 |
154 } // namespace | 154 } // namespace |
155 | 155 |
156 ManifestFetchesBuilder::ManifestFetchesBuilder( | 156 ManifestFetchesBuilder::ManifestFetchesBuilder( |
157 ExtensionUpdateService* service) : service_(service) { | 157 ExtensionUpdateService* service) : service_(service) { |
158 DCHECK(service_); | 158 DCHECK(service_); |
159 } | 159 } |
160 | 160 |
161 void ManifestFetchesBuilder::AddExtension(const Extension& extension) { | 161 void ManifestFetchesBuilder::AddExtension(const Extension& extension) { |
| 162 // Skip extensions with empty update URLs converted from user |
| 163 // scripts. |
| 164 if (extension.converted_from_user_script() && |
| 165 extension.update_url().is_empty()) { |
| 166 return; |
| 167 } |
| 168 |
162 AddExtensionData(extension.location(), | 169 AddExtensionData(extension.location(), |
163 extension.id(), | 170 extension.id(), |
164 *extension.version(), | 171 *extension.version(), |
165 extension.is_theme(), | 172 extension.is_theme(), |
166 extension.update_url()); | 173 extension.update_url()); |
167 } | 174 } |
168 | 175 |
169 void ManifestFetchesBuilder::AddPendingExtension( | 176 void ManifestFetchesBuilder::AddPendingExtension( |
170 const std::string& id, | 177 const std::string& id, |
171 const PendingExtensionInfo& info) { | 178 const PendingExtensionInfo& info) { |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 extension_fetcher_.reset( | 842 extension_fetcher_.reset( |
836 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); | 843 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); |
837 extension_fetcher_->set_request_context( | 844 extension_fetcher_->set_request_context( |
838 Profile::GetDefaultRequestContext()); | 845 Profile::GetDefaultRequestContext()); |
839 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | | 846 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | |
840 net::LOAD_DO_NOT_SAVE_COOKIES); | 847 net::LOAD_DO_NOT_SAVE_COOKIES); |
841 extension_fetcher_->Start(); | 848 extension_fetcher_->Start(); |
842 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); | 849 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); |
843 } | 850 } |
844 } | 851 } |
OLD | NEW |