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

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: 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..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) {

Powered by Google App Engine
This is Rietveld 408576698