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 #include "chrome/browser/metrics/variations/variations_http_header_provider.h" | 5 #include "chrome/browser/metrics/variations/variations_http_header_provider.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "chrome/browser/google/google_util.h" | 11 #include "chrome/browser/google/google_util.h" |
12 #include "chrome/common/metrics/proto/chrome_experiments.pb.h" | 12 #include "chrome/common/metrics/proto/chrome_experiments.pb.h" |
13 #include "chrome/common/metrics/variations/variations_associated_data.h" | |
14 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 13 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
15 #include "net/http/http_request_headers.h" | 14 #include "net/http/http_request_headers.h" |
16 #include "url/gurl.h" | 15 #include "url/gurl.h" |
17 | 16 |
18 namespace chrome_variations { | 17 namespace chrome_variations { |
19 | 18 |
20 VariationsHttpHeaderProvider* VariationsHttpHeaderProvider::GetInstance() { | 19 VariationsHttpHeaderProvider* VariationsHttpHeaderProvider::GetInstance() { |
21 return Singleton<VariationsHttpHeaderProvider>::get(); | 20 return Singleton<VariationsHttpHeaderProvider>::get(); |
22 } | 21 } |
23 | 22 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); | 165 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); |
167 if ((tld_length == 0) || (tld_length == std::string::npos)) | 166 if ((tld_length == 0) || (tld_length == std::string::npos)) |
168 return false; | 167 return false; |
169 | 168 |
170 const std::string host_minus_tld(host, 0, host.length() - tld_length); | 169 const std::string host_minus_tld(host, 0, host.length() - tld_length); |
171 return LowerCaseEqualsASCII(host_minus_tld, "youtube.") || | 170 return LowerCaseEqualsASCII(host_minus_tld, "youtube.") || |
172 EndsWith(host_minus_tld, ".youtube.", false); | 171 EndsWith(host_minus_tld, ".youtube.", false); |
173 } | 172 } |
174 | 173 |
175 } // namespace chrome_variations | 174 } // namespace chrome_variations |
OLD | NEW |