Chromium Code Reviews| 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 #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" | |
| 11 | |
| 12 class Profile; | |
| 13 | |
| 14 namespace extensions { | |
| 15 | |
| 16 class InstallObserver { | |
| 17 public: | |
| 18 virtual void OnBeginExtensionInstall( | |
| 19 const std::string& extension_id, | |
| 20 const std::string& extension_name, | |
| 21 const gfx::ImageSkia& installing_icon, | |
| 22 bool is_app) = 0; | |
| 23 | |
| 24 virtual void OnDownloadProgress(const std::string& extension_id, | |
| 25 int percent_downloaded) = 0; | |
| 26 | |
| 27 virtual void OnInstallFailure( | |
|
benwells
2013/02/21 06:15:38
nit: will fit on one line (i think)
koz (OOO until 15th September)
2013/02/25 02:39:28
Done.
| |
| 28 const std::string& extension_id) = 0; | |
|
xiyuan
2013/02/21 06:33:17
nit: add a protected virtual destructor.
koz (OOO until 15th September)
2013/02/25 02:39:28
Done.
| |
| 29 }; | |
| 30 | |
| 31 class InstallTracker : public ProfileKeyedService, public InstallObserver { | |
|
xiyuan
2013/02/21 06:33:17
InstallTracker probably should not derive from Ins
koz (OOO until 15th September)
2013/02/25 02:39:28
Done.
| |
| 32 public: | |
| 33 explicit InstallTracker(Profile* profile); | |
| 34 virtual ~InstallTracker(); | |
| 35 | |
| 36 // ProfileKeyedService implementation. | |
| 37 virtual void Shutdown() OVERRIDE {} | |
|
xiyuan
2013/02/21 06:33:17
Think we can get rid of this since we are not real
koz (OOO until 15th September)
2013/02/25 02:39:28
Done.
| |
| 38 | |
| 39 void AddObserver(InstallObserver* observer); | |
| 40 void RemoveObserver(InstallObserver* observer); | |
| 41 | |
| 42 // InstallObserver overrides. | |
| 43 virtual void OnBeginExtensionInstall( | |
| 44 const std::string& extension_id, | |
| 45 const std::string& extension_name, | |
| 46 const gfx::ImageSkia& installing_icon, | |
| 47 bool is_app) OVERRIDE; | |
| 48 virtual void OnDownloadProgress(const std::string& extension_id, | |
| 49 int percent_downloaded) OVERRIDE; | |
| 50 virtual void OnInstallFailure(const std::string& extension_id) OVERRIDE; | |
| 51 | |
| 52 private: | |
| 53 Profile* profile_; | |
|
xiyuan
2013/02/21 06:33:17
This does not seem used anywhere. Think we could g
koz (OOO until 15th September)
2013/02/25 02:39:28
Done.
| |
| 54 ObserverList<InstallObserver> observers_; | |
|
xiyuan
2013/02/21 06:33:17
DISALLOW_COPY_AND_ASSIGN(...)
koz (OOO until 15th September)
2013/02/25 02:39:28
Done.
| |
| 55 }; | |
| 56 | |
| 57 } // namespace extensions | |
| 58 | |
| 59 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_ | |
| OLD | NEW |