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(extension_id_prompting_, | 797 extension_service_->UninstallExtension( |
798 false /* external_uninstall */, NULL); | 798 extension_id_prompting_, |
| 799 ExtensionService::UNINSTALL_REASON_USER_INITIATED, |
| 800 NULL); |
799 CleanupAfterUninstall(); | 801 CleanupAfterUninstall(); |
800 } | 802 } |
801 | 803 |
802 void AppLauncherHandler::ExtensionUninstallCanceled() { | 804 void AppLauncherHandler::ExtensionUninstallCanceled() { |
803 CleanupAfterUninstall(); | 805 CleanupAfterUninstall(); |
804 } | 806 } |
805 | 807 |
806 void AppLauncherHandler::ExtensionEnableFlowFinished() { | 808 void AppLauncherHandler::ExtensionEnableFlowFinished() { |
807 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); | 809 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); |
808 | 810 |
(...skipping 29 matching lines...) Expand all Loading... |
838 AppLauncherHandler::GetExtensionUninstallDialog() { | 840 AppLauncherHandler::GetExtensionUninstallDialog() { |
839 if (!extension_uninstall_dialog_.get()) { | 841 if (!extension_uninstall_dialog_.get()) { |
840 Browser* browser = chrome::FindBrowserWithWebContents( | 842 Browser* browser = chrome::FindBrowserWithWebContents( |
841 web_ui()->GetWebContents()); | 843 web_ui()->GetWebContents()); |
842 extension_uninstall_dialog_.reset( | 844 extension_uninstall_dialog_.reset( |
843 extensions::ExtensionUninstallDialog::Create( | 845 extensions::ExtensionUninstallDialog::Create( |
844 extension_service_->profile(), browser, this)); | 846 extension_service_->profile(), browser, this)); |
845 } | 847 } |
846 return extension_uninstall_dialog_.get(); | 848 return extension_uninstall_dialog_.get(); |
847 } | 849 } |
OLD | NEW |