| Index: components/data_use_measurement/core/data_use_measurement.h
|
| diff --git a/components/data_use_measurement/content/data_use_measurement.h b/components/data_use_measurement/core/data_use_measurement.h
|
| similarity index 94%
|
| rename from components/data_use_measurement/content/data_use_measurement.h
|
| rename to components/data_use_measurement/core/data_use_measurement.h
|
| index 777a50a3623196de1020e73a26db14d0e04d8f5a..328f9ed2bc2e26e4b2fba516f11113b5a25f3367 100644
|
| --- a/components/data_use_measurement/content/data_use_measurement.h
|
| +++ b/components/data_use_measurement/core/data_use_measurement.h
|
| @@ -37,7 +37,12 @@ namespace data_use_measurement {
|
| // http://crbug.com/527460
|
| class DataUseMeasurement {
|
| public:
|
| - explicit DataUseMeasurement(
|
| + typedef base::Callback<bool(const net::URLRequest&)>
|
| + IsUserInitiatedRequestCallbackType;
|
| +
|
| + DataUseMeasurement(
|
| + const IsUserInitiatedRequestCallbackType&
|
| + is_user_initiated_request_callback,
|
| const metrics::UpdateUsagePrefCallbackType& metrics_data_use_forwarder);
|
| ~DataUseMeasurement();
|
|
|
| @@ -56,9 +61,6 @@ class DataUseMeasurement {
|
| // Indicates that |request| has been completed or failed.
|
| void OnCompleted(const net::URLRequest& request, bool started);
|
|
|
| - // Returns true if the URLRequest |request| is initiated by user traffic.
|
| - static bool IsUserInitiatedRequest(const net::URLRequest& request);
|
| -
|
| #if defined(OS_ANDROID)
|
| // This function should just be used for testing purposes. A change in
|
| // application state can be simulated by calling this function.
|
| @@ -125,6 +127,9 @@ class DataUseMeasurement {
|
| bool is_connection_cellular,
|
| int64_t message_size) const;
|
|
|
| + // Callback for identifying if an URL request is user initiated.
|
| + const IsUserInitiatedRequestCallbackType is_user_initiated_request_callback_;
|
| +
|
| // Callback for updating data use prefs.
|
| // TODO(rajendrant): If a similar mechanism would need be used for components
|
| // other than metrics, then the better approach would be to refactor this
|
|
|