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

Unified Diff: chrome/browser/extensions/extensions_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/extensions/extensions_ui.cc
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index c74d07a4201cddaae79c3823724b9b4ce04973ea..d8b96dcf0b8493a2df8bb4eb19ec3d71cfe1a9b0 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -242,8 +242,8 @@ void ExtensionsDOMHandler::HandleRequestExtensionsData(const ListValue* args) {
}
results.Set("extensions", extensions_list);
- bool developer_mode = web_ui_->GetProfile()->GetPrefs()
- ->GetBoolean(prefs::kExtensionsUIDeveloperMode);
+ bool developer_mode = Profile::FromWebUI(web_ui_)->GetPrefs()->
+ GetBoolean(prefs::kExtensionsUIDeveloperMode);
results.SetBoolean("developerMode", developer_mode);
web_ui_->CallJavascriptFunction("returnExtensionsData", results);
@@ -282,16 +282,17 @@ void ExtensionsDOMHandler::RegisterForNotifications() {
ExtensionUninstallDialog* ExtensionsDOMHandler::GetExtensionUninstallDialog() {
if (!extension_uninstall_dialog_.get()) {
extension_uninstall_dialog_.reset(
- new ExtensionUninstallDialog(web_ui_->GetProfile()));
+ new ExtensionUninstallDialog(Profile::FromWebUI(web_ui_)));
}
return extension_uninstall_dialog_.get();
}
void ExtensionsDOMHandler::HandleToggleDeveloperMode(const ListValue* args) {
- bool developer_mode = web_ui_->GetProfile()->GetPrefs()
- ->GetBoolean(prefs::kExtensionsUIDeveloperMode);
- web_ui_->GetProfile()->GetPrefs()->SetBoolean(
- prefs::kExtensionsUIDeveloperMode, !developer_mode);
+ Profile* profile = Profile::FromWebUI(web_ui_);
+ bool developer_mode =
+ profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode);
+ profile->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode,
+ !developer_mode);
}
void ExtensionsDOMHandler::HandleInspectMessage(const ListValue* args) {
@@ -338,7 +339,7 @@ void ExtensionsDOMHandler::HandleEnableMessage(const ListValue* args) {
ExtensionPrefs* prefs = extension_service_->extension_prefs();
if (prefs->DidExtensionEscalatePermissions(extension_id)) {
ShowExtensionDisabledDialog(extension_service_,
- web_ui_->GetProfile(), extension);
+ Profile::FromWebUI(web_ui_), extension);
} else {
extension_service_->EnableExtension(extension_id);
}
@@ -450,7 +451,7 @@ void ExtensionsDOMHandler::HandleOptionsMessage(const ListValue* args) {
const Extension* extension = GetExtension(args);
if (!extension || extension->options_url().is_empty())
return;
- web_ui_->GetProfile()->GetExtensionProcessManager()->OpenOptionsPage(
+ Profile::FromWebUI(web_ui_)->GetExtensionProcessManager()->OpenOptionsPage(
extension, NULL);
}
« no previous file with comments | « chrome/browser/chromeos/accessibility_util.cc ('k') | chrome/browser/printing/cloud_print/cloud_print_setup_flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698