| 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_service.h" | 5 #include "chrome/browser/metrics/variations_service.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/build_time.h" | 10 #include "base/build_time.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/version.h" | 15 #include "base/version.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/metrics/proto/trials_seed.pb.h" | 17 #include "chrome/browser/metrics/proto/trials_seed.pb.h" |
| 18 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
| 19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/metrics/experiments_helper.h" | 20 #include "chrome/common/metrics/variations_util.h" |
| 21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| 23 #include "content/public/common/url_fetcher.h" | 23 #include "content/public/common/url_fetcher.h" |
| 24 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
| 25 #include "net/base/load_flags.h" | 25 #include "net/base/load_flags.h" |
| 26 #include "net/base/network_change_notifier.h" | 26 #include "net/base/network_change_notifier.h" |
| 27 #include "net/http/http_response_headers.h" | 27 #include "net/http/http_response_headers.h" |
| 28 #include "net/url_request/url_fetcher.h" | 28 #include "net/url_request/url_fetcher.h" |
| 29 #include "net/url_request/url_request_status.h" | 29 #include "net/url_request/url_request_status.h" |
| 30 | 30 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 } | 452 } |
| 453 | 453 |
| 454 for (int i = 0; i < study.experiment_size(); ++i) { | 454 for (int i = 0; i < study.experiment_size(); ++i) { |
| 455 const Study_Experiment& experiment = study.experiment(i); | 455 const Study_Experiment& experiment = study.experiment(i); |
| 456 if (experiment.name() != study.default_experiment_name()) | 456 if (experiment.name() != study.default_experiment_name()) |
| 457 trial->AppendGroup(experiment.name(), experiment.probability_weight()); | 457 trial->AppendGroup(experiment.name(), experiment.probability_weight()); |
| 458 | 458 |
| 459 if (experiment.has_experiment_id()) { | 459 if (experiment.has_experiment_id()) { |
| 460 const VariationID variation_id = | 460 const VariationID variation_id = |
| 461 static_cast<VariationID>(experiment.experiment_id()); | 461 static_cast<VariationID>(experiment.experiment_id()); |
| 462 experiments_helper::AssociateGoogleVariationIDForce(study.name(), | 462 AssociateGoogleVariationIDForce(study.name(), |
| 463 experiment.name(), | 463 experiment.name(), |
| 464 variation_id); | 464 variation_id); |
| 465 } | 465 } |
| 466 } | 466 } |
| 467 | 467 |
| 468 trial->SetForced(); | 468 trial->SetForced(); |
| 469 if (IsStudyExpired(study, reference_date)) | 469 if (IsStudyExpired(study, reference_date)) |
| 470 trial->Disable(); | 470 trial->Disable(); |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace chrome_variations | 473 } // namespace chrome_variations |
| OLD | NEW |