Skip to content

Commit

Permalink
Replace remaining uses of WebScrollbar::Orientation with ScrollbarOri…
Browse files Browse the repository at this point in the history
…entation.

Bug: 841751
Change-Id: I965b442ef21d0f199574d8d4ff04fc03af7158b9
Reviewed-on: https://chromium-review.googlesource.com/1054248
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558104}
  • Loading branch information
jeremyroman authored and Commit Bot committed May 12, 2018
1 parent 087971c commit 684f55e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
1 change: 0 additions & 1 deletion third_party/blink/public/platform/web_scrollbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ namespace blink {
// TODO(jbroman): Clean up these, which are used elsewhere.
class WebScrollbar {
public:
enum Orientation { kHorizontal, kVertical };
enum class ScrollingMode { kAuto, kAlwaysOff, kAlwaysOn, kLast = kAlwaysOn };
};

Expand Down
13 changes: 5 additions & 8 deletions third_party/blink/renderer/core/frame/visual_viewport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "cc/layers/scrollbar_layer_interface.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_scrollbar.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
Expand Down Expand Up @@ -425,8 +424,8 @@ void VisualViewport::InitializeScrollbars() {
inner_viewport_container_layer_->AddChild(
overlay_scrollbar_vertical_.get());

SetupScrollbar(WebScrollbar::kHorizontal);
SetupScrollbar(WebScrollbar::kVertical);
SetupScrollbar(kHorizontalScrollbar);
SetupScrollbar(kVerticalScrollbar);
} else {
overlay_scrollbar_horizontal_->RemoveFromParent();
overlay_scrollbar_vertical_->RemoveFromParent();
Expand All @@ -440,8 +439,8 @@ void VisualViewport::InitializeScrollbars() {
frame->View()->VisualViewportScrollbarsChanged();
}

void VisualViewport::SetupScrollbar(WebScrollbar::Orientation orientation) {
bool is_horizontal = orientation == WebScrollbar::kHorizontal;
void VisualViewport::SetupScrollbar(ScrollbarOrientation orientation) {
bool is_horizontal = orientation == kHorizontalScrollbar;
GraphicsLayer* scrollbar_graphics_layer =
is_horizontal ? overlay_scrollbar_horizontal_.get()
: overlay_scrollbar_vertical_.get();
Expand All @@ -463,10 +462,8 @@ void VisualViewport::SetupScrollbar(WebScrollbar::Orientation orientation) {
if (!scrollbar_layer_group) {
ScrollingCoordinator* coordinator = GetPage().GetScrollingCoordinator();
DCHECK(coordinator);
ScrollbarOrientation webcore_orientation =
is_horizontal ? kHorizontalScrollbar : kVerticalScrollbar;
scrollbar_layer_group = coordinator->CreateSolidColorScrollbarLayer(
webcore_orientation, thumb_thickness, scrollbar_margin, false);
orientation, thumb_thickness, scrollbar_margin, false);

// The compositor will control the scrollbar's visibility. Set to invisible
// by default so scrollbars don't show up in layout tests.
Expand Down
4 changes: 2 additions & 2 deletions third_party/blink/renderer/core/frame/visual_viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <memory>

#include "base/single_thread_task_runner.h"
#include "third_party/blink/public/platform/web_scrollbar.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
Expand All @@ -44,6 +43,7 @@
#include "third_party/blink/renderer/platform/geometry/int_size.h"
#include "third_party/blink/renderer/platform/graphics/compositor_element_id.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer_client.h"
#include "third_party/blink/renderer/platform/scroll/scroll_types.h"
#include "third_party/blink/renderer/platform/scroll/scrollable_area.h"

namespace blink {
Expand Down Expand Up @@ -266,7 +266,7 @@ class CORE_EXPORT VisualViewport final
const IntRect&) const override;
String DebugName(const GraphicsLayer*) const override;

void SetupScrollbar(WebScrollbar::Orientation);
void SetupScrollbar(ScrollbarOrientation);

void NotifyRootFrameViewport() const;

Expand Down
3 changes: 0 additions & 3 deletions third_party/blink/renderer/platform/scroll/scrollbar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,6 @@ STATIC_ASSERT_ENUM(WebScrollbar::ScrollingMode::kAlwaysOff,
kScrollbarAlwaysOff);
STATIC_ASSERT_ENUM(WebScrollbar::ScrollingMode::kAlwaysOn, kScrollbarAlwaysOn);

STATIC_ASSERT_ENUM(WebScrollbar::kHorizontal, kHorizontalScrollbar);
STATIC_ASSERT_ENUM(WebScrollbar::kVertical, kVerticalScrollbar);

STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeDark,
kScrollbarOverlayColorThemeDark);
STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeLight,
Expand Down

0 comments on commit 684f55e

Please sign in to comment.