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_updater.h" | 5 #include "chrome/browser/extensions/updater/extension_updater.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 } | 257 } |
258 | 258 |
259 void ExtensionUpdater::DoCheckSoon() { | 259 void ExtensionUpdater::DoCheckSoon() { |
260 DCHECK(will_check_soon_); | 260 DCHECK(will_check_soon_); |
261 CheckNow(); | 261 CheckNow(); |
262 will_check_soon_ = false; | 262 will_check_soon_ = false; |
263 } | 263 } |
264 | 264 |
265 void ExtensionUpdater::AddToDownloader(const ExtensionSet* extensions, | 265 void ExtensionUpdater::AddToDownloader(const ExtensionSet* extensions, |
266 const std::list<std::string>& pending_ids) { | 266 const std::list<std::string>& pending_ids) { |
| 267 if (!extensions) |
| 268 return; |
267 for (ExtensionSet::const_iterator extension_iter = extensions->begin(); | 269 for (ExtensionSet::const_iterator extension_iter = extensions->begin(); |
268 extension_iter != extensions->end(); ++extension_iter) { | 270 extension_iter != extensions->end(); ++extension_iter) { |
269 const Extension& extension = **extension_iter; | 271 const Extension& extension = **extension_iter; |
270 if (!Extension::IsAutoUpdateableLocation(extension.location())) { | 272 if (!Extension::IsAutoUpdateableLocation(extension.location())) { |
271 VLOG(2) << "Extension " << extension.id() << " is not auto updateable"; | 273 VLOG(2) << "Extension " << extension.id() << " is not auto updateable"; |
272 continue; | 274 continue; |
273 } | 275 } |
274 // An extension might be overwritten by policy, and have its update url | 276 // An extension might be overwritten by policy, and have its update url |
275 // changed. Make sure existing extensions aren't fetched again, if a | 277 // changed. Make sure existing extensions aren't fetched again, if a |
276 // pending fetch for an extension with the same id already exists. | 278 // pending fetch for an extension with the same id already exists. |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 if (in_progress_ids_.empty()) { | 501 if (in_progress_ids_.empty()) { |
500 VLOG(1) << "Sending EXTENSION_UPDATING_FINISHED"; | 502 VLOG(1) << "Sending EXTENSION_UPDATING_FINISHED"; |
501 content::NotificationService::current()->Notify( | 503 content::NotificationService::current()->Notify( |
502 chrome::NOTIFICATION_EXTENSION_UPDATING_FINISHED, | 504 chrome::NOTIFICATION_EXTENSION_UPDATING_FINISHED, |
503 content::Source<Profile>(profile_), | 505 content::Source<Profile>(profile_), |
504 content::NotificationService::NoDetails()); | 506 content::NotificationService::NoDetails()); |
505 } | 507 } |
506 } | 508 } |
507 | 509 |
508 } // namespace extensions | 510 } // namespace extensions |
OLD | NEW |