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

Side by Side Diff: content/child/runtime_features.cc

Issue 2248083002: [Feature Policy] Add command-line flag and about://flags interface for Feature Policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 | « chrome/browser/about_flags.cc ('k') | content/public/common/content_features.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/child/runtime_features.h" 5 #include "content/child/runtime_features.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( 59 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
60 const base::CommandLine& command_line) { 60 const base::CommandLine& command_line) {
61 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) 61 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures))
62 WebRuntimeFeatures::enableExperimentalFeatures(true); 62 WebRuntimeFeatures::enableExperimentalFeatures(true);
63 63
64 WebRuntimeFeatures::enableOriginTrials( 64 WebRuntimeFeatures::enableOriginTrials(
65 base::FeatureList::IsEnabled(features::kOriginTrials)); 65 base::FeatureList::IsEnabled(features::kOriginTrials));
66 66
67 WebRuntimeFeatures::enableFeaturePolicy(
68 base::FeatureList::IsEnabled(features::kFeaturePolicy));
69
67 if (command_line.HasSwitch(switches::kEnableWebBluetooth)) 70 if (command_line.HasSwitch(switches::kEnableWebBluetooth))
68 WebRuntimeFeatures::enableWebBluetooth(true); 71 WebRuntimeFeatures::enableWebBluetooth(true);
69 72
70 if (!base::FeatureList::IsEnabled(features::kWebUsb)) 73 if (!base::FeatureList::IsEnabled(features::kWebUsb))
71 WebRuntimeFeatures::enableWebUsb(false); 74 WebRuntimeFeatures::enableWebUsb(false);
72 75
73 SetRuntimeFeatureDefaultsForPlatform(); 76 SetRuntimeFeatureDefaultsForPlatform();
74 77
75 if (command_line.HasSwitch(switches::kDisableDatabases)) 78 if (command_line.HasSwitch(switches::kDisableDatabases))
76 WebRuntimeFeatures::enableDatabase(false); 79 WebRuntimeFeatures::enableDatabase(false);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 285 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
283 std::vector<std::string> disabled_features = base::SplitString( 286 std::vector<std::string> disabled_features = base::SplitString(
284 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 287 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
285 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 288 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
286 for (const std::string& feature : disabled_features) 289 for (const std::string& feature : disabled_features)
287 WebRuntimeFeatures::enableFeatureFromString(feature, false); 290 WebRuntimeFeatures::enableFeatureFromString(feature, false);
288 } 291 }
289 } 292 }
290 293
291 } // namespace content 294 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | content/public/common/content_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698