| Index: chrome/browser/extensions/extensions_ui.cc
|
| diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
|
| index 8eb68c83407ca062febc878a8f377ad46de023b8..fe4aa96ee775057c987a534b2d32b56a727d2dc5 100644
|
| --- a/chrome/browser/extensions/extensions_ui.cc
|
| +++ b/chrome/browser/extensions/extensions_ui.cc
|
| @@ -242,7 +242,8 @@ void ExtensionsDOMHandler::HandleRequestExtensionsData(const ListValue* args) {
|
| }
|
| results.Set("extensions", extensions_list);
|
|
|
| - bool developer_mode = web_ui_->GetProfile()->GetPrefs()
|
| + Profile* profile = static_cast<Profile*>(web_ui_->tab_contents()->context());
|
| + bool developer_mode = profile->GetPrefs()
|
| ->GetBoolean(prefs::kExtensionsUIDeveloperMode);
|
| results.SetBoolean("developerMode", developer_mode);
|
|
|
| @@ -281,16 +282,19 @@ void ExtensionsDOMHandler::RegisterForNotifications() {
|
|
|
| ExtensionUninstallDialog* ExtensionsDOMHandler::GetExtensionUninstallDialog() {
|
| if (!extension_uninstall_dialog_.get()) {
|
| + Profile* profile =
|
| + static_cast<Profile*>(web_ui_->tab_contents()->context());
|
| extension_uninstall_dialog_.reset(
|
| - new ExtensionUninstallDialog(web_ui_->GetProfile()));
|
| + new ExtensionUninstallDialog(profile));
|
| }
|
| return extension_uninstall_dialog_.get();
|
| }
|
|
|
| void ExtensionsDOMHandler::HandleToggleDeveloperMode(const ListValue* args) {
|
| - bool developer_mode = web_ui_->GetProfile()->GetPrefs()
|
| + Profile* profile = static_cast<Profile*>(web_ui_->tab_contents()->context());
|
| + bool developer_mode = profile->GetPrefs()
|
| ->GetBoolean(prefs::kExtensionsUIDeveloperMode);
|
| - web_ui_->GetProfile()->GetPrefs()->SetBoolean(
|
| + profile->GetPrefs()->SetBoolean(
|
| prefs::kExtensionsUIDeveloperMode, !developer_mode);
|
| }
|
|
|
| @@ -337,8 +341,10 @@ void ExtensionsDOMHandler::HandleEnableMessage(const ListValue* args) {
|
| if (enable_str == "true") {
|
| ExtensionPrefs* prefs = extension_service_->extension_prefs();
|
| if (prefs->DidExtensionEscalatePermissions(extension_id)) {
|
| + Profile* profile =
|
| + static_cast<Profile*>(web_ui_->tab_contents()->context());
|
| ShowExtensionDisabledDialog(extension_service_,
|
| - web_ui_->GetProfile(), extension);
|
| + profile, extension);
|
| } else {
|
| extension_service_->EnableExtension(extension_id);
|
| }
|
| @@ -450,8 +456,8 @@ void ExtensionsDOMHandler::HandleOptionsMessage(const ListValue* args) {
|
| const Extension* extension = GetExtension(args);
|
| if (!extension || extension->options_url().is_empty())
|
| return;
|
| - web_ui_->GetProfile()->GetExtensionProcessManager()->OpenOptionsPage(
|
| - extension, NULL);
|
| + Profile* profile = static_cast<Profile*>(web_ui_->tab_contents()->context());
|
| + profile->GetExtensionProcessManager()->OpenOptionsPage(extension, NULL);
|
| }
|
|
|
| void ExtensionsDOMHandler::HandleShowButtonMessage(const ListValue* args) {
|
| @@ -758,7 +764,7 @@ void ExtensionsDOMHandler::GetActivePagesForExtensionProcess(
|
| }
|
|
|
| result->push_back(ExtensionPage(url, process->id(), host->routing_id(),
|
| - process->profile()->IsOffTheRecord()));
|
| + process->context()->IsOffTheRecord()));
|
| }
|
| }
|
|
|
| @@ -777,15 +783,16 @@ ExtensionsDOMHandler::~ExtensionsDOMHandler() {
|
| // ExtensionsDOMHandler, public: -----------------------------------------------
|
|
|
| ExtensionsUI::ExtensionsUI(TabContents* contents) : ChromeWebUI(contents) {
|
| - ExtensionService *exstension_service =
|
| - GetProfile()->GetOriginalProfile()->GetExtensionService();
|
| + Profile* profile = static_cast<Profile*>(contents->context());
|
| + ExtensionService *extension_service =
|
| + profile->GetOriginalProfile()->GetExtensionService();
|
|
|
| - ExtensionsDOMHandler* handler = new ExtensionsDOMHandler(exstension_service);
|
| + ExtensionsDOMHandler* handler = new ExtensionsDOMHandler(extension_service);
|
| AddMessageHandler(handler);
|
| handler->Attach(this);
|
|
|
| // Set up the chrome://extensions/ source.
|
| - contents->profile()->GetChromeURLDataManager()->AddDataSource(
|
| + profile->GetChromeURLDataManager()->AddDataSource(
|
| CreateExtensionsUIHTMLSource());
|
| }
|
|
|
|
|