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 "chrome/browser/extensions/updater/extension_downloader.h" | 5 #include "chrome/browser/extensions/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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // scripts. | 190 // scripts. |
191 if (extension.converted_from_user_script() && | 191 if (extension.converted_from_user_script() && |
192 ManifestURL::GetUpdateURL(&extension).is_empty()) { | 192 ManifestURL::GetUpdateURL(&extension).is_empty()) { |
193 return false; | 193 return false; |
194 } | 194 } |
195 | 195 |
196 // If the extension updates itself from the gallery, ignore any update URL | 196 // If the extension updates itself from the gallery, ignore any update URL |
197 // data. At the moment there is no extra data that an extension can | 197 // data. At the moment there is no extra data that an extension can |
198 // communicate to the the gallery update servers. | 198 // communicate to the the gallery update servers. |
199 std::string update_url_data; | 199 std::string update_url_data; |
200 if (!extension.UpdatesFromGallery()) | 200 if (!ManifestURL::UpdatesFromGallery(&extension)) |
201 update_url_data = delegate_->GetUpdateUrlData(extension.id()); | 201 update_url_data = delegate_->GetUpdateUrlData(extension.id()); |
202 | 202 |
203 return AddExtensionData(extension.id(), *extension.version(), | 203 return AddExtensionData(extension.id(), *extension.version(), |
204 extension.GetType(), | 204 extension.GetType(), |
205 ManifestURL::GetUpdateURL(&extension), | 205 ManifestURL::GetUpdateURL(&extension), |
206 update_url_data, request_id); | 206 update_url_data, request_id); |
207 } | 207 } |
208 | 208 |
209 bool ExtensionDownloader::AddPendingExtension(const std::string& id, | 209 bool ExtensionDownloader::AddPendingExtension(const std::string& id, |
210 const GURL& update_url, | 210 const GURL& update_url, |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 void ExtensionDownloader::NotifyUpdateFound(const std::string& id, | 774 void ExtensionDownloader::NotifyUpdateFound(const std::string& id, |
775 const std::string& version) { | 775 const std::string& version) { |
776 UpdateDetails updateInfo(id, Version(version)); | 776 UpdateDetails updateInfo(id, Version(version)); |
777 content::NotificationService::current()->Notify( | 777 content::NotificationService::current()->Notify( |
778 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, | 778 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, |
779 content::NotificationService::AllBrowserContextsAndSources(), | 779 content::NotificationService::AllBrowserContextsAndSources(), |
780 content::Details<UpdateDetails>(&updateInfo)); | 780 content::Details<UpdateDetails>(&updateInfo)); |
781 } | 781 } |
782 | 782 |
783 } // namespace extensions | 783 } // namespace extensions |
OLD | NEW |