Index: chrome/test/testing_profile.cc |
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc |
index 3c37562e4a1c261afd91672cd38f8df4f88beacc..151b9a1982a1ca50d65ed0c95932771331ddad47 100644 |
--- a/chrome/test/testing_profile.cc |
+++ b/chrome/test/testing_profile.cc |
@@ -30,6 +30,7 @@ |
#include "chrome/browser/net/pref_proxy_config_service.h" |
#include "chrome/browser/notifications/desktop_notification_service.h" |
#include "chrome/browser/prefs/browser_prefs.h" |
+#include "chrome/browser/prefs/testing_pref_store.h" |
#include "chrome/browser/search_engines/template_url_fetcher.h" |
#include "chrome/browser/search_engines/template_url_model.h" |
#include "chrome/browser/sessions/session_service.h" |
@@ -48,7 +49,6 @@ |
#include "net/url_request/url_request_unittest.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "webkit/database/database_tracker.h" |
- |
#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
#include "chrome/browser/gtk/gtk_theme_provider.h" |
#endif |
@@ -329,15 +329,28 @@ void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) { |
scoped_refptr<ExtensionService> TestingProfile::CreateExtensionService( |
const CommandLine* command_line, |
const FilePath& install_directory) { |
- extension_pref_store_.reset(new ExtensionPrefStore); |
- extension_prefs_.reset(new ExtensionPrefs(GetPrefs(), |
- install_directory, |
- extension_pref_store_.get())); |
+ // Extension pref store, created for use by |extension_prefs_|. |
+ ExtensionPrefStore* extension_pref_store = NULL; |
+ ExtensionPrefStore* incognito_extension_pref_store = NULL; |
+ PrefService* incognito_prefs = NULL; |
+ |
+ if (testing_prefs_) { |
Mattias Nissler (ping if slow)
2010/12/22 12:09:03
GetPrefs() should be fine, no need for the conditi
battre
2010/12/22 18:34:53
There are classes derived from TestingProfile that
|
+ extension_pref_store = testing_prefs_->GetExtensionPrefs(); |
+ incognito_extension_pref_store = new ExtensionPrefStore; |
+ incognito_prefs = |
+ GetPrefs()->CreateIncognitoPrefService(incognito_extension_pref_store); |
+ } |
+ extension_prefs_.reset( |
+ new ExtensionPrefs(GetPrefs(), |
+ incognito_prefs, |
+ install_directory, |
+ extension_pref_store, |
+ incognito_extension_pref_store)); |
extensions_service_ = new ExtensionService(this, |
- command_line, |
- install_directory, |
- extension_prefs_.get(), |
- false); |
+ command_line, |
+ install_directory, |
+ extension_prefs_.get(), |
+ false); |
return extensions_service_; |
} |