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

Unified Diff: chrome/browser/ui/webui/plugins_ui.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/plugins_ui.cc
diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc
index 397e6fcbc0d4c0e7756e2ec25f868c7a5d25a15d..d957f810307caed7c1da4ae4146e5c9b111284ed 100644
--- a/chrome/browser/ui/webui/plugins_ui.cc
+++ b/chrome/browser/ui/webui/plugins_ui.cc
@@ -159,7 +159,7 @@ PluginsDOMHandler::PluginsDOMHandler()
}
WebUIMessageHandler* PluginsDOMHandler::Attach(WebUI* web_ui) {
- PrefService* prefs = web_ui->GetProfile()->GetPrefs();
+ PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs();
show_details_.Init(prefs::kPluginsShowDetails, prefs, this);
@@ -182,10 +182,12 @@ void PluginsDOMHandler::HandleRequestPluginsData(const ListValue* args) {
}
void PluginsDOMHandler::HandleEnablePluginMessage(const ListValue* args) {
+ Profile* profile = Profile::FromWebUI(web_ui_);
+
// If a non-first-profile user tries to trigger these methods sneakily,
// forbid it.
#if !defined(OS_CHROMEOS)
- if (!web_ui_->GetProfile()->GetOriginalProfile()->first_launched())
+ if (!profile->GetOriginalProfile()->first_launched())
return;
#endif
@@ -230,7 +232,7 @@ void PluginsDOMHandler::HandleEnablePluginMessage(const ListValue* args) {
// TODO(viettrungluu): We might also want to ensure that the plugins
// list is always written to prefs even when the user hasn't disabled a
// plugin. <http://crbug.com/39101>
- plugin_updater->UpdatePreferences(web_ui_->GetProfile(), 0);
+ plugin_updater->UpdatePreferences(profile, 0);
}
void PluginsDOMHandler::HandleSaveShowDetailsToPrefs(const ListValue* args) {
« no previous file with comments | « chrome/browser/ui/webui/options/stop_syncing_handler.cc ('k') | chrome/browser/ui/webui/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698