| 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 } | 648 } |
| 649 | 649 |
| 650 // If any files are available to update, start one. | 650 // If any files are available to update, start one. |
| 651 MaybeInstallCRXFile(); | 651 MaybeInstallCRXFile(); |
| 652 } | 652 } |
| 653 | 653 |
| 654 void ExtensionUpdater::OnExtensionWillBeInstalled( | 654 void ExtensionUpdater::OnExtensionWillBeInstalled( |
| 655 content::BrowserContext* browser_context, | 655 content::BrowserContext* browser_context, |
| 656 const Extension* extension, | 656 const Extension* extension, |
| 657 bool is_update, | 657 bool is_update, |
| 658 bool from_ephemeral, | |
| 659 const std::string& old_name) { | 658 const std::string& old_name) { |
| 660 throttle_info_.erase(extension->id()); | 659 throttle_info_.erase(extension->id()); |
| 661 } | 660 } |
| 662 | 661 |
| 663 void ExtensionUpdater::NotifyStarted() { | 662 void ExtensionUpdater::NotifyStarted() { |
| 664 content::NotificationService::current()->Notify( | 663 content::NotificationService::current()->Notify( |
| 665 extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED, | 664 extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED, |
| 666 content::Source<Profile>(profile_), | 665 content::Source<Profile>(profile_), |
| 667 content::NotificationService::NoDetails()); | 666 content::NotificationService::NoDetails()); |
| 668 } | 667 } |
| 669 | 668 |
| 670 void ExtensionUpdater::NotifyIfFinished(int request_id) { | 669 void ExtensionUpdater::NotifyIfFinished(int request_id) { |
| 671 DCHECK(ContainsKey(requests_in_progress_, request_id)); | 670 DCHECK(ContainsKey(requests_in_progress_, request_id)); |
| 672 const InProgressCheck& request = requests_in_progress_[request_id]; | 671 const InProgressCheck& request = requests_in_progress_[request_id]; |
| 673 if (request.in_progress_ids_.empty()) { | 672 if (request.in_progress_ids_.empty()) { |
| 674 VLOG(2) << "Finished update check " << request_id; | 673 VLOG(2) << "Finished update check " << request_id; |
| 675 if (!request.callback.is_null()) | 674 if (!request.callback.is_null()) |
| 676 request.callback.Run(); | 675 request.callback.Run(); |
| 677 requests_in_progress_.erase(request_id); | 676 requests_in_progress_.erase(request_id); |
| 678 } | 677 } |
| 679 } | 678 } |
| 680 | 679 |
| 681 } // namespace extensions | 680 } // namespace extensions |
| OLD | NEW |