| 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 // 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_METRICS_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| 10 #pragma once | 10 #pragma once |
| 11 | 11 |
| 12 #include <map> | 12 #include <map> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
| 21 #include "base/process_util.h" | 21 #include "base/process_util.h" |
| 22 #include "chrome/browser/io_thread.h" | 22 #include "chrome/browser/io_thread.h" |
| 23 #include "chrome/common/metrics/metrics_service_base.h" | 23 #include "chrome/common/metrics/metrics_service_base.h" |
| 24 #include "content/public/browser/notification_observer.h" |
| 25 #include "content/public/browser/notification_registrar.h" |
| 26 #include "content/public/browser/render_process_host.h" |
| 24 #include "content/public/common/process_type.h" | 27 #include "content/public/common/process_type.h" |
| 25 #include "content/public/common/url_fetcher_delegate.h" | 28 #include "content/public/common/url_fetcher_delegate.h" |
| 26 #include "content/public/browser/notification_observer.h" | 29 |
| 27 #include "content/public/browser/notification_registrar.h" | |
| 28 | 30 |
| 29 #if defined(OS_CHROMEOS) | 31 #if defined(OS_CHROMEOS) |
| 30 #include "chrome/browser/chromeos/external_metrics.h" | 32 #include "chrome/browser/chromeos/external_metrics.h" |
| 31 #endif | 33 #endif |
| 32 | 34 |
| 33 class BookmarkModel; | 35 class BookmarkModel; |
| 34 class BookmarkNode; | 36 class BookmarkNode; |
| 35 class MetricsReportingScheduler; | 37 class MetricsReportingScheduler; |
| 36 class PrefService; | 38 class PrefService; |
| 37 class Profile; | 39 class Profile; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 const content::NotificationDetails& details); | 253 const content::NotificationDetails& details); |
| 252 | 254 |
| 253 // Reads, increments and then sets the specified integer preference. | 255 // Reads, increments and then sets the specified integer preference. |
| 254 void IncrementPrefValue(const char* path); | 256 void IncrementPrefValue(const char* path); |
| 255 | 257 |
| 256 // Reads, increments and then sets the specified long preference that is | 258 // Reads, increments and then sets the specified long preference that is |
| 257 // stored as a string. | 259 // stored as a string. |
| 258 void IncrementLongPrefsValue(const char* path); | 260 void IncrementLongPrefsValue(const char* path); |
| 259 | 261 |
| 260 // Records a renderer process crash. | 262 // Records a renderer process crash. |
| 261 void LogRendererCrash(content::RenderProcessHost* host, | 263 void LogRendererCrash( |
| 262 base::TerminationStatus status, | 264 content::RenderProcessHost* host, |
| 263 bool was_alive); | 265 const content::RenderProcessHost::RendererClosedDetails& process_details); |
| 264 | 266 |
| 265 // Records a renderer process hang. | 267 // Records a renderer process hang. |
| 266 void LogRendererHang(); | 268 void LogRendererHang(); |
| 267 | 269 |
| 268 // Records that the browser was shut down cleanly. | 270 // Records that the browser was shut down cleanly. |
| 269 void LogCleanShutdown(); | 271 void LogCleanShutdown(); |
| 270 | 272 |
| 271 // Set the value in preferences for the number of bookmarks and folders | 273 // Set the value in preferences for the number of bookmarks and folders |
| 272 // in node. The pref key for the number of bookmarks in num_bookmarks_key and | 274 // in node. The pref key for the number of bookmarks in num_bookmarks_key and |
| 273 // the pref key for number of folders in num_folders_key. | 275 // the pref key for number of folders in num_folders_key. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 friend class InstantFieldTrial; | 413 friend class InstantFieldTrial; |
| 412 friend bool prerender::IsOmniboxEnabled(Profile* profile); | 414 friend bool prerender::IsOmniboxEnabled(Profile* profile); |
| 413 | 415 |
| 414 // Returns true if prefs::kMetricsReportingEnabled is set. | 416 // Returns true if prefs::kMetricsReportingEnabled is set. |
| 415 static bool IsMetricsReportingEnabled(); | 417 static bool IsMetricsReportingEnabled(); |
| 416 | 418 |
| 417 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 419 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 418 }; | 420 }; |
| 419 | 421 |
| 420 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 422 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |