Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 1741783002: Add disabled origin trial feature list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ef-finch
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698