Chromium Code Reviews| Index: ui/views/controls/scroll_view.h |
| diff --git a/ui/views/controls/scroll_view.h b/ui/views/controls/scroll_view.h |
| index db38b2c8e7560cab7415c0d73caf48124207afcc..434c9d66b7176d43ce30f1ed80a10adaaf2d355f 100644 |
| --- a/ui/views/controls/scroll_view.h |
| +++ b/ui/views/controls/scroll_view.h |
| @@ -46,6 +46,10 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController { |
| // Creates a ScrollView with a theme specific border. |
| static ScrollView* CreateScrollViewWithBorder(); |
| + // Returns the ScrollView for which |contents| is its contents, or null if |
| + // |contents| is not in a ScrollView. |
| + static ScrollView* GetScrollViewForContents(View* contents); |
| + |
| // Set the contents. Any previous contents will be deleted. The contents |
| // is the view that needs to scroll. |
| void SetContents(View* a_view); |
| @@ -88,7 +92,7 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController { |
| void SetHorizontalScrollBar(ScrollBar* horiz_sb); |
| void SetVerticalScrollBar(ScrollBar* vert_sb); |
| - // Sets whether this ScrollView has a focus ring or not. |
| + // Sets whether this ScrollView has a focus indicator or not. |
| void SetHasFocusRing(bool has_focus_ring); |
|
Elly Fong-Jones
2017/02/24 14:44:30
might be good to rename this to SetHasFocusIndicat
Evan Stade
2017/02/24 16:55:56
the reason I didn't do that is because FocusRing w
|
| // View overrides: |
| @@ -100,6 +104,7 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController { |
| void OnScrollEvent(ui::ScrollEvent* event) override; |
| void OnGestureEvent(ui::GestureEvent* event) override; |
| const char* GetClassName() const override; |
| + void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| // ScrollBarController overrides: |
| void ScrollToPosition(ScrollBar* source, int position) override; |
| @@ -154,6 +159,9 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController { |
| // Horizontally scrolls the header (if any) to match the contents. |
| void ScrollHeader(); |
| + void AddBorder(); |
| + void UpdateBorder(); |
| + |
| // The current contents and its viewport. |contents_| is contained in |
| // |contents_viewport_|. |
| View* contents_; |
| @@ -186,6 +194,13 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController { |
| // than the viewport). |
| bool hide_horizontal_scrollbar_; |
| + // In Harmony, the indicator is a focus ring. Pre-Harmony, the indicator is a |
| + // different border painter. |
| + bool draw_focus_indicator_ = false; |
| + |
| + // Only needed for pre-Harmony. Remove when Harmony is default. |
| + bool draw_border_ = false; |
| + |
| // Focus ring, if one is installed. |
| View* focus_ring_ = nullptr; |