| 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/feature_list.h" | 7 #include "base/feature_list.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #endif | 31 #endif |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // Subclass of ScrollView that resets the border when the theme changes. | 34 // Subclass of ScrollView that resets the border when the theme changes. |
| 35 class ScrollViewWithBorder : public views::ScrollView { | 35 class ScrollViewWithBorder : public views::ScrollView { |
| 36 public: | 36 public: |
| 37 ScrollViewWithBorder() {} | 37 ScrollViewWithBorder() {} |
| 38 | 38 |
| 39 // View overrides; | 39 // View overrides; |
| 40 void OnNativeThemeChanged(const ui::NativeTheme* theme) override { | 40 void OnNativeThemeChanged(const ui::NativeTheme* theme) override { |
| 41 SetBorder(Border::CreateSolidBorder( | 41 SetBorder(CreateSolidBorder( |
| 42 1, | 42 1, |
| 43 theme->GetSystemColor(ui::NativeTheme::kColorId_UnfocusedBorderColor))); | 43 theme->GetSystemColor(ui::NativeTheme::kColorId_UnfocusedBorderColor))); |
| 44 } | 44 } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(ScrollViewWithBorder); | 47 DISALLOW_COPY_AND_ASSIGN(ScrollViewWithBorder); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 class ScrollCornerView : public views::View { | 50 class ScrollCornerView : public views::View { |
| 51 public: | 51 public: |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 | 785 |
| 786 VariableRowHeightScrollHelper::RowInfo | 786 VariableRowHeightScrollHelper::RowInfo |
| 787 FixedRowHeightScrollHelper::GetRowInfo(int y) { | 787 FixedRowHeightScrollHelper::GetRowInfo(int y) { |
| 788 if (y < top_margin_) | 788 if (y < top_margin_) |
| 789 return RowInfo(0, top_margin_); | 789 return RowInfo(0, top_margin_); |
| 790 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_, | 790 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_, |
| 791 row_height_); | 791 row_height_); |
| 792 } | 792 } |
| 793 | 793 |
| 794 } // namespace views | 794 } // namespace views |
| OLD | NEW |