OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file defines a service that collects information about the user | 5 // This file defines a service that collects information about the user |
6 // experience in order to help improve future versions of the app. | 6 // experience in order to help improve future versions of the app. |
7 | 7 |
8 #ifndef CHROME_BROWSER_METRICS_SERVICE_H__ | 8 #ifndef CHROME_BROWSER_METRICS_SERVICE_H__ |
9 #define CHROME_BROWSER_METRICS_SERVICE_H__ | 9 #define CHROME_BROWSER_METRICS_SERVICE_H__ |
10 | 10 |
11 #include <list> | 11 #include <list> |
12 #include <map> | 12 #include <map> |
13 #include <set> | 13 #include <set> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
18 #include "base/histogram.h" | 18 #include "base/histogram.h" |
19 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
20 #include "base/values.h" | 20 #include "base/values.h" |
21 #include "chrome/browser/metrics_log.h" | 21 #include "chrome/browser/metrics_log.h" |
22 #include "chrome/browser/url_fetcher.h" | 22 #include "chrome/browser/url_fetcher.h" |
23 #include "chrome/common/notification_service.h" | 23 #include "chrome/common/notification_service.h" |
24 #include "webkit/glue/webplugin.h" | 24 #include "webkit/glue/webplugin.h" |
25 | 25 |
26 class BookmarkBarModel; | 26 class BookmarkModel; |
27 class BookmarkBarNode; | 27 class BookmarkNode; |
28 class PrefService; | 28 class PrefService; |
29 class Profile; | 29 class Profile; |
30 class TemplateURLModel; | 30 class TemplateURLModel; |
31 | 31 |
32 // This is used to quickly log stats from plugin-related notifications in | 32 // This is used to quickly log stats from plugin-related notifications in |
33 // MetricsService::plugin_stats_buffer_. The buffer's contents are transferred | 33 // MetricsService::plugin_stats_buffer_. The buffer's contents are transferred |
34 // out when Local State is periodically saved. The information is then | 34 // out when Local State is periodically saved. The information is then |
35 // reported to the UMA server on next launch. | 35 // reported to the UMA server on next launch. |
36 struct PluginStats { | 36 struct PluginStats { |
37 public: | 37 public: |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 // Records a renderer process hang. | 222 // Records a renderer process hang. |
223 void LogRendererHang(); | 223 void LogRendererHang(); |
224 | 224 |
225 // Records the desktop security status of a renderer in the sandbox at | 225 // Records the desktop security status of a renderer in the sandbox at |
226 // creation time. | 226 // creation time. |
227 void LogRendererInSandbox(bool on_sandbox_desktop); | 227 void LogRendererInSandbox(bool on_sandbox_desktop); |
228 | 228 |
229 // Set the value in preferences for for the number of bookmarks and folders | 229 // Set the value in preferences for for the number of bookmarks and folders |
230 // in node. The pref key for the number of bookmarks in num_bookmarks_key and | 230 // in node. The pref key for the number of bookmarks in num_bookmarks_key and |
231 // the pref key for number of folders in num_folders_key. | 231 // the pref key for number of folders in num_folders_key. |
232 void LogBookmarks(BookmarkBarNode* node, | 232 void LogBookmarks(BookmarkNode* node, |
233 const wchar_t* num_bookmarks_key, | 233 const wchar_t* num_bookmarks_key, |
234 const wchar_t* num_folders_key); | 234 const wchar_t* num_folders_key); |
235 | 235 |
236 // Sets preferences for the for the number of bookmarks in model. | 236 // Sets preferences for the for the number of bookmarks in model. |
237 void LogBookmarks(BookmarkBarModel* model); | 237 void LogBookmarks(BookmarkModel* model); |
238 | 238 |
239 // Records a plugin-related notification. These are recorded to an in-object | 239 // Records a plugin-related notification. These are recorded to an in-object |
240 // buffer because these notifications are sent on page load, and we don't | 240 // buffer because these notifications are sent on page load, and we don't |
241 // want to slow that down. | 241 // want to slow that down. |
242 void LogPluginChange(NotificationType type, | 242 void LogPluginChange(NotificationType type, |
243 const NotificationSource& source, | 243 const NotificationSource& source, |
244 const NotificationDetails& details); | 244 const NotificationDetails& details); |
245 | 245 |
246 // Logs keywords specific metrics. Keyword metrics are recorded in the | 246 // Logs keywords specific metrics. Keyword metrics are recorded in the |
247 // profile specific metrics. | 247 // profile specific metrics. |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 350 |
351 // Indicate that a timer for sending the next log has already been queued, | 351 // Indicate that a timer for sending the next log has already been queued, |
352 // or that a URLFetch (i.e., log transmission) is in progress. | 352 // or that a URLFetch (i.e., log transmission) is in progress. |
353 bool timer_pending_; | 353 bool timer_pending_; |
354 | 354 |
355 DISALLOW_EVIL_CONSTRUCTORS(MetricsService); | 355 DISALLOW_EVIL_CONSTRUCTORS(MetricsService); |
356 }; | 356 }; |
357 | 357 |
358 #endif // CHROME_BROWSER_METRICS_SERVICE_H__ | 358 #endif // CHROME_BROWSER_METRICS_SERVICE_H__ |
359 | 359 |
OLD | NEW |