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

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

Issue 2733023002: [Origin Trials] Support updates of disabled token list (Closed)
Patch Set: Rebase Created 3 years, 9 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
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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 } 866 }
867 } 867 }
868 if (!disabled_features.empty()) { 868 if (!disabled_features.empty()) {
869 const std::string override_disabled_features = 869 const std::string override_disabled_features =
870 base::JoinString(disabled_features, "|"); 870 base::JoinString(disabled_features, "|");
871 command_line->AppendSwitchASCII(switches::kOriginTrialDisabledFeatures, 871 command_line->AppendSwitchASCII(switches::kOriginTrialDisabledFeatures,
872 override_disabled_features); 872 override_disabled_features);
873 } 873 }
874 } 874 }
875 } 875 }
876 if (!command_line->HasSwitch(switches::kOriginTrialDisabledTokens)) {
877 const base::ListValue* disabled_token_list =
878 local_state_->GetList(prefs::kOriginTrialDisabledTokens);
879 if (disabled_token_list) {
880 std::vector<std::string> disabled_tokens;
881 std::string disabled_token;
882 for (const auto& item : *disabled_token_list) {
883 if (item->GetAsString(&disabled_token)) {
884 disabled_tokens.push_back(disabled_token);
885 }
886 }
887 if (!disabled_tokens.empty()) {
888 const std::string disabled_token_switch =
889 base::JoinString(disabled_tokens, "|");
890 command_line->AppendSwitchASCII(switches::kOriginTrialDisabledTokens,
891 disabled_token_switch);
892 }
893 }
894 }
876 } 895 }
877 896
878 // ----------------------------------------------------------------------------- 897 // -----------------------------------------------------------------------------
879 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts. 898 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts.
880 899
881 #if defined(OS_WIN) 900 #if defined(OS_WIN)
882 #define DLLEXPORT __declspec(dllexport) 901 #define DLLEXPORT __declspec(dllexport)
883 902
884 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. 903 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
885 extern "C" { 904 extern "C" {
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 chromeos::CrosSettings::Shutdown(); 2130 chromeos::CrosSettings::Shutdown();
2112 #endif // defined(OS_CHROMEOS) 2131 #endif // defined(OS_CHROMEOS)
2113 #endif // defined(OS_ANDROID) 2132 #endif // defined(OS_ANDROID)
2114 } 2133 }
2115 2134
2116 // Public members: 2135 // Public members:
2117 2136
2118 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2137 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2119 chrome_extra_parts_.push_back(parts); 2138 chrome_extra_parts_.push_back(parts);
2120 } 2139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698