| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/app_list/extension_uninstaller.h" | 5 #include "chrome/browser/ui/app_list/extension_uninstaller.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 9 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 10 #include "extensions/browser/extension_system.h" | 10 #include "extensions/browser/extension_system.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 void ExtensionUninstaller::Run() { | 25 void ExtensionUninstaller::Run() { |
| 26 const extensions::Extension* extension = | 26 const extensions::Extension* extension = |
| 27 extensions::ExtensionSystem::Get(profile_)->extension_service()-> | 27 extensions::ExtensionSystem::Get(profile_)->extension_service()-> |
| 28 GetInstalledExtension(app_id_); | 28 GetInstalledExtension(app_id_); |
| 29 if (!extension) { | 29 if (!extension) { |
| 30 CleanUp(); | 30 CleanUp(); |
| 31 return; | 31 return; |
| 32 } | 32 } |
| 33 controller_->OnShowChildDialog(); | 33 controller_->OnShowChildDialog(); |
| 34 dialog_.reset(ExtensionUninstallDialog::Create(profile_, NULL, this)); | 34 dialog_.reset( |
| 35 extensions::ExtensionUninstallDialog::Create(profile_, NULL, this)); |
| 35 dialog_->ConfirmUninstall(extension); | 36 dialog_->ConfirmUninstall(extension); |
| 36 } | 37 } |
| 37 | 38 |
| 38 void ExtensionUninstaller::ExtensionUninstallAccepted() { | 39 void ExtensionUninstaller::ExtensionUninstallAccepted() { |
| 39 ExtensionService* service = | 40 ExtensionService* service = |
| 40 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 41 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
| 41 const extensions::Extension* extension = | 42 const extensions::Extension* extension = |
| 42 service->GetInstalledExtension(app_id_); | 43 service->GetInstalledExtension(app_id_); |
| 43 if (extension) { | 44 if (extension) { |
| 44 service->UninstallExtension(app_id_, | 45 service->UninstallExtension(app_id_, |
| 45 false, /* external_uninstall*/ | 46 false, /* external_uninstall*/ |
| 46 NULL); | 47 NULL); |
| 47 } | 48 } |
| 48 controller_->OnCloseChildDialog(); | 49 controller_->OnCloseChildDialog(); |
| 49 CleanUp(); | 50 CleanUp(); |
| 50 } | 51 } |
| 51 | 52 |
| 52 void ExtensionUninstaller::ExtensionUninstallCanceled() { | 53 void ExtensionUninstaller::ExtensionUninstallCanceled() { |
| 53 controller_->OnCloseChildDialog(); | 54 controller_->OnCloseChildDialog(); |
| 54 CleanUp(); | 55 CleanUp(); |
| 55 } | 56 } |
| 56 | 57 |
| 57 void ExtensionUninstaller::CleanUp() { | 58 void ExtensionUninstaller::CleanUp() { |
| 58 delete this; | 59 delete this; |
| 59 } | 60 } |
| OLD | NEW |