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 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 extension_id_prompting_ = ""; | 817 extension_id_prompting_ = ""; |
818 } | 818 } |
819 | 819 |
820 void AppLauncherHandler::ExtensionEnableFlowAborted(bool user_initiated) { | 820 void AppLauncherHandler::ExtensionEnableFlowAborted(bool user_initiated) { |
821 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); | 821 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); |
822 | 822 |
823 // We record the histograms here because ExtensionUninstallCanceled is also | 823 // We record the histograms here because ExtensionUninstallCanceled is also |
824 // called when the extension uninstall dialog is canceled. | 824 // called when the extension uninstall dialog is canceled. |
825 const Extension* extension = | 825 const Extension* extension = |
826 extension_service_->GetExtensionById(extension_id_prompting_, true); | 826 extension_service_->GetExtensionById(extension_id_prompting_, true); |
827 std::string histogram_name = user_initiated ? | 827 std::string histogram_name = user_initiated |
828 "Extensions.Permissions_ReEnableCancel" : | 828 ? "Extensions.Permissions_ReEnableCancel2" |
829 "Extensions.Permissions_ReEnableAbort"; | 829 : "Extensions.Permissions_ReEnableAbort2"; |
830 ExtensionService::RecordPermissionMessagesHistogram( | 830 ExtensionService::RecordPermissionMessagesHistogram( |
831 extension, histogram_name.c_str()); | 831 extension, histogram_name.c_str()); |
832 | 832 |
833 extension_enable_flow_.reset(); | 833 extension_enable_flow_.reset(); |
834 CleanupAfterUninstall(); | 834 CleanupAfterUninstall(); |
835 } | 835 } |
836 | 836 |
837 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { | 837 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { |
838 if (!extension_uninstall_dialog_.get()) { | 838 if (!extension_uninstall_dialog_.get()) { |
839 Browser* browser = chrome::FindBrowserWithWebContents( | 839 Browser* browser = chrome::FindBrowserWithWebContents( |
840 web_ui()->GetWebContents()); | 840 web_ui()->GetWebContents()); |
841 extension_uninstall_dialog_.reset( | 841 extension_uninstall_dialog_.reset( |
842 ExtensionUninstallDialog::Create(extension_service_->profile(), | 842 ExtensionUninstallDialog::Create(extension_service_->profile(), |
843 browser, this)); | 843 browser, this)); |
844 } | 844 } |
845 return extension_uninstall_dialog_.get(); | 845 return extension_uninstall_dialog_.get(); |
846 } | 846 } |
OLD | NEW |