OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAGER_
H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAGER_
H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAGER_
H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAGER_
H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 class ExtensionRegistry; | 27 class ExtensionRegistry; |
28 | 28 |
29 // Keeps track of all the systemIndicator icons created for a given Profile | 29 // Keeps track of all the systemIndicator icons created for a given Profile |
30 // that are currently visible in the UI. Use SystemIndicatorManagerFactory to | 30 // that are currently visible in the UI. Use SystemIndicatorManagerFactory to |
31 // create a SystemIndicatorManager object. | 31 // create a SystemIndicatorManager object. |
32 class SystemIndicatorManager : public ExtensionRegistryObserver, | 32 class SystemIndicatorManager : public ExtensionRegistryObserver, |
33 public ExtensionActionAPI::Observer, | 33 public ExtensionActionAPI::Observer, |
34 public KeyedService { | 34 public KeyedService { |
35 public: | 35 public: |
36 SystemIndicatorManager(Profile* profile, StatusTray* status_tray); | 36 SystemIndicatorManager(Profile* profile, StatusTray* status_tray); |
37 virtual ~SystemIndicatorManager(); | 37 ~SystemIndicatorManager() override; |
38 | 38 |
39 // KeyedService implementation. | 39 // KeyedService implementation. |
40 virtual void Shutdown() override; | 40 void Shutdown() override; |
41 | 41 |
42 private: | 42 private: |
43 FRIEND_TEST_ALL_PREFIXES(::SystemIndicatorApiTest, SystemIndicator); | 43 FRIEND_TEST_ALL_PREFIXES(::SystemIndicatorApiTest, SystemIndicator); |
44 | 44 |
45 // ExtensionRegistryObserver implementation. | 45 // ExtensionRegistryObserver implementation. |
46 virtual void OnExtensionUnloaded( | 46 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
47 content::BrowserContext* browser_context, | 47 const Extension* extension, |
48 const Extension* extension, | 48 UnloadedExtensionInfo::Reason reason) override; |
49 UnloadedExtensionInfo::Reason reason) override; | |
50 | 49 |
51 // ExtensionActionAPI::Observer implementation. | 50 // ExtensionActionAPI::Observer implementation. |
52 virtual void OnExtensionActionUpdated( | 51 void OnExtensionActionUpdated( |
53 ExtensionAction* extension_action, | 52 ExtensionAction* extension_action, |
54 content::WebContents* web_contents, | 53 content::WebContents* web_contents, |
55 content::BrowserContext* browser_context) override; | 54 content::BrowserContext* browser_context) override; |
56 | 55 |
57 // Causes a call to OnStatusIconClicked for the specified extension_id. | 56 // Causes a call to OnStatusIconClicked for the specified extension_id. |
58 // Returns false if no ExtensionIndicatorIcon is found for the extension. | 57 // Returns false if no ExtensionIndicatorIcon is found for the extension. |
59 bool SendClickEventToExtensionForTest(const std::string extension_id); | 58 bool SendClickEventToExtensionForTest(const std::string extension_id); |
60 | 59 |
61 // Causes an indicator to be shown for the given extension_action. Creates | 60 // Causes an indicator to be shown for the given extension_action. Creates |
62 // the indicator if necessary. | 61 // the indicator if necessary. |
(...skipping 18 matching lines...) Expand all Loading... |
81 // Listen to extension unloaded notifications. | 80 // Listen to extension unloaded notifications. |
82 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 81 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
83 extension_registry_observer_; | 82 extension_registry_observer_; |
84 | 83 |
85 DISALLOW_COPY_AND_ASSIGN(SystemIndicatorManager); | 84 DISALLOW_COPY_AND_ASSIGN(SystemIndicatorManager); |
86 }; | 85 }; |
87 | 86 |
88 } // namespace extensions | 87 } // namespace extensions |
89 | 88 |
90 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAG
ER_H_ | 89 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAG
ER_H_ |
OLD | NEW |