| 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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 extension_id_prompting_ = ""; | 845 extension_id_prompting_ = ""; |
| 846 } | 846 } |
| 847 | 847 |
| 848 void AppLauncherHandler::ExtensionEnableFlowAborted(bool user_initiated) { | 848 void AppLauncherHandler::ExtensionEnableFlowAborted(bool user_initiated) { |
| 849 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); | 849 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); |
| 850 | 850 |
| 851 // We record the histograms here because ExtensionUninstallCanceled is also | 851 // We record the histograms here because ExtensionUninstallCanceled is also |
| 852 // called when the extension uninstall dialog is canceled. | 852 // called when the extension uninstall dialog is canceled. |
| 853 const Extension* extension = | 853 const Extension* extension = |
| 854 extension_service_->GetExtensionById(extension_id_prompting_, true); | 854 extension_service_->GetExtensionById(extension_id_prompting_, true); |
| 855 std::string histogram_name = user_initiated | 855 std::string histogram_name = user_initiated ? "ReEnableCancel" |
| 856 ? "Extensions.Permissions_ReEnableCancel2" | 856 : "ReEnableAbort"; |
| 857 : "Extensions.Permissions_ReEnableAbort2"; | |
| 858 ExtensionService::RecordPermissionMessagesHistogram( | 857 ExtensionService::RecordPermissionMessagesHistogram( |
| 859 extension, histogram_name.c_str()); | 858 extension, histogram_name.c_str()); |
| 860 | 859 |
| 861 extension_enable_flow_.reset(); | 860 extension_enable_flow_.reset(); |
| 862 CleanupAfterUninstall(); | 861 CleanupAfterUninstall(); |
| 863 } | 862 } |
| 864 | 863 |
| 865 extensions::ExtensionUninstallDialog* | 864 extensions::ExtensionUninstallDialog* |
| 866 AppLauncherHandler::GetExtensionUninstallDialog() { | 865 AppLauncherHandler::GetExtensionUninstallDialog() { |
| 867 if (!extension_uninstall_dialog_.get()) { | 866 if (!extension_uninstall_dialog_.get()) { |
| 868 Browser* browser = chrome::FindBrowserWithWebContents( | 867 Browser* browser = chrome::FindBrowserWithWebContents( |
| 869 web_ui()->GetWebContents()); | 868 web_ui()->GetWebContents()); |
| 870 extension_uninstall_dialog_.reset( | 869 extension_uninstall_dialog_.reset( |
| 871 extensions::ExtensionUninstallDialog::Create( | 870 extensions::ExtensionUninstallDialog::Create( |
| 872 extension_service_->profile(), | 871 extension_service_->profile(), |
| 873 browser->window()->GetNativeWindow(), | 872 browser->window()->GetNativeWindow(), |
| 874 this)); | 873 this)); |
| 875 } | 874 } |
| 876 return extension_uninstall_dialog_.get(); | 875 return extension_uninstall_dialog_.get(); |
| 877 } | 876 } |
| OLD | NEW |