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

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

Issue 12390007: Merge 184833 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/extension_sorting.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_sorting.h
===================================================================
--- chrome/browser/extensions/extension_sorting.h (revision 185166)
+++ chrome/browser/extensions/extension_sorting.h (working copy)
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_SORTING_H_
#include <map>
+#include <set>
#include <string>
#include "base/basictypes.h"
@@ -101,7 +102,21 @@
// O(# of apps) worst-case.
syncer::StringOrdinal PageIntegerAsStringOrdinal(size_t page_index);
+ // Hidden extensions don't appear in the new tab page.
+ void MarkExtensionAsHidden(const std::string& extension_id);
+
private:
+ // The StringOrdinal is the app launch ordinal and the string is the extension
+ // id.
+ typedef std::multimap<
+ syncer::StringOrdinal, std::string,
+ syncer::StringOrdinal::LessThanFn> AppLaunchOrdinalMap;
+ // The StringOrdinal is the page ordinal and the AppLaunchOrdinalMap is the
+ // contents of that page.
+ typedef std::map<
+ syncer::StringOrdinal, AppLaunchOrdinalMap,
+ syncer::StringOrdinal::LessThanFn> PageOrdinalMap;
+
// Unit tests.
friend class ExtensionSortingDefaultOrdinalsBase;
friend class ExtensionSortingGetMinOrMaxAppLaunchOrdinalsOnPage;
@@ -179,6 +194,9 @@
const syncer::StringOrdinal& page_ordinal,
const syncer::StringOrdinal& app_launch_ordinal) const;
+ // Returns the number of items in |m| visible on the new tab page.
+ size_t CountItemsVisibleOnNtp(const AppLaunchOrdinalMap& m) const;
+
ExtensionScopedPrefs* extension_scoped_prefs_; // Weak, owns this instance.
PrefService* pref_service_; // Weak.
ExtensionServiceInterface* extension_service_; // Weak.
@@ -190,21 +208,14 @@
// ordinals). The possiblity of collisions means that a multimap must be used
// (although the collisions must all be resolved once all the syncing is
// done).
- // The StringOrdinal is the app launch ordinal and the string is the extension
- // id.
- typedef std::multimap<
- syncer::StringOrdinal, std::string,
- syncer::StringOrdinal::LessThanFn> AppLaunchOrdinalMap;
- // The StringOrdinal is the page ordinal and the AppLaunchOrdinalMap is the
- // contents of that page.
- typedef std::map<
- syncer::StringOrdinal, AppLaunchOrdinalMap,
- syncer::StringOrdinal::LessThanFn> PageOrdinalMap;
PageOrdinalMap ntp_ordinal_map_;
// Defines the default ordinals.
AppOrdinalsMap default_ordinals_;
+ // The set of extensions that don't appear in the new tab page.
+ std::set<std::string> ntp_hidden_extensions_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionSorting);
};
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/extension_sorting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698