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

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

Issue 1130353010: Remove deprecated ExtensionService::GetInstalledExtension() usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed if to iff Created 5 years, 6 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
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"
8 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
10 #include "extensions/browser/extension_system.h" 9 #include "extensions/browser/extension_registry.h"
11 #include "extensions/browser/uninstall_reason.h" 10 #include "extensions/browser/uninstall_reason.h"
12 #include "extensions/common/extension.h" 11 #include "extensions/common/extension.h"
13 12
14 ExtensionUninstaller::ExtensionUninstaller( 13 ExtensionUninstaller::ExtensionUninstaller(
15 Profile* profile, 14 Profile* profile,
16 const std::string& extension_id, 15 const std::string& extension_id,
17 AppListControllerDelegate* controller) 16 AppListControllerDelegate* controller)
18 : profile_(profile), 17 : profile_(profile),
19 app_id_(extension_id), 18 app_id_(extension_id),
20 controller_(controller) { 19 controller_(controller) {
21 } 20 }
22 21
23 ExtensionUninstaller::~ExtensionUninstaller() { 22 ExtensionUninstaller::~ExtensionUninstaller() {
24 } 23 }
25 24
26 void ExtensionUninstaller::Run() { 25 void ExtensionUninstaller::Run() {
27 const extensions::Extension* extension = 26 const extensions::Extension* extension =
28 extensions::ExtensionSystem::Get(profile_)->extension_service()-> 27 extensions::ExtensionRegistry::Get(profile_)->GetInstalledExtension(
29 GetInstalledExtension(app_id_); 28 app_id_);
30 if (!extension) { 29 if (!extension) {
31 CleanUp(); 30 CleanUp();
32 return; 31 return;
33 } 32 }
34 controller_->OnShowChildDialog(); 33 controller_->OnShowChildDialog();
35 dialog_.reset(extensions::ExtensionUninstallDialog::Create( 34 dialog_.reset(extensions::ExtensionUninstallDialog::Create(
36 profile_, controller_->GetAppListWindow(), this)); 35 profile_, controller_->GetAppListWindow(), this));
37 dialog_->ConfirmUninstall(extension, 36 dialog_->ConfirmUninstall(extension,
38 extensions::UNINSTALL_REASON_USER_INITIATED); 37 extensions::UNINSTALL_REASON_USER_INITIATED);
39 } 38 }
40 39
41 void ExtensionUninstaller::OnExtensionUninstallDialogClosed( 40 void ExtensionUninstaller::OnExtensionUninstallDialogClosed(
42 bool did_start_uninstall, 41 bool did_start_uninstall,
43 const base::string16& error) { 42 const base::string16& error) {
44 controller_->OnCloseChildDialog(); 43 controller_->OnCloseChildDialog();
45 CleanUp(); 44 CleanUp();
46 } 45 }
47 46
48 void ExtensionUninstaller::CleanUp() { 47 void ExtensionUninstaller::CleanUp() {
49 delete this; 48 delete this;
50 } 49 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/extension_app_model_builder_unittest.cc ('k') | chrome/browser/ui/app_list/search/app_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698