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

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

Issue 2733023002: [Origin Trials] Support updates of disabled token list (Closed)
Patch Set: Address comments 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
« 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 } 863 }
864 } 864 }
865 if (!disabled_features.empty()) { 865 if (!disabled_features.empty()) {
866 const std::string override_disabled_features = 866 const std::string override_disabled_features =
867 base::JoinString(disabled_features, "|"); 867 base::JoinString(disabled_features, "|");
868 command_line->AppendSwitchASCII(switches::kOriginTrialDisabledFeatures, 868 command_line->AppendSwitchASCII(switches::kOriginTrialDisabledFeatures,
869 override_disabled_features); 869 override_disabled_features);
870 } 870 }
871 } 871 }
872 } 872 }
873 if (!command_line->HasSwitch(switches::kOriginTrialDisabledTokens)) {
874 const base::ListValue* disabled_token_list =
875 local_state_->GetList(prefs::kOriginTrialDisabledTokens);
876 if (disabled_token_list) {
877 std::vector<std::string> disabled_tokens;
878 std::string disabled_token;
879 for (const auto& item : *disabled_token_list) {
880 if (item->GetAsString(&disabled_token)) {
881 disabled_tokens.push_back(disabled_token);
882 }
883 }
884 if (!disabled_tokens.empty()) {
885 const std::string disabled_token_switch =
886 base::JoinString(disabled_tokens, "|");
887 command_line->AppendSwitchASCII(switches::kOriginTrialDisabledTokens,
888 disabled_token_switch);
889 }
890 }
891 }
873 } 892 }
874 893
875 // ----------------------------------------------------------------------------- 894 // -----------------------------------------------------------------------------
876 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts. 895 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts.
877 896
878 #if defined(OS_WIN) 897 #if defined(OS_WIN)
879 #define DLLEXPORT __declspec(dllexport) 898 #define DLLEXPORT __declspec(dllexport)
880 899
881 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. 900 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
882 extern "C" { 901 extern "C" {
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 chromeos::CrosSettings::Shutdown(); 2107 chromeos::CrosSettings::Shutdown();
2089 #endif // defined(OS_CHROMEOS) 2108 #endif // defined(OS_CHROMEOS)
2090 #endif // defined(OS_ANDROID) 2109 #endif // defined(OS_ANDROID)
2091 } 2110 }
2092 2111
2093 // Public members: 2112 // Public members:
2094 2113
2095 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2114 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2096 chrome_extra_parts_.push_back(parts); 2115 chrome_extra_parts_.push_back(parts);
2097 } 2116 }
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