| 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 <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
| 12 #include "chrome/common/extensions/api/extension_action/action_info.h" | 13 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 13 #include "components/keyed_service/core/keyed_service.h" | 14 #include "components/keyed_service/core/keyed_service.h" |
| 14 #include "extensions/browser/extension_registry_observer.h" | 15 #include "extensions/browser/extension_registry_observer.h" |
| 15 | 16 |
| 16 class ExtensionAction; | 17 class ExtensionAction; |
| 17 class Profile; | 18 class Profile; |
| 18 | 19 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 Profile* profile_; | 65 Profile* profile_; |
| 65 | 66 |
| 66 // Listen to extension unloaded notifications. | 67 // Listen to extension unloaded notifications. |
| 67 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 68 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 68 extension_registry_observer_; | 69 extension_registry_observer_; |
| 69 | 70 |
| 70 // Keyed by Extension ID. These maps are populated lazily when their | 71 // Keyed by Extension ID. These maps are populated lazily when their |
| 71 // ExtensionAction is first requested, and the entries are removed when the | 72 // ExtensionAction is first requested, and the entries are removed when the |
| 72 // 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 |
| 73 // action. | 74 // action. |
| 74 typedef std::map<std::string, linked_ptr<ExtensionAction> > ExtIdToActionMap; | 75 using ExtIdToActionMap = |
| 76 std::map<std::string, std::unique_ptr<ExtensionAction>>; |
| 75 mutable ExtIdToActionMap page_actions_; | 77 mutable ExtIdToActionMap page_actions_; |
| 76 mutable ExtIdToActionMap browser_actions_; | 78 mutable ExtIdToActionMap browser_actions_; |
| 77 mutable ExtIdToActionMap system_indicators_; | 79 mutable ExtIdToActionMap system_indicators_; |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace extensions | 82 } // namespace extensions |
| 81 | 83 |
| 82 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ | 84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_MANAGER_H_ |
| OLD | NEW |