OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/android/metrics/launch_metrics.h" | 5 #include "chrome/browser/android/metrics/launch_metrics.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/metrics/user_metrics.h" | 9 #include "base/metrics/user_metrics.h" |
10 #include "chrome/browser/android/shortcut_info.h" | 10 #include "chrome/browser/android/shortcut_info.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 if (web_contents && source == ShortcutInfo::SOURCE_APP_BANNER) { | 36 if (web_contents && source == ShortcutInfo::SOURCE_APP_BANNER) { |
37 // What a user has installed on the Home screen can become disconnected from | 37 // What a user has installed on the Home screen can become disconnected from |
38 // what Chrome believes is on the Home screen if the user clears their data. | 38 // what Chrome believes is on the Home screen if the user clears their data. |
39 // Use the launch as a signal that the shortcut still exists. | 39 // Use the launch as a signal that the shortcut still exists. |
40 AppBannerSettingsHelper::RecordBannerEvent( | 40 AppBannerSettingsHelper::RecordBannerEvent( |
41 web_contents, url, url.spec(), | 41 web_contents, url, url.spec(), |
42 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, | 42 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, |
43 base::Time::Now()); | 43 base::Time::Now()); |
44 } | 44 } |
45 | 45 |
46 int action = standalone ? HOME_SCREEN_LAUNCH_STANDALONE | 46 std::string rappor_metric_source; |
47 : HOME_SCREEN_LAUNCH_SHORTCUT; | 47 if (source == ShortcutInfo::SOURCE_ADD_TO_HOMESCREEN) |
48 std::string rappor_metric = standalone ? "Launch.HomeScreen.Standalone" | 48 rappor_metric_source = "Launch.HomeScreenSource.AddToHomeScreen"; |
49 : "Launch.HomeScreen.Shortcut"; | 49 else if (source == ShortcutInfo::SOURCE_APP_BANNER) |
50 | 50 rappor_metric_source = "Launch.HomeScreenSource.AppBanner"; |
51 UMA_HISTOGRAM_ENUMERATION("Launch.HomeScreen", action, | 51 else |
52 HOME_SCREEN_LAUNCH_COUNT); | 52 rappor_metric_source = "Launch.HomeScreenSource.Unknown"; |
53 | 53 |
54 UMA_HISTOGRAM_ENUMERATION("Launch.HomeScreenSource", source, | 54 UMA_HISTOGRAM_ENUMERATION("Launch.HomeScreenSource", source, |
55 ShortcutInfo::SOURCE_COUNT); | 55 ShortcutInfo::SOURCE_COUNT); |
56 | 56 |
57 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 57 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
58 rappor_metric, url); | 58 rappor_metric_source, url); |
| 59 |
| 60 int action = standalone ? HOME_SCREEN_LAUNCH_STANDALONE |
| 61 : HOME_SCREEN_LAUNCH_SHORTCUT; |
| 62 std::string rappor_metric_action = standalone ? "Launch.HomeScreen.Standalone" |
| 63 : "Launch.HomeScreen.Shortcut"; |
| 64 |
| 65 UMA_HISTOGRAM_ENUMERATION("Launch.HomeScreen", action, |
| 66 HOME_SCREEN_LAUNCH_COUNT); |
| 67 |
| 68 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
| 69 rappor_metric_action, url); |
59 } | 70 } |
60 | 71 |
61 }; // namespace metrics | 72 }; // namespace metrics |
OLD | NEW |