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..29a24c0050e8267b44695ef2bc27d0eb89f40bb4 100644 |
--- a/chrome/browser/ui/webui/plugins_ui.cc |
+++ b/chrome/browser/ui/webui/plugins_ui.cc |
@@ -159,7 +159,9 @@ PluginsDOMHandler::PluginsDOMHandler() |
} |
WebUIMessageHandler* PluginsDOMHandler::Attach(WebUI* web_ui) { |
- PrefService* prefs = web_ui->GetProfile()->GetPrefs(); |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui->tab_contents()->browser_context()); |
+ PrefService* prefs = profile->GetPrefs(); |
show_details_.Init(prefs::kPluginsShowDetails, prefs, this); |
@@ -182,10 +184,13 @@ void PluginsDOMHandler::HandleRequestPluginsData(const ListValue* args) { |
} |
void PluginsDOMHandler::HandleEnablePluginMessage(const ListValue* args) { |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context()); |
+ |
// 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 +235,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) { |