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_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 | 626 |
627 // Create field trials without activating them, so that this behaves in a | 627 // Create field trials without activating them, so that this behaves in a |
628 // consistent manner with field trials created from the server. | 628 // consistent manner with field trials created from the server. |
629 bool result = base::FieldTrialList::CreateTrialsFromString( | 629 bool result = base::FieldTrialList::CreateTrialsFromString( |
630 command_line->GetSwitchValueASCII(switches::kForceFieldTrials), | 630 command_line->GetSwitchValueASCII(switches::kForceFieldTrials), |
631 base::FieldTrialList::DONT_ACTIVATE_TRIALS, | 631 base::FieldTrialList::DONT_ACTIVATE_TRIALS, |
632 unforceable_field_trials); | 632 unforceable_field_trials); |
633 CHECK(result) << "Invalid --" << switches::kForceFieldTrials | 633 CHECK(result) << "Invalid --" << switches::kForceFieldTrials |
634 << " list specified."; | 634 << " list specified."; |
635 } | 635 } |
| 636 |
| 637 #if !defined(GOOGLE_CHROME_BUILD) |
| 638 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && |
| 639 !command_line->HasSwitch(switches::kForceFieldTrials) && |
| 640 !command_line->HasSwitch(switches::kVariationsServerURL)) { |
| 641 bool result = chrome_variations::AssociateDefaultFieldTrialConfig(); |
| 642 CHECK(result) << " Enabling field trial testing configuration failed."; |
| 643 } |
| 644 #endif // !defined(GOOGLE_CHROME_BUILD) |
| 645 |
636 if (command_line->HasSwitch(switches::kForceVariationIds)) { | 646 if (command_line->HasSwitch(switches::kForceVariationIds)) { |
637 // Create default variation ids which will always be included in the | 647 // Create default variation ids which will always be included in the |
638 // X-Client-Data request header. | 648 // X-Client-Data request header. |
639 variations::VariationsHttpHeaderProvider* provider = | 649 variations::VariationsHttpHeaderProvider* provider = |
640 variations::VariationsHttpHeaderProvider::GetInstance(); | 650 variations::VariationsHttpHeaderProvider::GetInstance(); |
641 bool result = provider->SetDefaultVariationIds( | 651 bool result = provider->SetDefaultVariationIds( |
642 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); | 652 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); |
643 CHECK(result) << "Invalid --" << switches::kForceVariationIds | 653 CHECK(result) << "Invalid --" << switches::kForceVariationIds |
644 << " list specified."; | 654 << " list specified."; |
645 metrics->AddSyntheticTrialObserver(provider); | 655 metrics->AddSyntheticTrialObserver(provider); |
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 chromeos::CrosSettings::Shutdown(); | 1790 chromeos::CrosSettings::Shutdown(); |
1781 #endif // defined(OS_CHROMEOS) | 1791 #endif // defined(OS_CHROMEOS) |
1782 #endif // defined(OS_ANDROID) | 1792 #endif // defined(OS_ANDROID) |
1783 } | 1793 } |
1784 | 1794 |
1785 // Public members: | 1795 // Public members: |
1786 | 1796 |
1787 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1797 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1788 chrome_extra_parts_.push_back(parts); | 1798 chrome_extra_parts_.push_back(parts); |
1789 } | 1799 } |
OLD | NEW |