| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 15 #include "base/rand_util.h" | 15 #include "base/rand_util.h" |
| 16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
| 19 #include "chrome/browser/extensions/api/module/module.h" |
| 19 #include "chrome/browser/extensions/blacklist.h" | 20 #include "chrome/browser/extensions/blacklist.h" |
| 20 #include "chrome/browser/extensions/crx_installer.h" | 21 #include "chrome/browser/extensions/crx_installer.h" |
| 21 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
| 22 #include "chrome/browser/extensions/pending_extension_manager.h" | 23 #include "chrome/browser/extensions/pending_extension_manager.h" |
| 23 #include "chrome/browser/extensions/updater/extension_downloader.h" | 24 #include "chrome/browser/extensions/updater/extension_downloader.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/common/chrome_notification_types.h" | 26 #include "chrome/common/chrome_notification_types.h" |
| 26 #include "chrome/common/extensions/extension.h" | 27 #include "chrome/common/extensions/extension.h" |
| 27 #include "chrome/common/extensions/extension_set.h" | 28 #include "chrome/common/extensions/extension_set.h" |
| 28 #include "chrome/common/extensions/manifest.h" | 29 #include "chrome/common/extensions/manifest.h" |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 extension_prefs_->LastPingDay(id)); | 538 extension_prefs_->LastPingDay(id)); |
| 538 ping_data->is_enabled = service_->IsExtensionEnabled(id); | 539 ping_data->is_enabled = service_->IsExtensionEnabled(id); |
| 539 ping_data->active_days = | 540 ping_data->active_days = |
| 540 CalculateActivePingDays(extension_prefs_->LastActivePingDay(id), | 541 CalculateActivePingDays(extension_prefs_->LastActivePingDay(id), |
| 541 extension_prefs_->GetActiveBit(id)); | 542 extension_prefs_->GetActiveBit(id)); |
| 542 return true; | 543 return true; |
| 543 } | 544 } |
| 544 | 545 |
| 545 std::string ExtensionUpdater::GetUpdateUrlData(const std::string& id) { | 546 std::string ExtensionUpdater::GetUpdateUrlData(const std::string& id) { |
| 546 DCHECK(alive_); | 547 DCHECK(alive_); |
| 547 return extension_prefs_->GetUpdateUrlData(id); | 548 return extension::GetUpdateURLData(extension_prefs_, id); |
| 548 } | 549 } |
| 549 | 550 |
| 550 bool ExtensionUpdater::IsExtensionPending(const std::string& id) { | 551 bool ExtensionUpdater::IsExtensionPending(const std::string& id) { |
| 551 DCHECK(alive_); | 552 DCHECK(alive_); |
| 552 return service_->pending_extension_manager()->IsIdPending(id); | 553 return service_->pending_extension_manager()->IsIdPending(id); |
| 553 } | 554 } |
| 554 | 555 |
| 555 bool ExtensionUpdater::GetExtensionExistingVersion(const std::string& id, | 556 bool ExtensionUpdater::GetExtensionExistingVersion(const std::string& id, |
| 556 std::string* version) { | 557 std::string* version) { |
| 557 DCHECK(alive_); | 558 DCHECK(alive_); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 const InProgressCheck& request = requests_in_progress_[request_id]; | 688 const InProgressCheck& request = requests_in_progress_[request_id]; |
| 688 if (request.in_progress_ids_.empty()) { | 689 if (request.in_progress_ids_.empty()) { |
| 689 VLOG(2) << "Finished update check " << request_id; | 690 VLOG(2) << "Finished update check " << request_id; |
| 690 if (!request.callback.is_null()) | 691 if (!request.callback.is_null()) |
| 691 request.callback.Run(); | 692 request.callback.Run(); |
| 692 requests_in_progress_.erase(request_id); | 693 requests_in_progress_.erase(request_id); |
| 693 } | 694 } |
| 694 } | 695 } |
| 695 | 696 |
| 696 } // namespace extensions | 697 } // namespace extensions |
| OLD | NEW |