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

Side by Side Diff: ui/views/controls/scroll_view.h

Issue 2813353002: Ensure that the focus ring in the bookmarks bar does not paint outside the parent view. (Closed)
Patch Set: Rename layer notification to OnChildLayerChanged() Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 #ifndef UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ 5 #ifndef UI_VIEWS_CONTROLS_SCROLL_VIEW_H_
6 #define UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ 6 #define UI_VIEWS_CONTROLS_SCROLL_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // View overrides: 98 // View overrides:
99 gfx::Size GetPreferredSize() const override; 99 gfx::Size GetPreferredSize() const override;
100 int GetHeightForWidth(int width) const override; 100 int GetHeightForWidth(int width) const override;
101 void Layout() override; 101 void Layout() override;
102 bool OnKeyPressed(const ui::KeyEvent& event) override; 102 bool OnKeyPressed(const ui::KeyEvent& event) override;
103 bool OnMouseWheel(const ui::MouseWheelEvent& e) override; 103 bool OnMouseWheel(const ui::MouseWheelEvent& e) override;
104 void OnScrollEvent(ui::ScrollEvent* event) override; 104 void OnScrollEvent(ui::ScrollEvent* event) override;
105 void OnGestureEvent(ui::GestureEvent* event) override; 105 void OnGestureEvent(ui::GestureEvent* event) override;
106 const char* GetClassName() const override; 106 const char* GetClassName() const override;
107 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; 107 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
108 void OnChildLayerChanged(View* child) override;
108 109
109 // ScrollBarController overrides: 110 // ScrollBarController overrides:
110 void ScrollToPosition(ScrollBar* source, int position) override; 111 void ScrollToPosition(ScrollBar* source, int position) override;
111 int GetScrollIncrement(ScrollBar* source, 112 int GetScrollIncrement(ScrollBar* source,
112 bool is_page, 113 bool is_page,
113 bool is_positive) override; 114 bool is_positive) override;
114 115
115 // TODO(djacobo): Remove this method when http://crbug.com/656198 is closed. 116 // TODO(djacobo): Remove this method when http://crbug.com/656198 is closed.
116 // Force |contents_viewport_| to enable a Layer(). 117 // Force |contents_viewport_| to enable a Layer().
117 void EnableViewPortLayer(); 118 void EnableViewPortLayer();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // In Harmony, the indicator is a focus ring. Pre-Harmony, the indicator is a 198 // In Harmony, the indicator is a focus ring. Pre-Harmony, the indicator is a
198 // different border painter. 199 // different border painter.
199 bool draw_focus_indicator_ = false; 200 bool draw_focus_indicator_ = false;
200 201
201 // Only needed for pre-Harmony. Remove when Harmony is default. 202 // Only needed for pre-Harmony. Remove when Harmony is default.
202 bool draw_border_ = false; 203 bool draw_border_ = false;
203 204
204 // Focus ring, if one is installed. 205 // Focus ring, if one is installed.
205 View* focus_ring_ = nullptr; 206 View* focus_ring_ = nullptr;
206 207
208 // Set to true if we enabled layering for the viewport.
209 bool viewport_layer_enabled_ = false;
210
207 DISALLOW_COPY_AND_ASSIGN(ScrollView); 211 DISALLOW_COPY_AND_ASSIGN(ScrollView);
208 }; 212 };
209 213
210 // VariableRowHeightScrollHelper is intended for views that contain rows of 214 // VariableRowHeightScrollHelper is intended for views that contain rows of
211 // varying height. To use a VariableRowHeightScrollHelper create one supplying 215 // varying height. To use a VariableRowHeightScrollHelper create one supplying
212 // a Controller and delegate GetPageScrollIncrement and GetLineScrollIncrement 216 // a Controller and delegate GetPageScrollIncrement and GetLineScrollIncrement
213 // to the helper. VariableRowHeightScrollHelper calls back to the 217 // to the helper. VariableRowHeightScrollHelper calls back to the
214 // Controller to determine row boundaries. 218 // Controller to determine row boundaries.
215 class VariableRowHeightScrollHelper { 219 class VariableRowHeightScrollHelper {
216 public: 220 public:
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 private: 277 private:
274 int top_margin_; 278 int top_margin_;
275 int row_height_; 279 int row_height_;
276 280
277 DISALLOW_COPY_AND_ASSIGN(FixedRowHeightScrollHelper); 281 DISALLOW_COPY_AND_ASSIGN(FixedRowHeightScrollHelper);
278 }; 282 };
279 283
280 } // namespace views 284 } // namespace views
281 285
282 #endif // UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ 286 #endif // UI_VIEWS_CONTROLS_SCROLL_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698