OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/containers/scoped_ptr_map.h" | 12 #include "base/containers/scoped_ptr_map.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
16 #include "chrome/browser/metrics/metrics_memory_details.h" | 16 #include "chrome/browser/metrics/metrics_memory_details.h" |
17 #include "components/metrics/metrics_service_client.h" | 17 #include "components/metrics/metrics_service_client.h" |
18 #include "components/metrics/profiler/tracking_synchronizer_observer.h" | 18 #include "components/metrics/profiler/tracking_synchronizer_observer.h" |
| 19 #include "components/omnibox/browser/omnibox_event_global_tracker.h" |
19 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
21 | 22 |
22 class ChromeOSMetricsProvider; | 23 class ChromeOSMetricsProvider; |
23 class GoogleUpdateMetricsProviderWin; | 24 class GoogleUpdateMetricsProviderWin; |
24 class PluginMetricsProvider; | 25 class PluginMetricsProvider; |
25 class PrefRegistrySimple; | 26 class PrefRegistrySimple; |
26 class PrefService; | 27 class PrefService; |
27 class ProcessResourceUsage; | 28 class ProcessResourceUsage; |
28 | 29 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // user is performing work. This is useful to allow some features to sleep, | 121 // user is performing work. This is useful to allow some features to sleep, |
121 // until the machine becomes active, such as precluding UMA uploads unless | 122 // until the machine becomes active, such as precluding UMA uploads unless |
122 // there was recent activity. | 123 // there was recent activity. |
123 void RegisterForNotifications(); | 124 void RegisterForNotifications(); |
124 | 125 |
125 // content::NotificationObserver: | 126 // content::NotificationObserver: |
126 void Observe(int type, | 127 void Observe(int type, |
127 const content::NotificationSource& source, | 128 const content::NotificationSource& source, |
128 const content::NotificationDetails& details) override; | 129 const content::NotificationDetails& details) override; |
129 | 130 |
| 131 // Called when a URL is opened from the Omnibox. |
| 132 void OnURLOpenedFromOmnibox(OmniboxLog* log); |
| 133 |
| 134 // Triggered on detection that the application has entered into a non-idle |
| 135 // state. |
| 136 void OnApplicationNotIdle(); |
| 137 |
130 #if defined(OS_WIN) | 138 #if defined(OS_WIN) |
131 // Counts (and removes) the browser crash dump attempt signals left behind by | 139 // Counts (and removes) the browser crash dump attempt signals left behind by |
132 // any previous browser processes which generated a crash dump. | 140 // any previous browser processes which generated a crash dump. |
133 void CountBrowserCrashDumpAttempts(); | 141 void CountBrowserCrashDumpAttempts(); |
134 #endif // OS_WIN | 142 #endif // OS_WIN |
135 | 143 |
136 base::ThreadChecker thread_checker_; | 144 base::ThreadChecker thread_checker_; |
137 | 145 |
138 // Weak pointer to the MetricsStateManager. | 146 // Weak pointer to the MetricsStateManager. |
139 metrics::MetricsStateManager* metrics_state_manager_; | 147 metrics::MetricsStateManager* metrics_state_manager_; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // used. | 195 // used. |
188 base::Callback<void(bool*)> cellular_callback_; | 196 base::Callback<void(bool*)> cellular_callback_; |
189 | 197 |
190 // Time of this object's creation. | 198 // Time of this object's creation. |
191 const base::TimeTicks start_time_; | 199 const base::TimeTicks start_time_; |
192 | 200 |
193 // Map of ProcessResourceUsage from render process host IDs. | 201 // Map of ProcessResourceUsage from render process host IDs. |
194 base::ScopedPtrMap<int, scoped_ptr<ProcessResourceUsage>> | 202 base::ScopedPtrMap<int, scoped_ptr<ProcessResourceUsage>> |
195 host_resource_usage_map_; | 203 host_resource_usage_map_; |
196 | 204 |
| 205 // Subscription for receiving callbacks that a URL was opened from the |
| 206 // omnibox. |
| 207 scoped_ptr<base::CallbackList<void(OmniboxLog*)>::Subscription> |
| 208 omnibox_url_opened_subscription_; |
| 209 |
197 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; | 210 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; |
198 | 211 |
199 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); | 212 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); |
200 }; | 213 }; |
201 | 214 |
202 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 215 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |