Chromium Code Reviews| Index: chrome/browser/extensions/pending_extension_manager.h |
| diff --git a/chrome/browser/extensions/pending_extension_manager.h b/chrome/browser/extensions/pending_extension_manager.h |
| index 859bc8605fea53f245942b1f1649063f1e1efd01..9f7aa6aec9a121316ac0755d6598b3ae2cf2d31f 100644 |
| --- a/chrome/browser/extensions/pending_extension_manager.h |
| +++ b/chrome/browser/extensions/pending_extension_manager.h |
| @@ -6,8 +6,9 @@ |
| #define CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_ |
| #pragma once |
| -#include <map> |
| +#include <list> |
| #include <string> |
| +#include <utility> |
| #include "chrome/browser/extensions/pending_extension_info.h" |
| #include "chrome/common/extensions/extension.h" |
| @@ -43,13 +44,11 @@ class PendingExtensionManager { |
| // ExtensionService is moved into methods of this class. |
| // Remove |id| from the set of pending extensions. |
|
Aaron Boodman
2012/05/01 15:50:22
Document what the return value means?
mitchellwrosen
2012/05/11 05:45:03
Done.
|
| - void Remove(const std::string& id); |
| + bool Remove(const std::string& id); |
| - // Get the information for a pending extension. Returns true and sets |
| - // |out_pending_extension_info| if there is a pending extension with id |
| - // |id|. Returns false otherwise. |
| - bool GetById(const std::string& id, |
| - PendingExtensionInfo* out_pending_extension_info) const; |
| + // Get the information for a pending extension. Returns a pointer to the |
| + // pending extension with id |id|, or NULL if there is no such extension. |
| + const PendingExtensionInfo* GetById(const std::string& id) const; |
| // Is |id| in the set of pending extensions? |
| bool IsIdPending(const std::string& id) const; |
| @@ -78,19 +77,15 @@ class PendingExtensionManager { |
| // Add a pending extension record for an external CRX file. |
| // Return true if the CRX should be installed, false if an existing |
| // pending record overrides it. |
| - bool AddFromExternalFile( |
| - const std::string& id, |
| - Extension::Location location); |
| + bool AddFromExternalFile(const std::string& id, Extension::Location location); |
| - // Get the set of pending IDs that should be installed from an update URL. |
| + // Get the list of pending IDs that should be installed from an update URL. |
| // Pending extensions that will be installed from local files will not be |
| // included in the set. |
| void GetPendingIdsForUpdateCheck( |
| - std::set<std::string>* out_ids_for_update_check) const; |
| + std::list<std::string>* out_ids_for_update_check) const; |
| private: |
| - typedef std::map<std::string, PendingExtensionInfo> PendingExtensionMap; |
| - |
| // Assumes an extension with id |id| is not already installed. |
| // Return true if the extension was added. |
| bool AddExtensionImpl( |
| @@ -113,8 +108,7 @@ class PendingExtensionManager { |
| // ExtensionServiceInterface. |
| const ExtensionServiceInterface& service_; |
| - // A map from extension id to the pending extension info for that extension. |
| - PendingExtensionMap pending_extension_map_; |
| + std::list<PendingExtensionInfo> pending_extension_list_; |
| FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| UpdatePendingExtensionAlreadyInstalled); |