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

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

Issue 2356193002: [Sensors] Adding chrome flag to enable Generic Sensor based APIs (Closed)
Patch Set: Updated histograms.xml Created 4 years, 3 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 WebRuntimeFeatures::enablePaymentRequest( 295 WebRuntimeFeatures::enablePaymentRequest(
296 base::FeatureList::IsEnabled(features::kWebPayments)); 296 base::FeatureList::IsEnabled(features::kWebPayments));
297 #endif 297 #endif
298 298
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::kGenericSensor))
306 WebRuntimeFeatures::enableGenericSensor(true);
307
305 // Enable explicitly enabled features, and then disable explicitly disabled 308 // Enable explicitly enabled features, and then disable explicitly disabled
306 // ones. 309 // ones.
307 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { 310 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
308 std::vector<std::string> enabled_features = base::SplitString( 311 std::vector<std::string> enabled_features = base::SplitString(
309 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), 312 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures),
310 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 313 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
311 for (const std::string& feature : enabled_features) 314 for (const std::string& feature : enabled_features)
312 WebRuntimeFeatures::enableFeatureFromString(feature, true); 315 WebRuntimeFeatures::enableFeatureFromString(feature, true);
313 } 316 }
314 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 317 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
315 std::vector<std::string> disabled_features = base::SplitString( 318 std::vector<std::string> disabled_features = base::SplitString(
316 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 319 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
317 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 320 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
318 for (const std::string& feature : disabled_features) 321 for (const std::string& feature : disabled_features)
319 WebRuntimeFeatures::enableFeatureFromString(feature, false); 322 WebRuntimeFeatures::enableFeatureFromString(feature, false);
320 } 323 }
321 } 324 }
322 325
323 } // namespace content 326 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698