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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 extension_id_prompting_ = ""; | 805 extension_id_prompting_ = ""; |
806 } | 806 } |
807 | 807 |
808 void AppLauncherHandler::ExtensionEnableFlowAborted(bool user_initiated) { | 808 void AppLauncherHandler::ExtensionEnableFlowAborted(bool user_initiated) { |
809 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); | 809 DCHECK_EQ(extension_id_prompting_, extension_enable_flow_->extension_id()); |
810 | 810 |
811 // We record the histograms here because ExtensionUninstallCanceled is also | 811 // We record the histograms here because ExtensionUninstallCanceled is also |
812 // called when the extension uninstall dialog is canceled. | 812 // called when the extension uninstall dialog is canceled. |
813 const Extension* extension = | 813 const Extension* extension = |
814 extension_service_->GetExtensionById(extension_id_prompting_, true); | 814 extension_service_->GetExtensionById(extension_id_prompting_, true); |
815 std::string histogram_name = user_initiated | 815 std::string histogram_name = user_initiated ? "ReEnableCancel" |
816 ? "Extensions.Permissions_ReEnableCancel2" | 816 : "ReEnableAbort"; |
817 : "Extensions.Permissions_ReEnableAbort2"; | |
818 ExtensionService::RecordPermissionMessagesHistogram( | 817 ExtensionService::RecordPermissionMessagesHistogram( |
819 extension, histogram_name.c_str()); | 818 extension, histogram_name.c_str()); |
820 | 819 |
821 extension_enable_flow_.reset(); | 820 extension_enable_flow_.reset(); |
822 CleanupAfterUninstall(); | 821 CleanupAfterUninstall(); |
823 } | 822 } |
824 | 823 |
825 extensions::ExtensionUninstallDialog* | 824 extensions::ExtensionUninstallDialog* |
826 AppLauncherHandler::GetExtensionUninstallDialog() { | 825 AppLauncherHandler::GetExtensionUninstallDialog() { |
827 if (!extension_uninstall_dialog_.get()) { | 826 if (!extension_uninstall_dialog_.get()) { |
(...skipping 22 matching lines...) Expand all Loading... |
850 base::FundamentalValue(!extension_id_prompting_.empty())); | 849 base::FundamentalValue(!extension_id_prompting_.empty())); |
851 } | 850 } |
852 | 851 |
853 bool AppLauncherHandler::ShouldShow(const Extension* extension) const { | 852 bool AppLauncherHandler::ShouldShow(const Extension* extension) const { |
854 if (ignore_changes_ || !has_loaded_apps_ || !extension->is_app()) | 853 if (ignore_changes_ || !has_loaded_apps_ || !extension->is_app()) |
855 return false; | 854 return false; |
856 | 855 |
857 Profile* profile = Profile::FromWebUI(web_ui()); | 856 Profile* profile = Profile::FromWebUI(web_ui()); |
858 return extensions::ui_util::ShouldDisplayInNewTabPage(extension, profile); | 857 return extensions::ui_util::ShouldDisplayInNewTabPage(extension, profile); |
859 } | 858 } |
OLD | NEW |