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

Side by Side Diff: chrome/browser/ui/app_list/extension_uninstaller.cc

Issue 382133003: Refactored ExtensionUninstallDialog to take a NativeWindow instead of a Browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback & todos for unfixed issues Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 14 matching lines...) Expand all
25 25
26 void ExtensionUninstaller::Run() { 26 void ExtensionUninstaller::Run() {
27 const extensions::Extension* extension = 27 const extensions::Extension* extension =
28 extensions::ExtensionSystem::Get(profile_)->extension_service()-> 28 extensions::ExtensionSystem::Get(profile_)->extension_service()->
29 GetInstalledExtension(app_id_); 29 GetInstalledExtension(app_id_);
30 if (!extension) { 30 if (!extension) {
31 CleanUp(); 31 CleanUp();
32 return; 32 return;
33 } 33 }
34 controller_->OnShowChildDialog(); 34 controller_->OnShowChildDialog();
35 dialog_.reset( 35 dialog_.reset(extensions::ExtensionUninstallDialog::Create(
36 extensions::ExtensionUninstallDialog::Create(profile_, NULL, this)); 36 profile_, controller_->GetAppListWindow(), this));
37 dialog_->ConfirmUninstall(extension); 37 dialog_->ConfirmUninstall(extension);
38 } 38 }
39 39
40 void ExtensionUninstaller::ExtensionUninstallAccepted() { 40 void ExtensionUninstaller::ExtensionUninstallAccepted() {
41 ExtensionService* service = 41 ExtensionService* service =
42 extensions::ExtensionSystem::Get(profile_)->extension_service(); 42 extensions::ExtensionSystem::Get(profile_)->extension_service();
43 const extensions::Extension* extension = 43 const extensions::Extension* extension =
44 service->GetInstalledExtension(app_id_); 44 service->GetInstalledExtension(app_id_);
45 if (extension) { 45 if (extension) {
46 service->UninstallExtension( 46 service->UninstallExtension(
47 app_id_, extensions::UNINSTALL_REASON_USER_INITIATED, NULL); 47 app_id_, extensions::UNINSTALL_REASON_USER_INITIATED, NULL);
48 } 48 }
49 controller_->OnCloseChildDialog(); 49 controller_->OnCloseChildDialog();
50 CleanUp(); 50 CleanUp();
51 } 51 }
52 52
53 void ExtensionUninstaller::ExtensionUninstallCanceled() { 53 void ExtensionUninstaller::ExtensionUninstallCanceled() {
54 controller_->OnCloseChildDialog(); 54 controller_->OnCloseChildDialog();
55 CleanUp(); 55 CleanUp();
56 } 56 }
57 57
58 void ExtensionUninstaller::CleanUp() { 58 void ExtensionUninstaller::CleanUp() {
59 delete this; 59 delete this;
60 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698