Index: chrome/browser/ui/webui/options/font_settings_handler.cc |
diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc |
index 95521ba3e3e43d8ba6327336de1028040cee0036..666e03b46c9eaf944ba2afc66f585be643ea1301 100644 |
--- a/chrome/browser/ui/webui/options/font_settings_handler.cc |
+++ b/chrome/browser/ui/webui/options/font_settings_handler.cc |
@@ -19,6 +19,7 @@ |
#include "chrome/browser/ui/webui/options/font_settings_utils.h" |
#include "chrome/common/chrome_notification_types.h" |
#include "chrome/common/pref_names.h" |
+#include "content/browser/tab_contents/tab_contents.h" |
#include "content/common/notification_details.h" |
#include "grit/chromium_strings.h" |
#include "grit/generated_resources.h" |
@@ -78,7 +79,9 @@ WebUIMessageHandler* FontSettingsHandler::Attach(WebUI* web_ui) { |
// Perform validation for saved fonts. |
DCHECK(web_ui_); |
- PrefService* pref_service = web_ui_->GetProfile()->GetPrefs(); |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()); |
+ PrefService* pref_service = profile->GetPrefs(); |
FontSettingsUtilities::ValidateSavedFonts(pref_service); |
// Register for preferences that we need to observe manually. |
@@ -110,7 +113,9 @@ void FontSettingsHandler::FontsListHasLoaded( |
scoped_refptr<content::FontListResult> list) { |
ListValue encoding_list; |
const std::vector<CharacterEncoding::EncodingInfo>* encodings; |
- PrefService* pref_service = web_ui_->GetProfile()->GetPrefs(); |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()); |
+ PrefService* pref_service = profile->GetPrefs(); |
encodings = CharacterEncoding::GetCurrentDisplayEncodings( |
g_browser_process->GetApplicationLocale(), |
pref_service->GetString(prefs::kStaticEncodings), |