Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: trunk/src/chrome/browser/metrics/metrics_state_manager.h

Issue 296703008: Revert 271798 "[Metrics] Make MetricsStateManager take a callbac..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/metrics/metrics_state_manager.h
===================================================================
--- trunk/src/chrome/browser/metrics/metrics_state_manager.h (revision 271821)
+++ trunk/src/chrome/browser/metrics/metrics_state_manager.h (working copy)
@@ -8,7 +8,6 @@
#include <string>
#include "base/basictypes.h"
-#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
@@ -28,6 +27,8 @@
virtual ~MetricsStateManager();
// Returns true if the user opted in to sending metric reports.
+ // TODO(asvitkine): This function does not report the correct value on
+ // Android, see http://crbug.com/362192.
bool IsMetricsReportingEnabled();
// Returns the client ID for this client, or the empty string if the user is
@@ -55,9 +56,7 @@
// Creates the MetricsStateManager, enforcing that only a single instance
// of the class exists at a time. Returns NULL if an instance exists already.
- static scoped_ptr<MetricsStateManager> Create(
- PrefService* local_state,
- const base::Callback<bool(void)>& is_reporting_enabled_callback);
+ static scoped_ptr<MetricsStateManager> Create(PrefService* local_state);
// Registers local state prefs used by this class.
static void RegisterPrefs(PrefRegistrySimple* registry);
@@ -79,13 +78,10 @@
ENTROPY_SOURCE_HIGH,
};
- // Creates the MetricsStateManager with the given |local_state|. Calls
- // |is_reporting_enabled_callback| to query whether metrics reporting is
- // enabled. Clients should instead use Create(), which enforces a single
- // instance of this class is alive at any given time.
- MetricsStateManager(
- PrefService* local_state,
- const base::Callback<bool(void)>& is_reporting_enabled_callback);
+ // Creates the MetricsStateManager with the given |local_state|. Clients
+ // should instead use Create(), which enforces a single instance of this class
+ // is alive at any given time.
+ explicit MetricsStateManager(PrefService* local_state);
// Returns the low entropy source for this client. This is a random value
// that is non-identifying amongst browser clients. This method will
@@ -108,10 +104,8 @@
static bool instance_exists_;
// Weak pointer to the local state prefs store.
- PrefService* const local_state_;
+ PrefService* local_state_;
- const base::Callback<bool(void)> is_reporting_enabled_callback_;
-
// The identifier that's sent to the server with the log reports.
std::string client_id_;

Powered by Google App Engine
This is Rietveld 408576698