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

Unified Diff: chrome/browser/extensions/api/management/chrome_management_api_delegate.cc

Issue 948413005: [Extensions] Make chrome://extensions use management.uninstall (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/api/management/chrome_management_api_delegate.cc
diff --git a/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc b/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
index a7dec4067e2fc10a68cdb26f4d961df68bbb46fc..e5f2a75085f931379a013e78ba090c0eda5e2f8d 100644
--- a/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
+++ b/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
@@ -80,17 +80,19 @@ class ManagementUninstallFunctionUninstallDialogDelegate
extensions::ExtensionRegistry::Get(function->browser_context())
->GetExtensionById(target_extension_id,
extensions::ExtensionRegistry::EVERYTHING);
- content::WebContents* web_contents = function->GetAssociatedWebContents();
+ content::WebContents* web_contents = function->GetSenderWebContents();
extension_uninstall_dialog_.reset(
extensions::ExtensionUninstallDialog::Create(
Profile::FromBrowserContext(function->browser_context()),
- web_contents ? web_contents->GetTopLevelNativeWindow() : NULL,
+ web_contents ? web_contents->GetTopLevelNativeWindow() : nullptr,
this));
- if (function->extension_id() != target_extension_id) {
+ if (function->extension() &&
+ function->extension_id() != target_extension_id) {
extension_uninstall_dialog_->ConfirmProgrammaticUninstall(
target_extension, function->extension());
} else {
- // If this is a self uninstall, show the generic uninstall dialog.
+ // If this is a self uninstall, or triggered by webui (in which case
not at google - send to devlin 2015/02/25 21:37:57 This decision belongs in the API implementation, n
Devlin 2015/02/25 23:12:47 Done.
+ // function->extension() is null), show the generic uninstall dialog.
extension_uninstall_dialog_->ConfirmUninstall(target_extension);
}
}
@@ -104,9 +106,11 @@ class ManagementUninstallFunctionUninstallDialogDelegate
function_->ExtensionUninstallCanceled();
}
- protected:
+ private:
extensions::ManagementUninstallFunctionBase* function_;
scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_;
+
+ DISALLOW_COPY_AND_ASSIGN(ManagementUninstallFunctionUninstallDialogDelegate);
};
class ChromeAppForLinkDelegate : public extensions::AppForLinkDelegate {

Powered by Google App Engine
This is Rietveld 408576698