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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "components/favicon_base/favicon_types.h" | 45 #include "components/favicon_base/favicon_types.h" |
46 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
47 #include "content/public/browser/web_ui.h" | 47 #include "content/public/browser/web_ui.h" |
48 #include "content/public/common/favicon_url.h" | 48 #include "content/public/common/favicon_url.h" |
49 #include "extensions/browser/app_sorting.h" | 49 #include "extensions/browser/app_sorting.h" |
50 #include "extensions/browser/extension_prefs.h" | 50 #include "extensions/browser/extension_prefs.h" |
51 #include "extensions/browser/extension_registry.h" | 51 #include "extensions/browser/extension_registry.h" |
52 #include "extensions/browser/extension_system.h" | 52 #include "extensions/browser/extension_system.h" |
53 #include "extensions/browser/management_policy.h" | 53 #include "extensions/browser/management_policy.h" |
54 #include "extensions/browser/pref_names.h" | 54 #include "extensions/browser/pref_names.h" |
| 55 #include "extensions/browser/uninstall_reason.h" |
55 #include "extensions/common/constants.h" | 56 #include "extensions/common/constants.h" |
56 #include "extensions/common/extension.h" | 57 #include "extensions/common/extension.h" |
57 #include "extensions/common/extension_icon_set.h" | 58 #include "extensions/common/extension_icon_set.h" |
58 #include "extensions/common/extension_set.h" | 59 #include "extensions/common/extension_set.h" |
59 #include "grit/browser_resources.h" | 60 #include "grit/browser_resources.h" |
60 #include "grit/generated_resources.h" | 61 #include "grit/generated_resources.h" |
61 #include "ui/base/l10n/l10n_util.h" | 62 #include "ui/base/l10n/l10n_util.h" |
62 #include "ui/base/webui/web_ui_util.h" | 63 #include "ui/base/webui/web_ui_util.h" |
63 #include "url/gurl.h" | 64 #include "url/gurl.h" |
64 | 65 |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 | 785 |
785 // The extension can be uninstalled in another window while the UI was | 786 // The extension can be uninstalled in another window while the UI was |
786 // showing. Do nothing in that case. | 787 // showing. Do nothing in that case. |
787 const Extension* extension = | 788 const Extension* extension = |
788 extension_service_->GetInstalledExtension(extension_id_prompting_); | 789 extension_service_->GetInstalledExtension(extension_id_prompting_); |
789 if (!extension) | 790 if (!extension) |
790 return; | 791 return; |
791 | 792 |
792 extension_service_->UninstallExtension( | 793 extension_service_->UninstallExtension( |
793 extension_id_prompting_, | 794 extension_id_prompting_, |
794 ExtensionService::UNINSTALL_REASON_USER_INITIATED, | 795 extensions::UNINSTALL_REASON_USER_INITIATED, |
795 NULL); | 796 NULL); |
796 CleanupAfterUninstall(); | 797 CleanupAfterUninstall(); |
797 } | 798 } |
798 | 799 |
799 void AppLauncherHandler::ExtensionUninstallCanceled() { | 800 void AppLauncherHandler::ExtensionUninstallCanceled() { |
800 CleanupAfterUninstall(); | 801 CleanupAfterUninstall(); |
801 } | 802 } |
802 | 803 |
803 void AppLauncherHandler::ExtensionEnableFlowFinished() { | 804 void AppLauncherHandler::ExtensionEnableFlowFinished() { |
804 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); | 805 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); |
(...skipping 30 matching lines...) Expand all Loading... |
835 AppLauncherHandler::GetExtensionUninstallDialog() { | 836 AppLauncherHandler::GetExtensionUninstallDialog() { |
836 if (!extension_uninstall_dialog_.get()) { | 837 if (!extension_uninstall_dialog_.get()) { |
837 Browser* browser = chrome::FindBrowserWithWebContents( | 838 Browser* browser = chrome::FindBrowserWithWebContents( |
838 web_ui()->GetWebContents()); | 839 web_ui()->GetWebContents()); |
839 extension_uninstall_dialog_.reset( | 840 extension_uninstall_dialog_.reset( |
840 extensions::ExtensionUninstallDialog::Create( | 841 extensions::ExtensionUninstallDialog::Create( |
841 extension_service_->profile(), browser, this)); | 842 extension_service_->profile(), browser, this)); |
842 } | 843 } |
843 return extension_uninstall_dialog_.get(); | 844 return extension_uninstall_dialog_.get(); |
844 } | 845 } |
OLD | NEW |