Commit 31a68bd2 authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Remove View::GetPageScrollIncrement and View::GetLineScrollIncrement

Both of these methods always returned 0 and are not overridable.

BUG=

Change-Id: I014897e1533442232e6dbfd973186e094077cf87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879721
Auto-Submit: Robert Liao <robliao@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710010}
parent 00d9c53b
...@@ -663,19 +663,6 @@ void ScrollView::ScrollToPosition(ScrollBar* source, int position) { ...@@ -663,19 +663,6 @@ void ScrollView::ScrollToPosition(ScrollBar* source, int position) {
int ScrollView::GetScrollIncrement(ScrollBar* source, bool is_page, int ScrollView::GetScrollIncrement(ScrollBar* source, bool is_page,
bool is_positive) { bool is_positive) {
bool is_horizontal = source->IsHorizontal(); bool is_horizontal = source->IsHorizontal();
int amount = 0;
if (contents_) {
if (is_page) {
amount = contents_->GetPageScrollIncrement(
this, is_horizontal, is_positive);
} else {
amount = contents_->GetLineScrollIncrement(
this, is_horizontal, is_positive);
}
if (amount > 0)
return amount;
}
// No view, or the view didn't return a valid amount.
if (is_page) { if (is_page) {
return is_horizontal ? contents_viewport_->width() : return is_horizontal ? contents_viewport_->width() :
contents_viewport_->height(); contents_viewport_->height();
......
...@@ -1572,16 +1572,6 @@ void View::ScrollViewToVisible() { ...@@ -1572,16 +1572,6 @@ void View::ScrollViewToVisible() {
ScrollRectToVisible(GetLocalBounds()); ScrollRectToVisible(GetLocalBounds());
} }
int View::GetPageScrollIncrement(ScrollView* scroll_view,
bool is_horizontal, bool is_positive) {
return 0;
}
int View::GetLineScrollIncrement(ScrollView* scroll_view,
bool is_horizontal, bool is_positive) {
return 0;
}
void View::AddObserver(ViewObserver* observer) { void View::AddObserver(ViewObserver* observer) {
CHECK(observer); CHECK(observer);
observers_.AddObserver(observer); observers_.AddObserver(observer);
......
...@@ -1322,32 +1322,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, ...@@ -1322,32 +1322,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// this function calls ScrollRectToVisible(GetLocalBounds()). // this function calls ScrollRectToVisible(GetLocalBounds()).
void ScrollViewToVisible(); void ScrollViewToVisible();
// The following methods are used by ScrollView to determine the amount
// to scroll relative to the visible bounds of the view. For example, a
// return value of 10 indicates the scroll_view should scroll 10 pixels in
// the appropriate direction.
//
// Each method takes the following parameters:
//
// is_horizontal: if true, scrolling is along the horizontal axis, otherwise
// the vertical axis.
// is_positive: if true, scrolling is by a positive amount. Along the
// vertical axis scrolling by a positive amount equates to
// scrolling down.
//
// The return value should always be positive and gives the number of pixels
// to scroll. ScrollView interprets a return value of 0 (or negative)
// to scroll by a default amount.
//
// See VariableRowHeightScrollHelper and FixedRowHeightScrollHelper for
// implementations of common cases.
int GetPageScrollIncrement(ScrollView* scroll_view,
bool is_horizontal,
bool is_positive);
int GetLineScrollIncrement(ScrollView* scroll_view,
bool is_horizontal,
bool is_positive);
void AddObserver(ViewObserver* observer); void AddObserver(ViewObserver* observer);
void RemoveObserver(ViewObserver* observer); void RemoveObserver(ViewObserver* observer);
bool HasObserver(const ViewObserver* observer) const; bool HasObserver(const ViewObserver* observer) const;
......
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