| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/controls/scroll_view.h" | 5 #include "ui/views/controls/scroll_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/base/event.h" | 8 #include "ui/base/events/event.h" |
| 9 #include "ui/views/controls/scrollbar/native_scroll_bar.h" | 9 #include "ui/views/controls/scrollbar/native_scroll_bar.h" |
| 10 #include "ui/views/widget/root_view.h" | 10 #include "ui/views/widget/root_view.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 | 13 |
| 14 const char* const ScrollView::kViewClassName = "views/ScrollView"; | 14 const char* const ScrollView::kViewClassName = "views/ScrollView"; |
| 15 | 15 |
| 16 // Viewport contains the contents View of the ScrollView. | 16 // Viewport contains the contents View of the ScrollView. |
| 17 class Viewport : public View { | 17 class Viewport : public View { |
| 18 public: | 18 public: |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 | 513 |
| 514 VariableRowHeightScrollHelper::RowInfo | 514 VariableRowHeightScrollHelper::RowInfo |
| 515 FixedRowHeightScrollHelper::GetRowInfo(int y) { | 515 FixedRowHeightScrollHelper::GetRowInfo(int y) { |
| 516 if (y < top_margin_) | 516 if (y < top_margin_) |
| 517 return RowInfo(0, top_margin_); | 517 return RowInfo(0, top_margin_); |
| 518 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_, | 518 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_, |
| 519 row_height_); | 519 row_height_); |
| 520 } | 520 } |
| 521 | 521 |
| 522 } // namespace views | 522 } // namespace views |
| OLD | NEW |