OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/install_tracker.h" |
| 6 |
| 7 namespace extensions { |
| 8 |
| 9 InstallTracker::InstallTracker() { |
| 10 } |
| 11 |
| 12 InstallTracker::~InstallTracker() { |
| 13 } |
| 14 |
| 15 void InstallTracker::AddObserver(InstallObserver* observer) { |
| 16 observers_.AddObserver(observer); |
| 17 } |
| 18 |
| 19 void InstallTracker::RemoveObserver(InstallObserver* observer) { |
| 20 observers_.RemoveObserver(observer); |
| 21 } |
| 22 |
| 23 void InstallTracker::OnBeginExtensionInstall( |
| 24 const std::string& extension_id, |
| 25 const std::string& extension_name, |
| 26 const gfx::ImageSkia& installing_icon, |
| 27 bool is_app) { |
| 28 FOR_EACH_OBSERVER(InstallObserver, observers_, |
| 29 OnBeginExtensionInstall(extension_id, |
| 30 extension_name, |
| 31 installing_icon, |
| 32 is_app)); |
| 33 } |
| 34 |
| 35 void InstallTracker::OnDownloadProgress(const std::string& extension_id, |
| 36 int percent_downloaded) { |
| 37 FOR_EACH_OBSERVER(InstallObserver, observers_, |
| 38 OnDownloadProgress(extension_id, percent_downloaded)); |
| 39 } |
| 40 |
| 41 void InstallTracker::OnInstallFailure( |
| 42 const std::string& extension_id) { |
| 43 FOR_EACH_OBSERVER(InstallObserver, observers_, |
| 44 OnInstallFailure(extension_id)); |
| 45 } |
| 46 |
| 47 } // namespace extensions |
OLD | NEW |