| 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 "components/variations/service/variations_service.h" | 5 #include "components/variations/service/variations_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 const base::Version& version) { | 625 const base::Version& version) { |
| 626 std::unique_ptr<ClientFilterableState> state = | 626 std::unique_ptr<ClientFilterableState> state = |
| 627 base::MakeUnique<ClientFilterableState>(); | 627 base::MakeUnique<ClientFilterableState>(); |
| 628 state->locale = client_->GetApplicationLocale(); | 628 state->locale = client_->GetApplicationLocale(); |
| 629 state->reference_date = GetReferenceDateForExpiryChecks(local_state_); | 629 state->reference_date = GetReferenceDateForExpiryChecks(local_state_); |
| 630 state->version = version; | 630 state->version = version; |
| 631 state->channel = GetChannelForVariations(client_->GetChannel()); | 631 state->channel = GetChannelForVariations(client_->GetChannel()); |
| 632 state->form_factor = GetCurrentFormFactor(); | 632 state->form_factor = GetCurrentFormFactor(); |
| 633 state->platform = ClientFilterableState::GetCurrentPlatform(); | 633 state->platform = ClientFilterableState::GetCurrentPlatform(); |
| 634 state->hardware_class = GetHardwareClass(); | 634 state->hardware_class = GetHardwareClass(); |
| 635 #if defined(OS_ANDROID) |
| 636 // This is set on Android only currently, because the IsLowEndDevice() API |
| 637 // on other platforms has no intrinsic meaning outside of a field trial that |
| 638 // controls its value. Since this is before server-side field trials are |
| 639 // evaluated, that field trial would not be able to apply for this case. |
| 640 state->is_low_end_device = base::SysInfo::IsLowEndDevice(); |
| 641 #endif |
| 635 state->session_consistency_country = GetLatestCountry(); | 642 state->session_consistency_country = GetLatestCountry(); |
| 636 state->permanent_consistency_country = LoadPermanentConsistencyCountry( | 643 state->permanent_consistency_country = LoadPermanentConsistencyCountry( |
| 637 version, state->session_consistency_country); | 644 version, state->session_consistency_country); |
| 638 return state; | 645 return state; |
| 639 } | 646 } |
| 640 | 647 |
| 641 void VariationsService::FetchVariationsSeed() { | 648 void VariationsService::FetchVariationsSeed() { |
| 642 DCHECK(thread_checker_.CalledOnValidThread()); | 649 DCHECK(thread_checker_.CalledOnValidThread()); |
| 643 | 650 |
| 644 const web_resource::ResourceRequestAllowedNotifier::State state = | 651 const web_resource::ResourceRequestAllowedNotifier::State state = |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 std::string VariationsService::GetLatestCountry() const { | 941 std::string VariationsService::GetLatestCountry() const { |
| 935 const std::string override_country = | 942 const std::string override_country = |
| 936 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 943 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 937 switches::kVariationsOverrideCountry); | 944 switches::kVariationsOverrideCountry); |
| 938 return !override_country.empty() | 945 return !override_country.empty() |
| 939 ? override_country | 946 ? override_country |
| 940 : local_state_->GetString(prefs::kVariationsCountry); | 947 : local_state_->GetString(prefs::kVariationsCountry); |
| 941 } | 948 } |
| 942 | 949 |
| 943 } // namespace variations | 950 } // namespace variations |
| OLD | NEW |