| Index: ui/views/controls/scroll_view.cc
|
| diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc
|
| index 8a0c2590e8d2eae11644a63eddd61455fc6c0fa6..f38d8c55fb43630a2b5ad3912d5284f7e422e062 100644
|
| --- a/ui/views/controls/scroll_view.cc
|
| +++ b/ui/views/controls/scroll_view.cc
|
| @@ -715,77 +715,4 @@ void ScrollView::ScrollHeader() {
|
| }
|
| }
|
|
|
| -// VariableRowHeightScrollHelper ----------------------------------------------
|
| -
|
| -VariableRowHeightScrollHelper::VariableRowHeightScrollHelper(
|
| - Controller* controller) : controller_(controller) {
|
| -}
|
| -
|
| -VariableRowHeightScrollHelper::~VariableRowHeightScrollHelper() {
|
| -}
|
| -
|
| -int VariableRowHeightScrollHelper::GetPageScrollIncrement(
|
| - ScrollView* scroll_view, bool is_horizontal, bool is_positive) {
|
| - if (is_horizontal)
|
| - return 0;
|
| - // y coordinate is most likely negative.
|
| - int y = abs(scroll_view->contents()->y());
|
| - int vis_height = scroll_view->contents()->parent()->height();
|
| - if (is_positive) {
|
| - // Align the bottom most row to the top of the view.
|
| - int bottom = std::min(scroll_view->contents()->height() - 1,
|
| - y + vis_height);
|
| - RowInfo bottom_row_info = GetRowInfo(bottom);
|
| - // If 0, ScrollView will provide a default value.
|
| - return std::max(0, bottom_row_info.origin - y);
|
| - } else {
|
| - // Align the row on the previous page to to the top of the view.
|
| - int last_page_y = y - vis_height;
|
| - RowInfo last_page_info = GetRowInfo(std::max(0, last_page_y));
|
| - if (last_page_y != last_page_info.origin)
|
| - return std::max(0, y - last_page_info.origin - last_page_info.height);
|
| - return std::max(0, y - last_page_info.origin);
|
| - }
|
| -}
|
| -
|
| -int VariableRowHeightScrollHelper::GetLineScrollIncrement(
|
| - ScrollView* scroll_view, bool is_horizontal, bool is_positive) {
|
| - if (is_horizontal)
|
| - return 0;
|
| - // y coordinate is most likely negative.
|
| - int y = abs(scroll_view->contents()->y());
|
| - RowInfo row = GetRowInfo(y);
|
| - if (is_positive) {
|
| - return row.height - (y - row.origin);
|
| - } else if (y == row.origin) {
|
| - row = GetRowInfo(std::max(0, row.origin - 1));
|
| - return y - row.origin;
|
| - } else {
|
| - return y - row.origin;
|
| - }
|
| -}
|
| -
|
| -VariableRowHeightScrollHelper::RowInfo
|
| - VariableRowHeightScrollHelper::GetRowInfo(int y) {
|
| - return controller_->GetRowInfo(y);
|
| -}
|
| -
|
| -// FixedRowHeightScrollHelper -----------------------------------------------
|
| -
|
| -FixedRowHeightScrollHelper::FixedRowHeightScrollHelper(int top_margin,
|
| - int row_height)
|
| - : VariableRowHeightScrollHelper(NULL),
|
| - top_margin_(top_margin),
|
| - row_height_(row_height) {
|
| - DCHECK_GT(row_height, 0);
|
| -}
|
| -
|
| -VariableRowHeightScrollHelper::RowInfo
|
| - FixedRowHeightScrollHelper::GetRowInfo(int y) {
|
| - if (y < top_margin_)
|
| - return RowInfo(0, top_margin_);
|
| - return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_,
|
| - row_height_);
|
| -}
|
| -
|
| } // namespace views
|
|
|