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

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

Issue 2930323003: Show client placeholders for Server LoFi images. (Closed)
Patch Set: rebase flag_descriptions.cc Created 3 years, 5 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"
11 #include "base/metrics/field_trial.h" 11 #include "base/metrics/field_trial.h"
12 #include "base/metrics/field_trial_params.h"
12 #include "base/strings/string_split.h" 13 #include "base/strings/string_split.h"
13 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
14 #include "build/build_config.h" 15 #include "build/build_config.h"
15 #include "content/common/content_switches_internal.h" 16 #include "content/common/content_switches_internal.h"
16 #include "content/public/common/content_features.h" 17 #include "content/public/common/content_features.h"
17 #include "content/public/common/content_switches.h" 18 #include "content/public/common/content_switches.h"
18 #include "media/base/media_switches.h" 19 #include "media/base/media_switches.h"
19 #include "services/device/public/cpp/device_features.h" 20 #include "services/device/public/cpp/device_features.h"
20 #include "third_party/WebKit/public/platform/WebRuntimeFeatures.h" 21 #include "third_party/WebKit/public/platform/WebRuntimeFeatures.h"
21 #include "ui/gl/gl_switches.h" 22 #include "ui/gl/gl_switches.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 WebRuntimeFeatures::EnableAutoplayMutedVideos(true); 384 WebRuntimeFeatures::EnableAutoplayMutedVideos(true);
384 } 385 }
385 386
386 if (!base::FeatureList::IsEnabled(features::kWebAuth) && 387 if (!base::FeatureList::IsEnabled(features::kWebAuth) &&
387 !enableExperimentalWebPlatformFeatures) 388 !enableExperimentalWebPlatformFeatures)
388 WebRuntimeFeatures::EnableWebAuth(false); 389 WebRuntimeFeatures::EnableWebAuth(false);
389 390
390 WebRuntimeFeatures::EnableModuleScripts( 391 WebRuntimeFeatures::EnableModuleScripts(
391 base::FeatureList::IsEnabled(features::kModuleScripts)); 392 base::FeatureList::IsEnabled(features::kModuleScripts));
392 393
394 WebRuntimeFeatures::EnableClientPlaceholdersForServerLoFi(
395 base::GetFieldTrialParamValue("PreviewsClientLoFi",
396 "replace_server_placeholders") == "true");
397
393 // Enable explicitly enabled features, and then disable explicitly disabled 398 // Enable explicitly enabled features, and then disable explicitly disabled
394 // ones. 399 // ones.
395 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { 400 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
396 std::vector<std::string> enabled_features = base::SplitString( 401 std::vector<std::string> enabled_features = base::SplitString(
397 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), 402 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures),
398 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 403 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
399 for (const std::string& feature : enabled_features) 404 for (const std::string& feature : enabled_features)
400 WebRuntimeFeatures::EnableFeatureFromString(feature, true); 405 WebRuntimeFeatures::EnableFeatureFromString(feature, true);
401 } 406 }
402 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 407 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
403 std::vector<std::string> disabled_features = base::SplitString( 408 std::vector<std::string> disabled_features = base::SplitString(
404 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 409 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
405 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 410 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
406 for (const std::string& feature : disabled_features) 411 for (const std::string& feature : disabled_features)
407 WebRuntimeFeatures::EnableFeatureFromString(feature, false); 412 WebRuntimeFeatures::EnableFeatureFromString(feature, false);
408 } 413 }
409 } 414 }
410 415
411 } // namespace content 416 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | third_party/WebKit/Source/core/loader/resource/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698