Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Side by Side Diff: chrome/browser/extensions/updater/extension_updater.cc

Issue 14238037: Made it possible to tell whether an extension is being installed or updated. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added extra check. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 request.in_progress_ids_.remove(crx_file.extension_id); 658 request.in_progress_ids_.remove(crx_file.extension_id);
659 NotifyIfFinished(*it); 659 NotifyIfFinished(*it);
660 } 660 }
661 661
662 // If any files are available to update, start one. 662 // If any files are available to update, start one.
663 MaybeInstallCRXFile(); 663 MaybeInstallCRXFile();
664 break; 664 break;
665 } 665 }
666 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { 666 case chrome::NOTIFICATION_EXTENSION_INSTALLED: {
667 const Extension* extension = 667 const Extension* extension =
668 content::Details<const Extension>(details).ptr(); 668 content::Details<const InstalledExtensionInfo>(details)->extension;
669 if (extension) 669 if (extension)
670 throttle_info_.erase(extension->id()); 670 throttle_info_.erase(extension->id());
671 break; 671 break;
672 } 672 }
673 default: 673 default:
674 NOTREACHED(); 674 NOTREACHED();
675 } 675 }
676 } 676 }
677 677
678 void ExtensionUpdater::NotifyStarted() { 678 void ExtensionUpdater::NotifyStarted() {
679 content::NotificationService::current()->Notify( 679 content::NotificationService::current()->Notify(
680 chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED, 680 chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED,
681 content::Source<Profile>(profile_), 681 content::Source<Profile>(profile_),
682 content::NotificationService::NoDetails()); 682 content::NotificationService::NoDetails());
683 } 683 }
684 684
685 void ExtensionUpdater::NotifyIfFinished(int request_id) { 685 void ExtensionUpdater::NotifyIfFinished(int request_id) {
686 DCHECK(ContainsKey(requests_in_progress_, request_id)); 686 DCHECK(ContainsKey(requests_in_progress_, request_id));
687 const InProgressCheck& request = requests_in_progress_[request_id]; 687 const InProgressCheck& request = requests_in_progress_[request_id];
688 if (request.in_progress_ids_.empty()) { 688 if (request.in_progress_ids_.empty()) {
689 VLOG(2) << "Finished update check " << request_id; 689 VLOG(2) << "Finished update check " << request_id;
690 if (!request.callback.is_null()) 690 if (!request.callback.is_null())
691 request.callback.Run(); 691 request.callback.Run();
692 requests_in_progress_.erase(request_id); 692 requests_in_progress_.erase(request_id);
693 } 693 }
694 } 694 }
695 695
696 } // namespace extensions 696 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/state_store.cc ('k') | chrome/browser/extensions/webstore_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698