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

Unified Diff: chrome/browser/extensions/pending_extension_manager.h

Issue 9595001: Apps on NTP should be in order of installation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
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 098d5f110f3867d6d0a17aa9ef6c5ddf4063f5cf..0a8ac6ccefc22c65ede9cd9ad5827d7b56160c8e 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"
@@ -35,7 +36,7 @@ class PendingExtensionManager {
// ExtensionService is moved into methods of this class.
// Remove |id| from the set of pending extensions.
- 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
@@ -74,14 +75,15 @@ class PendingExtensionManager {
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;
+ typedef std::list<std::pair<std::string,
+ PendingExtensionInfo> > PendingExtensionList;
// Assumes an extension with id |id| is not already installed.
// Return true if the extension was added.
@@ -99,14 +101,22 @@ class PendingExtensionManager {
void AddForTesting(const std::string& id,
const PendingExtensionInfo& pending_etension_info);
+ // Returns an iter pointing at a pair in PendingExtensionList, so iteration
+ // code need not be repeated
+ PendingExtensionList::iterator GetExtensionListIterById(
+ const std::string& id);
+
+ PendingExtensionList::const_iterator GetExtensionListConstIterById(
+ const std::string& id) const;
+
// Reference to the extension service whose pending extensions this class is
// managing. Because this class is a member of |service_|, it is created
// and destroyed with |service_|. We only use methods from the interface
// ExtensionServiceInterface.
const ExtensionServiceInterface& service_;
- // A map from extension id to the pending extension info for that extension.
- PendingExtensionMap pending_extension_map_;
+ // A list of pairs of <extension id, pending extension info>
+ PendingExtensionList pending_extension_list_;
FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
UpdatePendingExtensionAlreadyInstalled);
@@ -119,3 +129,4 @@ class PendingExtensionManager {
};
#endif // CHROME_BROWSER_EXTENSIONS_PENDING_EXTENSION_MANAGER_H_
+
Aaron Boodman 2012/04/05 22:06:43 extra line

Powered by Google App Engine
This is Rietveld 408576698