Fix for Bug 50726 "Save extension list and "winning" prefs from extensions"

This is a redesign for http://codereview.chromium.org/4852002/ following discussions.

The goal of this patch is to ensure that Chrome maintains the order in which extensions apply their preferences between restarts. This may be an issue if two extensions overwrite each others preferences. Furthermore, it ensures that preferences are persisted to disk between browser restarts. Therefore, previous settings are immediately available when the browser is restarted.

A description of the design has been published https://docs.google.com/a/google.com/document/d/1E_HX_cUpET1gH2gDunGIU1EOywMM6FEOuVU6TlpnSwo/edit?hl=en for review and comments. - Sorry, accessible Google internally only.

This CL requires http://codereview.chromium.org/5204006/

Contributed by [email protected]

BUG=50726
TEST=none

Review URL: http://codereview.chromium.org/5213002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68355 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 2157f9c..f6fb71d 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -554,10 +554,10 @@
 ExtensionsService::ExtensionsService(Profile* profile,
                                      const CommandLine* command_line,
                                      const FilePath& install_directory,
+                                     ExtensionPrefs* extension_prefs,
                                      bool autoupdate_enabled)
     : profile_(profile),
-      extension_prefs_(new ExtensionPrefs(profile->GetPrefs(),
-                                          install_directory)),
+      extension_prefs_(extension_prefs),
       install_directory_(install_directory),
       extensions_enabled_(true),
       show_extensions_prompts_(true),