Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: ui/views/controls/scroll_view.h

Issue 2715813002: Change focus indicator for TableView and TreeView. (Closed)
Patch Set: rename Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/collected_cookies_views.cc ('k') | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..af9111a05cae1a2dd25daba64afe629560c7751e 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,8 +92,8 @@ 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.
- void SetHasFocusRing(bool has_focus_ring);
+ // Sets whether this ScrollView has a focus indicator or not.
+ void SetHasFocusIndicator(bool has_focus_indicator);
// View overrides:
gfx::Size GetPreferredSize() const override;
@@ -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;
« no previous file with comments | « chrome/browser/ui/views/collected_cookies_views.cc ('k') | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698