OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/data_use_measurement/core/data_use_user_data.h" | 5 #include "components/data_use_measurement/core/data_use_user_data.h" |
6 | 6 |
7 #if defined(OS_ANDROID) | 7 #if defined(OS_ANDROID) |
8 #include "base/android/application_status_listener.h" | 8 #include "base/android/application_status_listener.h" |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 : DataUseUserData::BACKGROUND; | 22 : DataUseUserData::BACKGROUND; |
23 #else | 23 #else |
24 // If the OS is not Android, all the requests are considered Foreground. | 24 // If the OS is not Android, all the requests are considered Foreground. |
25 return DataUseUserData::FOREGROUND; | 25 return DataUseUserData::FOREGROUND; |
26 #endif | 26 #endif |
27 } | 27 } |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 DataUseUserData::DataUseUserData(ServiceName service_name, AppState app_state) | 31 DataUseUserData::DataUseUserData(ServiceName service_name, AppState app_state) |
32 : service_name_(service_name), app_state_(app_state) {} | 32 : service_name_(service_name), |
| 33 app_state_(app_state), |
| 34 content_type_(DataUseContentType::OTHER) {} |
33 | 35 |
34 DataUseUserData::~DataUseUserData() {} | 36 DataUseUserData::~DataUseUserData() {} |
35 | 37 |
36 // static | 38 // static |
37 const void* const DataUseUserData::kUserDataKey = | 39 const void* const DataUseUserData::kUserDataKey = |
38 &DataUseUserData::kUserDataKey; | 40 &DataUseUserData::kUserDataKey; |
39 | 41 |
40 // static | 42 // static |
41 base::SupportsUserData::Data* DataUseUserData::Create( | 43 base::SupportsUserData::Data* DataUseUserData::Create( |
42 ServiceName service_name) { | 44 ServiceName service_name) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 105 } |
104 | 106 |
105 // static | 107 // static |
106 void DataUseUserData::AttachToFetcher(net::URLFetcher* fetcher, | 108 void DataUseUserData::AttachToFetcher(net::URLFetcher* fetcher, |
107 ServiceName service_name) { | 109 ServiceName service_name) { |
108 fetcher->SetURLRequestUserData(kUserDataKey, | 110 fetcher->SetURLRequestUserData(kUserDataKey, |
109 base::Bind(&Create, service_name)); | 111 base::Bind(&Create, service_name)); |
110 } | 112 } |
111 | 113 |
112 } // namespace data_use_measurement | 114 } // namespace data_use_measurement |
OLD | NEW |