Commit a6b9e17d authored by mdjones's avatar mdjones Committed by Commit bot

Control distillability with command-line flag

BUG=646384

Review-Url: https://codereview.chromium.org/2361643004
Cr-Commit-Position: refs/heads/master@{#420617}
parent cc960a01
......@@ -1617,6 +1617,11 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
MaybeAppendBlinkSettingsSwitchForFieldTrial(
browser_command_line, command_line);
#if defined(OS_ANDROID)
// If the platform is Android, force the distillability service on.
command_line->AppendSwitch(switches::kEnableDistillabilityService);
#endif
// Please keep this in alphabetical order.
static const char* const kSwitchNames[] = {
#if defined(OS_ANDROID)
......@@ -1648,6 +1653,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kDisableJavaScriptHarmonyShipping,
switches::kDisableNewBookmarkApps,
switches::kEnableBenchmarking,
switches::kEnableDistillabilityService,
switches::kEnableNaCl,
#if !defined(DISABLE_NACL)
switches::kEnableNaClDebug,
......
......@@ -96,6 +96,7 @@ class DistillablePageUtilsBrowserTestOption : public InProcessBrowserTest {
command_line->AppendSwitch(switches::kEnableDomDistiller);
command_line->AppendSwitchASCII(switches::kReaderModeHeuristics,
Option);
command_line->AppendSwitch(switches::kEnableDistillabilityService);
}
void SetUpOnMainThread() override {
......
......@@ -69,6 +69,7 @@
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "components/dom_distiller/content/renderer/distillability_agent.h"
#include "components/dom_distiller/content/renderer/distiller_js_render_frame_observer.h"
#include "components/dom_distiller/core/dom_distiller_switches.h"
#include "components/dom_distiller/core/url_constants.h"
#include "components/error_page/common/localized_error.h"
#include "components/network_hints/renderer/prescient_networking_dispatcher.h"
......@@ -510,9 +511,12 @@ void ChromeContentRendererClient::RenderFrameCreated(
new dom_distiller::DistillerJsRenderFrameObserver(
render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL);
// Create DistillabilityAgent to send distillability updates to
// DistillabilityDriver in the browser process.
new dom_distiller::DistillabilityAgent(render_frame);
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kEnableDistillabilityService)) {
// Create DistillabilityAgent to send distillability updates to
// DistillabilityDriver in the browser process.
new dom_distiller::DistillabilityAgent(render_frame);
}
// Set up a mojo service to test if this page is a contextual search page.
new contextual_search::OverlayJsRenderFrameObserver(render_frame);
......
......@@ -6,6 +6,7 @@
namespace switches {
const char kEnableDistillabilityService[] = "enable-distillability-service";
const char kEnableDomDistiller[] = "enable-dom-distiller";
const char kEnableSyncArticles[] = "enable-sync-articles";
const char kReaderModeHeuristics[] = "reader-mode-heuristics";
......
......@@ -10,6 +10,9 @@
namespace switches {
// Switch to enable the distillability service on the renderer.
extern const char kEnableDistillabilityService[];
// Switch to enable the DOM distiller.
extern const char kEnableDomDistiller[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment