Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index 159e6b8238b178369521c69321f0b76f0786777a..62a14a2f95f126fee34ea724b08c19d71c2e5087 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -96,6 +96,7 @@ |
#include "content/browser/renderer_host/render_process_host.h" |
#include "content/browser/speech/speech_input_manager.h" |
#include "content/browser/ssl/ssl_host_state.h" |
+#include "content/browser/tab_contents/tab_contents.h" |
#include "content/browser/user_metrics.h" |
#include "content/common/notification_service.h" |
#include "grit/browser_resources.h" |
@@ -941,6 +942,21 @@ PrefService* ProfileImpl::GetOffTheRecordPrefs() { |
return otr_prefs_.get(); |
} |
+PrefService* ProfileImpl::GetPrefsForTabContents(TabContents* contents) { |
+ static PropertyAccessor<PrefService*>* accessor = NULL; |
+ if (!accessor) |
+ accessor = new PropertyAccessor<PrefService*>; |
+ |
+ PrefService** prefs_property = |
+ accessor->GetProperty(contents->property_bag()); |
+ if (prefs_property && *prefs_property) |
+ return *prefs_property; |
+ |
+ PrefService* prefs = GetPrefs()->CreateTabContentsPrefService(); |
+ accessor->SetProperty(contents->property_bag(), prefs); |
+ return prefs; |
+} |
+ |
FilePath ProfileImpl::GetPrefFilePath() { |
FilePath pref_file_path = path_; |
pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); |