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_EXTENSION_ACTION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // into account |extension|'s browser or page actions, if any, along with its | 53 // into account |extension|'s browser or page actions, if any, along with its |
54 // name and any declared icons. | 54 // name and any declared icons. |
55 std::unique_ptr<ExtensionAction> GetBestFitAction( | 55 std::unique_ptr<ExtensionAction> GetBestFitAction( |
56 const Extension& extension, | 56 const Extension& extension, |
57 ActionInfo::Type type) const; | 57 ActionInfo::Type type) const; |
58 | 58 |
59 private: | 59 private: |
60 // Implement ExtensionRegistryObserver. | 60 // Implement ExtensionRegistryObserver. |
61 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 61 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
62 const Extension* extension, | 62 const Extension* extension, |
63 UnloadedExtensionInfo::Reason reason) override; | 63 UnloadedExtensionReason reason) override; |
64 | 64 |
65 Profile* profile_; | 65 Profile* profile_; |
66 | 66 |
67 // Listen to extension unloaded notifications. | 67 // Listen to extension unloaded notifications. |
68 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 68 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
69 extension_registry_observer_; | 69 extension_registry_observer_; |
70 | 70 |
71 // Keyed by Extension ID. These maps are populated lazily when their | 71 // Keyed by Extension ID. These maps are populated lazily when their |
72 // ExtensionAction is first requested, and the entries are removed when the | 72 // ExtensionAction is first requested, and the entries are removed when the |
73 // extension is unloaded. Not every extension has a page action or browser | 73 // extension is unloaded. Not every extension has a page action or browser |
74 // action. | 74 // action. |
75 using ExtIdToActionMap = | 75 using ExtIdToActionMap = |
76 std::map<std::string, std::unique_ptr<ExtensionAction>>; | 76 std::map<std::string, std::unique_ptr<ExtensionAction>>; |
77 mutable ExtIdToActionMap page_actions_; | 77 mutable ExtIdToActionMap page_actions_; |
78 mutable ExtIdToActionMap browser_actions_; | 78 mutable ExtIdToActionMap browser_actions_; |
79 mutable ExtIdToActionMap system_indicators_; | 79 mutable ExtIdToActionMap system_indicators_; |
80 }; | 80 }; |
81 | 81 |
82 } // namespace extensions | 82 } // namespace extensions |
83 | 83 |
84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ | 84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ |
OLD | NEW |