Index: chrome/browser/profiles/profile.cc |
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc |
index 692012a8e91534fa0ac75bc131e834d030fe4ec7..ccd2639e401739c1953044ec6e570f0061680609 100644 |
--- a/chrome/browser/profiles/profile.cc |
+++ b/chrome/browser/profiles/profile.cc |
@@ -18,10 +18,12 @@ |
#include "chrome/browser/chrome_blob_storage_context.h" |
#include "chrome/browser/download/download_manager.h" |
#include "chrome/browser/extensions/extension_message_service.h" |
+#include "chrome/browser/extensions/extension_pref_store.h" |
#include "chrome/browser/extensions/extension_process_manager.h" |
#include "chrome/browser/file_system/browser_file_system_helper.h" |
#include "chrome/browser/in_process_webkit/webkit_context.h" |
#include "chrome/browser/net/chrome_url_request_context.h" |
+#include "chrome/browser/net/pref_proxy_config_service.h" |
#include "chrome/browser/notifications/desktop_notification_service.h" |
#include "chrome/browser/ssl/ssl_host_state.h" |
#include "chrome/browser/sync/profile_sync_service.h" |
@@ -135,6 +137,9 @@ class OffTheRecordProfileImpl : public Profile, |
explicit OffTheRecordProfileImpl(Profile* real_profile) |
: profile_(real_profile), |
start_time_(Time::Now()) { |
+ prefs_.reset(profile_->GetPrefs()->CreateIncognitoPrefService( |
+ new ExtensionPrefStore(profile_->GetExtensionPrefValueMap(), true))); |
+ |
request_context_ = ChromeURLRequestContextGetter::CreateOffTheRecord(this); |
extension_process_manager_.reset(ExtensionProcessManager::Create(this)); |
@@ -159,6 +164,9 @@ class OffTheRecordProfileImpl : public Profile, |
&webkit_database::DatabaseTracker::DeleteIncognitoDBDirectory)); |
BrowserList::RemoveObserver(this); |
+ |
+ if (pref_proxy_config_tracker_) |
+ pref_proxy_config_tracker_->DetachFromPrefService(); |
} |
virtual ProfileId GetRuntimeId() { |
@@ -310,7 +318,7 @@ class OffTheRecordProfileImpl : public Profile, |
} |
virtual PrefService* GetPrefs() { |
- return profile_->GetPrefs(); |
+ return prefs_.get(); |
} |
virtual TemplateURLModel* GetTemplateURLModel() { |
@@ -602,7 +610,10 @@ class OffTheRecordProfileImpl : public Profile, |
} |
virtual PrefProxyConfigTracker* GetProxyConfigTracker() { |
- return profile_->GetProxyConfigTracker(); |
+ if (!pref_proxy_config_tracker_) |
+ pref_proxy_config_tracker_ = new PrefProxyConfigTracker(GetPrefs()); |
+ |
+ return pref_proxy_config_tracker_; |
} |
virtual PrerenderManager* GetPrerenderManager() { |
@@ -612,12 +623,19 @@ class OffTheRecordProfileImpl : public Profile, |
return NULL; |
} |
+ protected: |
+ ExtensionPrefValueMap* GetExtensionPrefValueMap() { |
danno
2011/01/14 13:05:09
should it be virtual, maybe private :-)
battre
2011/01/20 17:59:29
Made virtual, not private.
|
+ return profile_->GetExtensionPrefValueMap(); |
+ } |
+ |
private: |
NotificationRegistrar registrar_; |
// The real underlying profile. |
Profile* profile_; |
+ scoped_ptr<PrefService> prefs_; |
+ |
scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
// The context to use for requests made from this OTR session. |
@@ -673,6 +691,8 @@ class OffTheRecordProfileImpl : public Profile, |
// The file_system context for this profile. |
scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; |
+ scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
+ |
DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); |
}; |