Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
|
tfarina
2013/02/25 19:43:18
no (c)
koz (OOO until 15th September)
2013/02/25 23:35:19
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_ | |
| 7 | |
| 8 #include "base/observer_list.h" | |
| 9 #include "chrome/browser/profiles/profile_keyed_service.h" | |
| 10 #include "ui/gfx/image/image_skia.h" | |
|
tfarina
2013/02/25 19:43:18
forward declare this.
koz (OOO until 15th September)
2013/02/25 23:35:19
Done.
| |
| 11 | |
| 12 namespace extensions { | |
| 13 | |
| 14 class InstallObserver { | |
|
tfarina
2013/02/25 19:43:18
please, put this into c/b/e/install_observer.h
koz (OOO until 15th September)
2013/02/25 23:35:19
Done.
| |
| 15 public: | |
| 16 virtual void OnBeginExtensionInstall( | |
| 17 const std::string& extension_id, | |
| 18 const std::string& extension_name, | |
| 19 const gfx::ImageSkia& installing_icon, | |
| 20 bool is_app) = 0; | |
| 21 | |
| 22 virtual void OnDownloadProgress(const std::string& extension_id, | |
| 23 int percent_downloaded) = 0; | |
| 24 | |
| 25 virtual void OnInstallFailure(const std::string& extension_id) = 0; | |
| 26 | |
| 27 protected: | |
| 28 virtual ~InstallObserver() {} | |
| 29 }; | |
| 30 | |
| 31 class InstallTracker : public ProfileKeyedService { | |
| 32 public: | |
| 33 explicit InstallTracker(); | |
|
tfarina
2013/02/25 19:43:18
no explicit
koz (OOO until 15th September)
2013/02/25 23:35:19
Done.
| |
| 34 virtual ~InstallTracker(); | |
| 35 | |
| 36 // ProfileKeyedService implementation. | |
|
tfarina
2013/02/25 19:43:18
I don't think this is an implementation of Profile
koz (OOO until 15th September)
2013/02/25 23:35:19
Done.
| |
| 37 void AddObserver(InstallObserver* observer); | |
| 38 void RemoveObserver(InstallObserver* observer); | |
| 39 | |
| 40 void OnBeginExtensionInstall( | |
|
tfarina
2013/02/25 19:43:18
why these three methods have the same names of Ins
koz (OOO until 15th September)
2013/02/25 23:35:19
This class acts as a broadcaster - it gets notifie
| |
| 41 const std::string& extension_id, | |
| 42 const std::string& extension_name, | |
| 43 const gfx::ImageSkia& installing_icon, | |
| 44 bool is_app); | |
| 45 void OnDownloadProgress(const std::string& extension_id, | |
| 46 int percent_downloaded); | |
|
tfarina
2013/02/25 19:43:18
wrong indent
koz (OOO until 15th September)
2013/02/25 23:35:19
Done.
| |
| 47 void OnInstallFailure(const std::string& extension_id); | |
| 48 | |
| 49 private: | |
| 50 ObserverList<InstallObserver> observers_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(InstallTracker); | |
| 53 }; | |
| 54 | |
| 55 } // namespace extensions | |
| 56 | |
| 57 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_ | |
| OLD | NEW |