Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_extension_app_updater.h

Issue 2067943004: ARC: Add badge for Chrome hosted Apps if Arc++ is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address xiyuan@'s comment. Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 UpdateHostedApps();
46 void UpdateHostedApps(const extensions::ExtensionSet& extensions);
47 void UpdateHostedApp(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698