OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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(Profile* profile) |
| 10 : profile_(profile) { |
| 11 } |
| 12 |
| 13 InstallTracker::~InstallTracker() { |
| 14 } |
| 15 |
| 16 void InstallTracker::OnBeginExtensionInstall( |
| 17 const std::string& extension_id, |
| 18 const std::string& extension_name, |
| 19 const gfx::ImageSkia& installing_icon, |
| 20 bool is_app) { |
| 21 FOR_EACH_OBSERVER(InstallObserver, observers_, |
| 22 OnBeginExtensionInstall(extension_id, |
| 23 extension_name, |
| 24 installing_icon, |
| 25 is_app)); |
| 26 } |
| 27 |
| 28 void InstallTracker::OnDownloadProgress(const std::string& extension_id, |
| 29 int percent_downloaded) { |
| 30 FOR_EACH_OBSERVER(InstallObserver, observers_, |
| 31 OnDownloadProgress(extension_id, percent_downloaded)); |
| 32 } |
| 33 |
| 34 void InstallTracker::OnInstallFailure( |
| 35 const std::string& extension_id) { |
| 36 FOR_EACH_OBSERVER(InstallObserver, observers_, |
| 37 OnInstallFailure(extension_id)); |
| 38 } |
| 39 |
| 40 void InstallTracker::AddObserver(InstallObserver* observer) { |
| 41 observers_.AddObserver(observer); |
| 42 } |
| 43 |
| 44 void InstallTracker::RemoveObserver(InstallObserver* observer) { |
| 45 observers_.RemoveObserver(observer); |
| 46 } |
| 47 |
| 48 } // namespace extensions |
OLD | NEW |