| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/install_tracker.h" | 5 #include "chrome/browser/extensions/install_tracker.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void InstallTracker::RemoveObserver(InstallObserver* observer) { | 46 void InstallTracker::RemoveObserver(InstallObserver* observer) { |
| 47 observers_.RemoveObserver(observer); | 47 observers_.RemoveObserver(observer); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void InstallTracker::OnBeginExtensionInstall( | 50 void InstallTracker::OnBeginExtensionInstall( |
| 51 const InstallObserver::ExtensionInstallParams& params) { | 51 const InstallObserver::ExtensionInstallParams& params) { |
| 52 FOR_EACH_OBSERVER(InstallObserver, observers_, | 52 FOR_EACH_OBSERVER(InstallObserver, observers_, |
| 53 OnBeginExtensionInstall(params)); | 53 OnBeginExtensionInstall(params)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void InstallTracker::OnBeginExtensionDownload(const std::string& extension_id) { |
| 57 FOR_EACH_OBSERVER( |
| 58 InstallObserver, observers_, OnBeginExtensionDownload(extension_id)); |
| 59 } |
| 60 |
| 56 void InstallTracker::OnDownloadProgress(const std::string& extension_id, | 61 void InstallTracker::OnDownloadProgress(const std::string& extension_id, |
| 57 int percent_downloaded) { | 62 int percent_downloaded) { |
| 58 FOR_EACH_OBSERVER(InstallObserver, observers_, | 63 FOR_EACH_OBSERVER(InstallObserver, observers_, |
| 59 OnDownloadProgress(extension_id, percent_downloaded)); | 64 OnDownloadProgress(extension_id, percent_downloaded)); |
| 60 } | 65 } |
| 61 | 66 |
| 67 void InstallTracker::OnBeginCrxInstall(const std::string& extension_id) { |
| 68 FOR_EACH_OBSERVER( |
| 69 InstallObserver, observers_, OnBeginCrxInstall(extension_id)); |
| 70 } |
| 71 |
| 62 void InstallTracker::OnInstallFailure( | 72 void InstallTracker::OnInstallFailure( |
| 63 const std::string& extension_id) { | 73 const std::string& extension_id) { |
| 64 FOR_EACH_OBSERVER(InstallObserver, observers_, | 74 FOR_EACH_OBSERVER(InstallObserver, observers_, |
| 65 OnInstallFailure(extension_id)); | 75 OnInstallFailure(extension_id)); |
| 66 } | 76 } |
| 67 | 77 |
| 68 void InstallTracker::Shutdown() { | 78 void InstallTracker::Shutdown() { |
| 69 FOR_EACH_OBSERVER(InstallObserver, observers_, OnShutdown()); | 79 FOR_EACH_OBSERVER(InstallObserver, observers_, OnShutdown()); |
| 70 } | 80 } |
| 71 | 81 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 default: | 128 default: |
| 119 NOTREACHED(); | 129 NOTREACHED(); |
| 120 } | 130 } |
| 121 } | 131 } |
| 122 | 132 |
| 123 void InstallTracker::OnAppsReordered() { | 133 void InstallTracker::OnAppsReordered() { |
| 124 FOR_EACH_OBSERVER(InstallObserver, observers_, OnAppsReordered()); | 134 FOR_EACH_OBSERVER(InstallObserver, observers_, OnAppsReordered()); |
| 125 } | 135 } |
| 126 | 136 |
| 127 } // namespace extensions | 137 } // namespace extensions |
| OLD | NEW |