| 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/chrome_browser_field_trials.h" | 5 #include "chrome/browser/chrome_browser_field_trials.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 if (ui::GetDisplayLayout() != ui::LAYOUT_DESKTOP || using_hidpi_assets) | 533 if (ui::GetDisplayLayout() != ui::LAYOUT_DESKTOP || using_hidpi_assets) |
| 534 trial->Disable(); | 534 trial->Disable(); |
| 535 } | 535 } |
| 536 } | 536 } |
| 537 | 537 |
| 538 void ChromeBrowserFieldTrials::SetUpSafeBrowsingInterstitialFieldTrial() { | 538 void ChromeBrowserFieldTrials::SetUpSafeBrowsingInterstitialFieldTrial() { |
| 539 const base::FieldTrial::Probability kDivisor = 100; | 539 const base::FieldTrial::Probability kDivisor = 100; |
| 540 const base::FieldTrial::Probability kVersion2Probability = 50; // 50% prob. | 540 const base::FieldTrial::Probability kVersion2Probability = 50; // 50% prob. |
| 541 scoped_refptr<base::FieldTrial> trial( | 541 scoped_refptr<base::FieldTrial> trial( |
| 542 base::FieldTrialList::FactoryGetFieldTrial("SBInterstitial", kDivisor, | 542 base::FieldTrialList::FactoryGetFieldTrial("SBInterstitial", kDivisor, |
| 543 "V1", 2012, 9, 19, NULL)); | 543 "V1", 2012, 10, 23, NULL)); |
| 544 trial->UseOneTimeRandomization(); | 544 trial->UseOneTimeRandomization(); |
| 545 trial->AppendGroup("V2", kVersion2Probability); | 545 trial->AppendGroup("V2", kVersion2Probability); |
| 546 } | 546 } |
| 547 | 547 |
| 548 void ChromeBrowserFieldTrials::SetUpInfiniteCacheFieldTrial() { | 548 void ChromeBrowserFieldTrials::SetUpInfiniteCacheFieldTrial() { |
| 549 const base::FieldTrial::Probability kDivisor = 100; | 549 const base::FieldTrial::Probability kDivisor = 100; |
| 550 | 550 |
| 551 #if (defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_IOS)) | 551 #if (defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_IOS)) |
| 552 base::FieldTrial::Probability infinite_cache_probability = 0; | 552 base::FieldTrial::Probability infinite_cache_probability = 0; |
| 553 #else | 553 #else |
| 554 base::FieldTrial::Probability infinite_cache_probability = 1; | 554 base::FieldTrial::Probability infinite_cache_probability = 1; |
| 555 #endif | 555 #endif |
| 556 | 556 |
| 557 if (parsed_command_line_.HasSwitch(switches::kDisableInfiniteCache)) | 557 if (parsed_command_line_.HasSwitch(switches::kDisableInfiniteCache)) |
| 558 infinite_cache_probability = 0; | 558 infinite_cache_probability = 0; |
| 559 | 559 |
| 560 scoped_refptr<base::FieldTrial> trial( | 560 scoped_refptr<base::FieldTrial> trial( |
| 561 base::FieldTrialList::FactoryGetFieldTrial("InfiniteCache", kDivisor, | 561 base::FieldTrialList::FactoryGetFieldTrial("InfiniteCache", kDivisor, |
| 562 "No", 2013, 12, 31, NULL)); | 562 "No", 2013, 12, 31, NULL)); |
| 563 trial->UseOneTimeRandomization(); | 563 trial->UseOneTimeRandomization(); |
| 564 trial->AppendGroup("Yes", infinite_cache_probability); | 564 trial->AppendGroup("Yes", infinite_cache_probability); |
| 565 trial->AppendGroup("Control", infinite_cache_probability); | 565 trial->AppendGroup("Control", infinite_cache_probability); |
| 566 } | 566 } |
| OLD | NEW |