Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(748)

Unified Diff: chrome/browser/ui/webui/options/font_settings_handler.cc

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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),

Powered by Google App Engine
This is Rietveld 408576698