| 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_EXTENSION_APP_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_EXTENSION_APP_UPDATER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_EXTENSION_APP_UPDATER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_EXTENSION_APP_UPDATER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
| 9 #include "chrome/browser/ui/ash/launcher/launcher_app_updater.h" | 10 #include "chrome/browser/ui/ash/launcher/launcher_app_updater.h" |
| 10 #include "extensions/browser/extension_registry_observer.h" | 11 #include "extensions/browser/extension_registry_observer.h" |
| 11 | 12 |
| 13 namespace extensions { |
| 14 class ExtensionSet; |
| 15 } // namespace extensions |
| 16 |
| 12 class LauncherExtensionAppUpdater | 17 class LauncherExtensionAppUpdater |
| 13 : public LauncherAppUpdater, | 18 : public LauncherAppUpdater, |
| 14 public extensions::ExtensionRegistryObserver { | 19 public extensions::ExtensionRegistryObserver, |
| 20 public arc::ArcAuthService::Observer { |
| 15 public: | 21 public: |
| 16 LauncherExtensionAppUpdater(Delegate* delegate, | 22 LauncherExtensionAppUpdater(Delegate* delegate, |
| 17 content::BrowserContext* browser_context); | 23 content::BrowserContext* browser_context); |
| 18 ~LauncherExtensionAppUpdater() override; | 24 ~LauncherExtensionAppUpdater() override; |
| 19 | 25 |
| 20 // ExtensionRegistryObserver: | 26 // ExtensionRegistryObserver: |
| 21 void OnExtensionLoaded(content::BrowserContext* browser_context, | 27 void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 22 const extensions::Extension* extension) override; | 28 const extensions::Extension* extension) override; |
| 23 void OnExtensionUnloaded( | 29 void OnExtensionUnloaded( |
| 24 content::BrowserContext* browser_context, | 30 content::BrowserContext* browser_context, |
| 25 const extensions::Extension* extension, | 31 const extensions::Extension* extension, |
| 26 extensions::UnloadedExtensionInfo::Reason reason) override; | 32 extensions::UnloadedExtensionInfo::Reason reason) override; |
| 33 void OnExtensionUninstalled(content::BrowserContext* browser_context, |
| 34 const extensions::Extension* extension, |
| 35 extensions::UninstallReason reason) override; |
| 36 void OnShutdown(extensions::ExtensionRegistry* registry) override; |
| 37 |
| 38 // arc::ArcAuthService::Observer: |
| 39 void OnOptInChanged(arc::ArcAuthService::State state) override; |
| 27 | 40 |
| 28 private: | 41 private: |
| 42 void StartObservingExtensionRegistry(); |
| 43 void StopObservingExtensionRegistry(); |
| 44 |
| 45 void UpdateHostApps(); |
| 46 void UpdateHostApps(const extensions::ExtensionSet& extensions); |
| 47 void UpdateHostApp(const std::string& app_id); |
| 48 |
| 49 extensions::ExtensionRegistry* extension_registry_ = nullptr; |
| 50 |
| 29 DISALLOW_COPY_AND_ASSIGN(LauncherExtensionAppUpdater); | 51 DISALLOW_COPY_AND_ASSIGN(LauncherExtensionAppUpdater); |
| 30 }; | 52 }; |
| 31 | 53 |
| 32 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_EXTENSION_APP_UPDATER_H_ | 54 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_EXTENSION_APP_UPDATER_H_ |
| OLD | NEW |