Chromium Code Reviews| 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 { |