| 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 #include "net/url_request/url_fetcher.h" | 7 #include "net/url_request/url_fetcher.h" |
| 8 | 8 |
| 9 namespace data_use_measurement { | 9 namespace data_use_measurement { |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 return new DataUseUserData(service_name); | 23 return new DataUseUserData(service_name); |
| 24 } | 24 } |
| 25 | 25 |
| 26 // static | 26 // static |
| 27 std::string DataUseUserData::GetServiceNameAsString(ServiceName service_name) { | 27 std::string DataUseUserData::GetServiceNameAsString(ServiceName service_name) { |
| 28 switch (service_name) { | 28 switch (service_name) { |
| 29 case SUGGESTIONS: | 29 case SUGGESTIONS: |
| 30 return "Suggestions"; | 30 return "Suggestions"; |
| 31 case NOT_TAGGED: | 31 case NOT_TAGGED: |
| 32 return "NotTagged"; | 32 return "NotTagged"; |
| 33 case TRANSLATE: |
| 34 return "Translate"; |
| 35 case SYNC: |
| 36 return "Sync"; |
| 37 case OMNIBOX: |
| 38 return "Omnibox"; |
| 39 case INVALIDATION: |
| 40 return "Invalidation"; |
| 41 case RAPPOR: |
| 42 return "Rappor"; |
| 43 case VARIATIONS: |
| 44 return "Variations"; |
| 45 case UMA: |
| 46 return "UMA"; |
| 47 case DOMAIN_RELIABILITY: |
| 48 return "DomainReliability"; |
| 49 case PROFILE_DOWNLOADER: |
| 50 return "ProfileDownloader"; |
| 51 case GOOGLE_URL_TRACKER: |
| 52 return "GoogleURLTracker"; |
| 53 case AUTOFILL: |
| 54 return "Autofill"; |
| 55 case POLICY: |
| 56 return "Policy"; |
| 57 case SPELL_CHECKER: |
| 58 return "SpellChecker"; |
| 33 } | 59 } |
| 34 return "INVALID"; | 60 return "INVALID"; |
| 35 } | 61 } |
| 36 | 62 |
| 37 // static | 63 // static |
| 38 void DataUseUserData::AttachToFetcher(net::URLFetcher* fetcher, | 64 void DataUseUserData::AttachToFetcher(net::URLFetcher* fetcher, |
| 39 ServiceName service_name) { | 65 ServiceName service_name) { |
| 40 fetcher->SetURLRequestUserData(kUserDataKey, | 66 fetcher->SetURLRequestUserData(kUserDataKey, |
| 41 base::Bind(&Create, service_name)); | 67 base::Bind(&Create, service_name)); |
| 42 } | 68 } |
| 43 | 69 |
| 44 } // namespace data_use_measurement | 70 } // namespace data_use_measurement |
| OLD | NEW |