0

Remove chrome mock scrollbar settings

We are using mock overlay scrollbars in blink web tests and
unit tests in particular cases. Mock scrollbar will not be a
standalone setting in blink, and doesn't need to expose to chrome.

Change-Id: I339398322e473d09364069129b3c716aaddd0d96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879706
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709707}
This commit is contained in:
Xianzhu Wang
2019-10-26 00:07:07 +00:00
committed by Commit Bot
parent 52ae9e8811
commit 3985d34583
14 changed files with 1 additions and 51 deletions

@ -103,11 +103,6 @@ class ScrollLatencyBrowserTest : public ContentBrowserTest {
}
void LoadURL() {
WebContents* contents = shell()->web_contents();
WebPreferences prefs =
contents->GetRenderViewHost()->GetWebkitPreferences();
prefs.mock_scrollbars_enabled = true;
contents->GetRenderViewHost()->UpdateWebkitPreferences(prefs);
const GURL data_url(kDataURL);
EXPECT_TRUE(NavigateToURL(shell(), data_url));

@ -511,8 +511,7 @@ void SetCustomizedRuntimeFeaturesFromCombinedArgs(
// These checks are custom wrappers around base::FeatureList::IsEnabled
// They're moved here to distinguish them from actual base checks
if (ui::IsOverlayScrollbarEnabled())
WebRuntimeFeatures::EnableOverlayScrollbars(true);
WebRuntimeFeatures::EnableOverlayScrollbars(ui::IsOverlayScrollbarEnabled());
WebRuntimeFeatures::EnableFormControlsRefresh(
features::IsFormControlsRefreshEnabled());

@ -145,7 +145,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(flash_stage3d_baseline_enabled)
IPC_STRUCT_TRAITS_MEMBER(privileged_webgl_extensions_enabled)
IPC_STRUCT_TRAITS_MEMBER(webgl_errors_to_console_enabled)
IPC_STRUCT_TRAITS_MEMBER(mock_scrollbars_enabled)
IPC_STRUCT_TRAITS_MEMBER(hide_scrollbars)
IPC_STRUCT_TRAITS_MEMBER(accelerated_2d_canvas_enabled)
IPC_STRUCT_TRAITS_MEMBER(antialiased_2d_canvas_disabled)

@ -98,7 +98,6 @@ WebPreferences::WebPreferences()
flash_stage3d_baseline_enabled(false),
privileged_webgl_extensions_enabled(false),
webgl_errors_to_console_enabled(true),
mock_scrollbars_enabled(false),
hide_scrollbars(false),
accelerated_2d_canvas_enabled(false),
antialiased_2d_canvas_disabled(false),

@ -120,7 +120,6 @@ struct CONTENT_EXPORT WebPreferences {
bool flash_stage3d_baseline_enabled;
bool privileged_webgl_extensions_enabled;
bool webgl_errors_to_console_enabled;
bool mock_scrollbars_enabled;
bool hide_scrollbars;
bool accelerated_2d_canvas_enabled;
bool antialiased_2d_canvas_disabled;

@ -681,9 +681,6 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
settings->SetWebGLErrorsToConsoleEnabled(
prefs.webgl_errors_to_console_enabled);
// Uses the mock theme engine for scrollbars.
settings->SetMockScrollbarsEnabled(prefs.mock_scrollbars_enabled);
settings->SetHideScrollbars(prefs.hide_scrollbars);
// Enable gpu-accelerated 2d canvas if requested on the command line.

@ -391,8 +391,6 @@ bool BlinkTestController::PrepareForWebTest(const TestInfo& test_info) {
ShellBrowserContext* browser_context =
ShellContentBrowserClient::Get()->browser_context();
is_compositing_test_ =
test_url_.spec().find("compositing/") != std::string::npos;
initial_size_ = Shell::GetShellDefaultSize();
if (!main_window_) {
main_window_ = content::Shell::CreateNewWindow(
@ -466,11 +464,6 @@ bool BlinkTestController::PrepareForWebTest(const TestInfo& test_info) {
new DevToolsProtocolTestBindings(main_window_->web_contents()));
}
// Compositing tests override the default preferences (see
// BlinkTestController::OverrideWebkitPrefs) so we force them to be
// calculated again to ensure is_compositing_test_ changes are picked up.
OverrideWebkitPrefs(&default_prefs_);
render_view_host->UpdateWebkitPreferences(default_prefs_);
HandleNewRenderFrameHost(render_view_host->GetMainFrame());
@ -521,7 +514,6 @@ bool BlinkTestController::ResetAfterWebTest() {
printer_->CloseStderr();
did_send_initial_test_configuration_ = false;
test_phase_ = BETWEEN_TESTS;
is_compositing_test_ = false;
expected_pixel_hash_.clear();
test_url_ = GURL();
prefs_ = WebPreferences();
@ -558,12 +550,6 @@ void BlinkTestController::OverrideWebkitPrefs(WebPreferences* prefs) {
*prefs = prefs_;
} else {
ApplyWebTestDefaultPreferences(prefs);
if (is_compositing_test_) {
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
if (!command_line.HasSwitch(switches::kDisableGpu))
prefs->accelerated_2d_canvas_enabled = true;
prefs->mock_scrollbars_enabled = true;
}
}
}

@ -273,9 +273,6 @@ class BlinkTestController : public WebContentsObserver,
// What phase of running an individual test we are currently in.
TestPhase test_phase_;
// True if the currently running test is a compositing test.
bool is_compositing_test_;
// Per test config.
std::string expected_pixel_hash_;
gfx::Size initial_size_;

@ -137,7 +137,6 @@ void ApplyWebTestDefaultPreferences(WebPreferences* prefs) {
prefs->minimum_logical_font_size = 9;
prefs->accelerated_2d_canvas_enabled =
command_line.HasSwitch(switches::kEnableAccelerated2DCanvas);
prefs->mock_scrollbars_enabled = false;
prefs->smart_insert_delete_enabled = true;
prefs->viewport_enabled = command_line.HasSwitch(switches::kEnableViewport);
prefs->default_minimum_page_scale_factor = 1.f;

@ -191,7 +191,6 @@ class WebSettings {
virtual void SetImmersiveModeEnabled(bool) = 0;
virtual void SetMinimumFontSize(int) = 0;
virtual void SetMinimumLogicalFontSize(int) = 0;
virtual void SetMockScrollbarsEnabled(bool) = 0;
virtual void SetHideScrollbars(bool) = 0;
virtual void SetOfflineWebApplicationCacheEnabled(bool) = 0;
virtual void SetPassiveEventListenerDefault(PassiveEventListenerDefault) = 0;

@ -461,11 +461,6 @@ void WebSettingsImpl::SetEditingBehavior(EditingBehavior behavior) {
settings_->SetEditingBehaviorType(static_cast<EditingBehaviorType>(behavior));
}
void WebSettingsImpl::SetMockScrollbarsEnabled(bool enabled) {
// TODO(wangxianzhu): Remove this function in crrev.com/c/1879706.
// settings_->SetMockScrollbarsEnabled(enabled);
}
void WebSettingsImpl::SetHideScrollbars(bool enabled) {
dev_tools_emulator_->SetHideScrollbars(enabled);
}

@ -120,7 +120,6 @@ class CORE_EXPORT WebSettingsImpl final : public WebSettings {
void SetImmersiveModeEnabled(bool) override;
void SetMinimumFontSize(int) override;
void SetMinimumLogicalFontSize(int) override;
void SetMockScrollbarsEnabled(bool) override;
void SetHideScrollbars(bool) override;
void SetOfflineWebApplicationCacheEnabled(bool) override;
void SetPassiveEventListenerDefault(PassiveEventListenerDefault) override;

@ -30,7 +30,6 @@
#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme.h"
#include "third_party/blink/renderer/platform/graphics/dark_mode_settings.h"
namespace blink {
@ -95,14 +94,6 @@ void Settings::SetTextAutosizingWindowSizeOverride(
Invalidate(SettingsDelegate::kTextAutosizingChange);
}
void Settings::SetMockScrollbarsEnabled(bool flag) {
ScrollbarTheme::SetMockScrollbarsEnabled(flag);
}
bool Settings::MockScrollbarsEnabled() {
return ScrollbarTheme::MockScrollbarsEnabled();
}
void Settings::SetForceDarkModeEnabled(bool enabled) {
if (force_dark_mode_ == enabled)
return;

@ -86,10 +86,6 @@ class CORE_EXPORT Settings {
SETTINGS_GETTERS_AND_SETTERS
// FIXME: This does not belong here.
static void SetMockScrollbarsEnabled(bool flag);
static bool MockScrollbarsEnabled();
void SetDelegate(SettingsDelegate*);
private: