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

Side by Side Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 284103002: Replace "external_install" boolean parameter with explicit enumeration in ExtensionUninstall method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address issue exposed by failing unit test. 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
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698