Chromium Code Reviews| 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 { |
|
James Cook
2017/03/29 14:28:02
Aside: This class is weird. It seems to exist most
msw
2017/03/29 21:34:17
I suppose it's because c/b/ui/app_list can't depen
| |
| 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) {} | 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) {} | 24 const std::string& app_id) {} |
| 25 virtual void OnAppUninstalledPrepared( | 25 virtual void OnAppUninstalledPrepared( |
| 26 content::BrowserContext* browser_context, | 26 content::BrowserContext* browser_context, |
| 27 const std::string& app_id) {} | 27 const std::string& app_id) {} |
| 28 virtual void OnAppUninstalled(content::BrowserContext* browser_context, | 28 virtual void OnAppUninstalled(content::BrowserContext* browser_context, |
| 29 const std::string& app_id) {} | 29 const std::string& app_id) {} |
| 30 | 30 |
| 31 // This pair of functions is called before and after disabling an app. This | |
| 32 // prevents shelf item removal from triggering a sync model pref update. | |
| 33 virtual void OnAppDisabling(const std::string& app_id) {} | |
| 34 virtual void OnAppDisabled(const std::string& app_id) {} | |
| 35 | |
| 31 protected: | 36 protected: |
| 32 virtual ~Delegate() {} | 37 virtual ~Delegate() {} |
| 33 }; | 38 }; |
| 34 | 39 |
| 35 virtual ~LauncherAppUpdater(); | 40 virtual ~LauncherAppUpdater(); |
| 36 | 41 |
| 37 Delegate* delegate() { return delegate_; } | 42 Delegate* delegate() { return delegate_; } |
| 38 | 43 |
| 39 content::BrowserContext* browser_context() { return browser_context_; } | 44 content::BrowserContext* browser_context() { return browser_context_; } |
| 40 | 45 |
| 41 protected: | 46 protected: |
| 42 LauncherAppUpdater(Delegate* delegate, | 47 LauncherAppUpdater(Delegate* delegate, |
| 43 content::BrowserContext* browser_context); | 48 content::BrowserContext* browser_context); |
| 44 | 49 |
| 45 private: | 50 private: |
| 46 // Unowned pointers | 51 // Unowned pointers |
| 47 Delegate* delegate_; | 52 Delegate* delegate_; |
| 48 content::BrowserContext* browser_context_; | 53 content::BrowserContext* browser_context_; |
| 49 | 54 |
| 50 DISALLOW_COPY_AND_ASSIGN(LauncherAppUpdater); | 55 DISALLOW_COPY_AND_ASSIGN(LauncherAppUpdater); |
| 51 }; | 56 }; |
| 52 | 57 |
| 53 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APP_UPDATER_H_ | 58 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_APP_UPDATER_H_ |
| OLD | NEW |