| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 | 830 |
| 831 void AppLauncherHandler::CleanupAfterUninstall() { | 831 void AppLauncherHandler::CleanupAfterUninstall() { |
| 832 extension_id_prompting_.clear(); | 832 extension_id_prompting_.clear(); |
| 833 } | 833 } |
| 834 | 834 |
| 835 // static | 835 // static |
| 836 void AppLauncherHandler::RecordAppLaunchType( | 836 void AppLauncherHandler::RecordAppLaunchType( |
| 837 extension_misc::AppLaunchBucket bucket) { | 837 extension_misc::AppLaunchBucket bucket) { |
| 838 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, bucket, | 838 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, bucket, |
| 839 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 839 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
| 840 | |
| 841 static const bool webstore_link_experiment_exists = | |
| 842 base::FieldTrialList::TrialExists(kWebStoreLinkExperiment); | |
| 843 if (webstore_link_experiment_exists) { | |
| 844 UMA_HISTOGRAM_ENUMERATION( | |
| 845 base::FieldTrial::MakeName(extension_misc::kAppLaunchHistogram, | |
| 846 kWebStoreLinkExperiment), | |
| 847 bucket, | |
| 848 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | |
| 849 } | |
| 850 } | 840 } |
| 851 | 841 |
| 852 // static | 842 // static |
| 853 void AppLauncherHandler::RecordWebStoreLaunch(bool promo_active) { | 843 void AppLauncherHandler::RecordWebStoreLaunch(bool promo_active) { |
| 854 RecordAppLaunchType(extension_misc::APP_LAUNCH_NTP_WEBSTORE); | 844 RecordAppLaunchType(extension_misc::APP_LAUNCH_NTP_WEBSTORE); |
| 855 | 845 |
| 856 if (!promo_active) return; | 846 if (!promo_active) return; |
| 857 | 847 |
| 858 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppsPromoHistogram, | 848 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppsPromoHistogram, |
| 859 extension_misc::PROMO_LAUNCH_WEB_STORE, | 849 extension_misc::PROMO_LAUNCH_WEB_STORE, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 | 982 |
| 993 void AppLauncherHandler::UninstallDefaultApps() { | 983 void AppLauncherHandler::UninstallDefaultApps() { |
| 994 AppsPromo* apps_promo = extension_service_->apps_promo(); | 984 AppsPromo* apps_promo = extension_service_->apps_promo(); |
| 995 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); | 985 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); |
| 996 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); | 986 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); |
| 997 iter != app_ids.end(); ++iter) { | 987 iter != app_ids.end(); ++iter) { |
| 998 if (extension_service_->GetExtensionById(*iter, true)) | 988 if (extension_service_->GetExtensionById(*iter, true)) |
| 999 extension_service_->UninstallExtension(*iter, false, NULL); | 989 extension_service_->UninstallExtension(*iter, false, NULL); |
| 1000 } | 990 } |
| 1001 } | 991 } |
| OLD | NEW |