| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 814 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 815 if (!command_line->HasSwitch(switches::kOriginTrialPublicKey)) { | 815 if (!command_line->HasSwitch(switches::kOriginTrialPublicKey)) { |
| 816 std::string new_public_key = | 816 std::string new_public_key = |
| 817 local_state_->GetString(prefs::kOriginTrialPublicKey); | 817 local_state_->GetString(prefs::kOriginTrialPublicKey); |
| 818 if (!new_public_key.empty()) { | 818 if (!new_public_key.empty()) { |
| 819 command_line->AppendSwitchASCII( | 819 command_line->AppendSwitchASCII( |
| 820 switches::kOriginTrialPublicKey, | 820 switches::kOriginTrialPublicKey, |
| 821 local_state_->GetString(prefs::kOriginTrialPublicKey)); | 821 local_state_->GetString(prefs::kOriginTrialPublicKey)); |
| 822 } | 822 } |
| 823 } | 823 } |
| 824 if (!command_line->HasSwitch(switches::kOriginTrialDisabledFeatures)) { |
| 825 const base::ListValue* override_disabled_feature_list = |
| 826 local_state_->GetList(prefs::kOriginTrialDisabledFeatures); |
| 827 if (override_disabled_feature_list) { |
| 828 std::vector<std::string> disabled_features; |
| 829 std::string disabled_feature; |
| 830 for (const auto& item : *override_disabled_feature_list) { |
| 831 if (item->GetAsString(&disabled_feature)) { |
| 832 disabled_features.push_back(disabled_feature); |
| 833 } |
| 834 } |
| 835 if (!disabled_features.empty()) { |
| 836 const std::string override_disabled_features = |
| 837 base::JoinString(disabled_features, "|"); |
| 838 command_line->AppendSwitchASCII(switches::kOriginTrialDisabledFeatures, |
| 839 override_disabled_features); |
| 840 } |
| 841 } |
| 842 } |
| 824 } | 843 } |
| 825 | 844 |
| 826 // ----------------------------------------------------------------------------- | 845 // ----------------------------------------------------------------------------- |
| 827 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts. | 846 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts. |
| 828 | 847 |
| 829 #if defined(OS_WIN) | 848 #if defined(OS_WIN) |
| 830 #define DLLEXPORT __declspec(dllexport) | 849 #define DLLEXPORT __declspec(dllexport) |
| 831 | 850 |
| 832 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. | 851 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. |
| 833 extern "C" { | 852 extern "C" { |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2005 chromeos::CrosSettings::Shutdown(); | 2024 chromeos::CrosSettings::Shutdown(); |
| 2006 #endif // defined(OS_CHROMEOS) | 2025 #endif // defined(OS_CHROMEOS) |
| 2007 #endif // defined(OS_ANDROID) | 2026 #endif // defined(OS_ANDROID) |
| 2008 } | 2027 } |
| 2009 | 2028 |
| 2010 // Public members: | 2029 // Public members: |
| 2011 | 2030 |
| 2012 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2031 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2013 chrome_extra_parts_.push_back(parts); | 2032 chrome_extra_parts_.push_back(parts); |
| 2014 } | 2033 } |
| OLD | NEW |