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

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

Issue 2356193002: [Sensors] Adding chrome flag to enable Generic Sensor based APIs (Closed)
Patch Set: rebased Created 4 years, 2 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 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker)) 299 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker))
300 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true); 300 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true);
301 301
302 if (base::FeatureList::IsEnabled(features::kGamepadExtensions)) 302 if (base::FeatureList::IsEnabled(features::kGamepadExtensions))
303 WebRuntimeFeatures::enableGamepadExtensions(true); 303 WebRuntimeFeatures::enableGamepadExtensions(true);
304 304
305 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers)) 305 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers))
306 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers", 306 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers",
307 false); 307 false);
308 308
309 if (base::FeatureList::IsEnabled(features::kGenericSensor))
310 WebRuntimeFeatures::enableGenericSensor(true);
311
309 // Enable explicitly enabled features, and then disable explicitly disabled 312 // Enable explicitly enabled features, and then disable explicitly disabled
310 // ones. 313 // ones.
311 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { 314 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
312 std::vector<std::string> enabled_features = base::SplitString( 315 std::vector<std::string> enabled_features = base::SplitString(
313 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), 316 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures),
314 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 317 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
315 for (const std::string& feature : enabled_features) 318 for (const std::string& feature : enabled_features)
316 WebRuntimeFeatures::enableFeatureFromString(feature, true); 319 WebRuntimeFeatures::enableFeatureFromString(feature, true);
317 } 320 }
318 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 321 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
319 std::vector<std::string> disabled_features = base::SplitString( 322 std::vector<std::string> disabled_features = base::SplitString(
320 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 323 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
321 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 324 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
322 for (const std::string& feature : disabled_features) 325 for (const std::string& feature : disabled_features)
323 WebRuntimeFeatures::enableFeatureFromString(feature, false); 326 WebRuntimeFeatures::enableFeatureFromString(feature, false);
324 } 327 }
325 } 328 }
326 329
327 } // namespace content 330 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/public/common/content_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698