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

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

Issue 2512583002: Remove *RowHeightScrollHelper from scroll_view.h/cc (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | 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 288be675d7ac34a7fd4d7e53af00c3dc83c9733d..b48d594332fca00f20e27f676770e47923b0547a 100644
--- a/ui/views/controls/scroll_view.h
+++ b/ui/views/controls/scroll_view.h
@@ -192,76 +192,6 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
DISALLOW_COPY_AND_ASSIGN(ScrollView);
};
-// VariableRowHeightScrollHelper is intended for views that contain rows of
-// varying height. To use a VariableRowHeightScrollHelper create one supplying
-// a Controller and delegate GetPageScrollIncrement and GetLineScrollIncrement
-// to the helper. VariableRowHeightScrollHelper calls back to the
-// Controller to determine row boundaries.
-class VariableRowHeightScrollHelper {
- public:
- // The origin and height of a row.
- struct RowInfo {
- RowInfo(int origin, int height) : origin(origin), height(height) {}
-
- // Origin of the row.
- int origin;
-
- // Height of the row.
- int height;
- };
-
- // Used to determine row boundaries.
- class Controller {
- public:
- // Returns the origin and size of the row at the specified location.
- virtual VariableRowHeightScrollHelper::RowInfo GetRowInfo(int y) = 0;
- };
-
- // Creates a new VariableRowHeightScrollHelper. Controller is
- // NOT deleted by this VariableRowHeightScrollHelper.
- explicit VariableRowHeightScrollHelper(Controller* controller);
- virtual ~VariableRowHeightScrollHelper();
-
- // Delegate the View methods of the same name to these. The scroll amount is
- // determined by querying the Controller for the appropriate row to scroll
- // to.
- int GetPageScrollIncrement(ScrollView* scroll_view,
- bool is_horizontal, bool is_positive);
- int GetLineScrollIncrement(ScrollView* scroll_view,
- bool is_horizontal, bool is_positive);
-
- protected:
- // Returns the row information for the row at the specified location. This
- // calls through to the method of the same name on the controller.
- virtual RowInfo GetRowInfo(int y);
-
- private:
- Controller* controller_;
-
- DISALLOW_COPY_AND_ASSIGN(VariableRowHeightScrollHelper);
-};
-
-// FixedRowHeightScrollHelper is intended for views that contain fixed height
-// height rows. To use a FixedRowHeightScrollHelper delegate
-// GetPageScrollIncrement and GetLineScrollIncrement to it.
-class FixedRowHeightScrollHelper : public VariableRowHeightScrollHelper {
- public:
- // Creates a FixedRowHeightScrollHelper. top_margin gives the distance from
- // the top of the view to the first row, and may be 0. row_height gives the
- // height of each row.
- FixedRowHeightScrollHelper(int top_margin, int row_height);
-
- protected:
- // Calculates the bounds of the row from the top margin and row height.
- RowInfo GetRowInfo(int y) override;
-
- private:
- int top_margin_;
- int row_height_;
-
- DISALLOW_COPY_AND_ASSIGN(FixedRowHeightScrollHelper);
-};
-
} // namespace views
#endif // UI_VIEWS_CONTROLS_SCROLL_VIEW_H_
« no previous file with comments | « no previous file | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698