OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APP_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APP_UPDATER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APP_UPDATER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APP_UPDATER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 class BrowserContext; | 13 class BrowserContext; |
14 } | 14 } |
15 | 15 |
16 // Responsible for handling of Chrome app life-cycle events. | 16 // Responsible for handling of Chrome app life-cycle events. |
17 class LauncherAppUpdater { | 17 class LauncherAppUpdater { |
18 public: | 18 public: |
19 class Delegate { | 19 class Delegate { |
20 public: | 20 public: |
21 virtual void OnAppInstalled(content::BrowserContext* browser_context, | 21 virtual void OnAppInstalled(content::BrowserContext* browser_context, |
22 const std::string& app_id) = 0; | 22 const std::string& app_id) {} |
23 virtual void OnAppUpdated(content::BrowserContext* browser_context, | 23 virtual void OnAppUpdated(content::BrowserContext* browser_context, |
24 const std::string& app_id) = 0; | 24 const std::string& app_id) {} |
| 25 virtual void OnAppUninstalledPrepared( |
| 26 content::BrowserContext* browser_context, |
| 27 const std::string& app_id) {} |
25 virtual void OnAppUninstalled(content::BrowserContext* browser_context, | 28 virtual void OnAppUninstalled(content::BrowserContext* browser_context, |
26 const std::string& app_id) = 0; | 29 const std::string& app_id) {} |
27 | 30 |
28 protected: | 31 protected: |
29 virtual ~Delegate() {} | 32 virtual ~Delegate() {} |
30 }; | 33 }; |
31 | 34 |
32 virtual ~LauncherAppUpdater(); | 35 virtual ~LauncherAppUpdater(); |
33 | 36 |
34 Delegate* delegate() { return delegate_; } | 37 Delegate* delegate() { return delegate_; } |
35 | 38 |
36 content::BrowserContext* browser_context() { return browser_context_; } | 39 content::BrowserContext* browser_context() { return browser_context_; } |
37 | 40 |
38 protected: | 41 protected: |
39 LauncherAppUpdater(Delegate* delegate, | 42 LauncherAppUpdater(Delegate* delegate, |
40 content::BrowserContext* browser_context); | 43 content::BrowserContext* browser_context); |
41 | 44 |
42 private: | 45 private: |
43 // Unowned pointers | 46 // Unowned pointers |
44 Delegate* delegate_; | 47 Delegate* delegate_; |
45 content::BrowserContext* browser_context_; | 48 content::BrowserContext* browser_context_; |
46 | 49 |
47 DISALLOW_COPY_AND_ASSIGN(LauncherAppUpdater); | 50 DISALLOW_COPY_AND_ASSIGN(LauncherAppUpdater); |
48 }; | 51 }; |
49 | 52 |
50 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APP_UPDATER_H_ | 53 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APP_UPDATER_H_ |
OLD | NEW |