Chromium Code Reviews| 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 811 base::TimeTicks::Now(), is_first_run, g_browser_process->local_state()); | 811 base::TimeTicks::Now(), is_first_run, g_browser_process->local_state()); |
| 812 } | 812 } |
| 813 | 813 |
| 814 void ChromeBrowserMainParts::SetupOriginTrials() { | 814 void ChromeBrowserMainParts::SetupOriginTrials() { |
| 815 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 815 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 816 if (!command_line->HasSwitch(switches::kOriginTrialPublicKey)) { | 816 if (!command_line->HasSwitch(switches::kOriginTrialPublicKey)) { |
| 817 command_line->AppendSwitchASCII( | 817 command_line->AppendSwitchASCII( |
| 818 switches::kOriginTrialPublicKey, | 818 switches::kOriginTrialPublicKey, |
| 819 local_state_->GetString(prefs::kOriginTrialPublicKey)); | 819 local_state_->GetString(prefs::kOriginTrialPublicKey)); |
| 820 } | 820 } |
| 821 if (!command_line->HasSwitch(switches::kOriginTrialDisabledFeatures)) { | |
| 822 const base::ListValue* override_disabled_feature_list = | |
| 823 local_state_->GetList(prefs::kOriginTrialDisabledFeatures); | |
| 824 std::string disabled_feature; | |
| 825 std::vector<std::string> disabled_features; | |
| 826 if (override_disabled_feature_list) { | |
| 827 for (const auto& item : *override_disabled_feature_list) { | |
| 828 if (item->GetAsString(&disabled_feature)) { | |
| 829 disabled_features.push_back(disabled_feature); | |
| 830 } | |
| 831 } | |
| 832 if (!disabled_features.empty()) { | |
| 833 std::string override_disabled_features = | |
|
Sorin Jianu
2016/06/07 17:20:24
can be const.
iclelland
2016/06/08 13:37:55
Done.
| |
| 834 base::JoinString(disabled_features, "|"); | |
| 835 base::CommandLine* command_line = | |
| 836 base::CommandLine::ForCurrentProcess(); | |
| 837 command_line->AppendSwitchASCII(switches::kOriginTrialDisabledFeatures, | |
| 838 override_disabled_features); | |
| 839 } | |
| 840 } | |
| 841 } | |
| 821 } | 842 } |
| 822 | 843 |
| 823 // ----------------------------------------------------------------------------- | 844 // ----------------------------------------------------------------------------- |
| 824 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts. | 845 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts. |
| 825 | 846 |
| 826 #if defined(OS_WIN) | 847 #if defined(OS_WIN) |
| 827 #define DLLEXPORT __declspec(dllexport) | 848 #define DLLEXPORT __declspec(dllexport) |
| 828 | 849 |
| 829 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. | 850 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. |
| 830 extern "C" { | 851 extern "C" { |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2004 chromeos::CrosSettings::Shutdown(); | 2025 chromeos::CrosSettings::Shutdown(); |
| 2005 #endif // defined(OS_CHROMEOS) | 2026 #endif // defined(OS_CHROMEOS) |
| 2006 #endif // defined(OS_ANDROID) | 2027 #endif // defined(OS_ANDROID) |
| 2007 } | 2028 } |
| 2008 | 2029 |
| 2009 // Public members: | 2030 // Public members: |
| 2010 | 2031 |
| 2011 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2032 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2012 chrome_extra_parts_.push_back(parts); | 2033 chrome_extra_parts_.push_back(parts); |
| 2013 } | 2034 } |
| OLD | NEW |