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

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

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Profile helper function, 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/core_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc
index 13fbed9bce1f3936b2873e69e66391776a14d43e..e66585fe903273dd149edecff01a1e58782c9ccd 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -112,7 +112,7 @@ void CoreOptionsHandler::Uninitialize() {
WebUIMessageHandler* CoreOptionsHandler::Attach(WebUI* web_ui) {
WebUIMessageHandler* result = WebUIMessageHandler::Attach(web_ui);
DCHECK(web_ui_);
- registrar_.Init(web_ui_->GetProfile()->GetPrefs());
+ registrar_.Init(Profile::FromWebUI(web_ui_)->GetPrefs());
return result;
}
@@ -152,7 +152,7 @@ void CoreOptionsHandler::HandleInitialize(const ListValue* args) {
}
Value* CoreOptionsHandler::FetchPref(const std::string& pref_name) {
- PrefService* pref_service = web_ui_->GetProfile()->GetPrefs();
+ PrefService* pref_service = Profile::FromWebUI(web_ui_)->GetPrefs();
const PrefService::Preference* pref =
pref_service->FindPreference(pref_name.c_str());
@@ -169,7 +169,7 @@ void CoreOptionsHandler::ObservePref(const std::string& pref_name) {
void CoreOptionsHandler::SetPref(const std::string& pref_name,
const Value* value,
const std::string& metric) {
- PrefService* pref_service = web_ui_->GetProfile()->GetPrefs();
+ PrefService* pref_service = Profile::FromWebUI(web_ui_)->GetPrefs();
switch (value->GetType()) {
case Value::TYPE_BOOLEAN:
@@ -190,7 +190,7 @@ void CoreOptionsHandler::SetPref(const std::string& pref_name,
void CoreOptionsHandler::ClearPref(const std::string& pref_name,
const std::string& metric) {
- PrefService* pref_service = web_ui_->GetProfile()->GetPrefs();
+ PrefService* pref_service = Profile::FromWebUI(web_ui_)->GetPrefs();
pref_service->ClearPref(pref_name.c_str());
pref_service->ScheduleSavePersistentPrefs();
@@ -377,7 +377,7 @@ void CoreOptionsHandler::NotifyPrefChanged(const std::string* pref_name) {
return;
}
- PrefService* pref_service = web_ui_->GetProfile()->GetPrefs();
+ PrefService* pref_service = Profile::FromWebUI(web_ui_)->GetPrefs();
const PrefService::Preference* pref =
pref_service->FindPreference(pref_name->c_str());
if (!pref)
« no previous file with comments | « chrome/browser/ui/webui/options/cookies_view_handler.cc ('k') | chrome/browser/ui/webui/options/font_settings_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698