| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "apps/metrics_names.h" | 9 #include "apps/metrics_names.h" |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 // Do the uninstall work here. | 787 // Do the uninstall work here. |
| 788 DCHECK(!extension_id_prompting_.empty()); | 788 DCHECK(!extension_id_prompting_.empty()); |
| 789 | 789 |
| 790 // The extension can be uninstalled in another window while the UI was | 790 // The extension can be uninstalled in another window while the UI was |
| 791 // showing. Do nothing in that case. | 791 // showing. Do nothing in that case. |
| 792 const Extension* extension = | 792 const Extension* extension = |
| 793 extension_service_->GetInstalledExtension(extension_id_prompting_); | 793 extension_service_->GetInstalledExtension(extension_id_prompting_); |
| 794 if (!extension) | 794 if (!extension) |
| 795 return; | 795 return; |
| 796 | 796 |
| 797 extension_service_->UninstallExtension( | 797 extension_service_->UninstallExtension(extension_id_prompting_, |
| 798 extension_id_prompting_, | 798 false /* external_uninstall */, NULL); |
| 799 ExtensionService::UNINSTALL_REASON_USER_INITIATED, | |
| 800 NULL); | |
| 801 CleanupAfterUninstall(); | 799 CleanupAfterUninstall(); |
| 802 } | 800 } |
| 803 | 801 |
| 804 void AppLauncherHandler::ExtensionUninstallCanceled() { | 802 void AppLauncherHandler::ExtensionUninstallCanceled() { |
| 805 CleanupAfterUninstall(); | 803 CleanupAfterUninstall(); |
| 806 } | 804 } |
| 807 | 805 |
| 808 void AppLauncherHandler::ExtensionEnableFlowFinished() { | 806 void AppLauncherHandler::ExtensionEnableFlowFinished() { |
| 809 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); | 807 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); |
| 810 | 808 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 840 AppLauncherHandler::GetExtensionUninstallDialog() { | 838 AppLauncherHandler::GetExtensionUninstallDialog() { |
| 841 if (!extension_uninstall_dialog_.get()) { | 839 if (!extension_uninstall_dialog_.get()) { |
| 842 Browser* browser = chrome::FindBrowserWithWebContents( | 840 Browser* browser = chrome::FindBrowserWithWebContents( |
| 843 web_ui()->GetWebContents()); | 841 web_ui()->GetWebContents()); |
| 844 extension_uninstall_dialog_.reset( | 842 extension_uninstall_dialog_.reset( |
| 845 extensions::ExtensionUninstallDialog::Create( | 843 extensions::ExtensionUninstallDialog::Create( |
| 846 extension_service_->profile(), browser, this)); | 844 extension_service_->profile(), browser, this)); |
| 847 } | 845 } |
| 848 return extension_uninstall_dialog_.get(); | 846 return extension_uninstall_dialog_.get(); |
| 849 } | 847 } |
| OLD | NEW |