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

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

Issue 98463005: Enable/disable extensions upon changes in blacklist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move blacklist_state.h to extensions/. Created 6 years, 11 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/extension_service.h
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 2473216742e8bd98d4c2a705d7048f58c94c6ff2..1f03045dbc7d745b0af159ed3e43c4705f91a18b 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -62,6 +62,8 @@ class SettingsFrontend;
class UpdateObserver;
} // namespace extensions
+using extensions::ExtensionIdSet;
+
namespace syncer {
class SyncErrorFactory;
}
@@ -599,6 +601,9 @@ class ExtensionService
#endif
private:
+ // Populates greylist_.
+ void LoadGreylistFromPrefs();
+
// Signals *ready_ and sends a notification to the listeners.
void SetReadyAndNotifyListeners();
@@ -666,7 +671,18 @@ class ExtensionService
// Manages the blacklisted extensions, intended as callback from
// Blacklist::GetBlacklistedIDs.
- void ManageBlacklist(const std::set<std::string>& blacklisted_ids);
+ void ManageBlacklist(
+ const extensions::Blacklist::BlacklistStateMap& blacklisted_ids);
+
+ // Add extensions in |blocked| to blacklisted_extensions, remove extensions
+ // that are neither in |blocked|, nor in |unchanged|.
+ void UpdateBlockedExtensions(const ExtensionIdSet& blocked,
+ const ExtensionIdSet& unchanged);
+
+ void UpdateGreylistedExtensions(
+ const ExtensionIdSet& greylist,
+ const ExtensionIdSet& unchanged,
+ const extensions::Blacklist::BlacklistStateMap& state_map);
// Controls if installs are delayed. See comment for
// |installs_delayed_for_gc_|.
@@ -699,6 +715,14 @@ class ExtensionService
// Sets of enabled/disabled/terminated/blacklisted extensions. Not owned.
extensions::ExtensionRegistry* registry_;
+ // Set of greylisted extensions. These extensions are disabled if they are
+ // already installed in Chromium at the time when they are added to
+ // the greylist. Unlike blacklisted extensions, greylisted ones are visible
+ // to the user and if user re-enables such an extension, they remain enabled.
+ //
+ // These extensions should appear in registry_.
+ extensions::ExtensionSet greylist_;
+
// The list of extension installs delayed for various reasons. The reason
// for delayed install is stored in ExtensionPrefs. These are not part of
// ExtensionRegistry because they are not yet installed.
@@ -821,6 +845,12 @@ class ExtensionService
WillNotLoadBlacklistedExtensionsFromDirectory);
FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
BlacklistedInPrefsFromStartup);
+ FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
+ GreylistedExtensionDisabled);
+ FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
+ GreylistDontEnableManuallyDisabled);
+ FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
+ GreylistUnknownDontChange);
DISALLOW_COPY_AND_ASSIGN(ExtensionService);
};

Powered by Google App Engine
This is Rietveld 408576698