Index: ui/app_list/views/page_switcher_vertical.h |
diff --git a/ui/app_list/views/page_switcher.h b/ui/app_list/views/page_switcher_vertical.h |
similarity index 55% |
copy from ui/app_list/views/page_switcher.h |
copy to ui/app_list/views/page_switcher_vertical.h |
index 127124d05263f20669618f56795cb3db8a4027ee..3f94f21b30a3c463b460cab4a73dea4fa5a0bc41 100644 |
--- a/ui/app_list/views/page_switcher.h |
+++ b/ui/app_list/views/page_switcher_vertical.h |
@@ -2,13 +2,13 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_ |
-#define UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_ |
+#ifndef UI_APP_LIST_VIEWS_PAGE_SWITCHER_VERTICAL_H_ |
+#define UI_APP_LIST_VIEWS_PAGE_SWITCHER_VERTICAL_H_ |
#include "base/macros.h" |
#include "ui/app_list/pagination_model_observer.h" |
+#include "ui/app_list/views/page_switcher.h" |
#include "ui/views/controls/button/button.h" |
-#include "ui/views/view.h" |
namespace app_list { |
@@ -17,28 +17,23 @@ class PaginationModel; |
// PageSwitcher represents its underlying PaginationModel with a button strip. |
// Each page in the PageinationModel has a button in the strip and when the |
// button is clicked, the corresponding page becomes selected. |
-class PageSwitcher : public views::View, |
- public views::ButtonListener, |
- public PaginationModelObserver { |
+class PageSwitcherVertical : public views::ButtonListener, |
+ public PaginationModelObserver, |
+ public PageSwitcher { |
xiyuan
2017/06/13 18:29:55
nit: Make PageSwitcher the first one
weidongg
2017/06/13 21:25:00
Done.
|
public: |
- explicit PageSwitcher(PaginationModel* model); |
- ~PageSwitcher() override; |
+ explicit PageSwitcherVertical(PaginationModel* model); |
+ ~PageSwitcherVertical() override; |
- // Returns the page index of the page switcher button under the point. If no |
- // page switcher button is under the point, -1 is return. |point| is in |
- // PageSwitcher's coordinates. |
- int GetPageForPoint(const gfx::Point& point) const; |
- |
- // Shows hover for button under the point. |point| is in PageSwitcher's |
- // coordinates. |
- void UpdateUIForDragPoint(const gfx::Point& point); |
+ // Overridden from PageSwitcher: |
+ int GetPageForPoint(const gfx::Point& point) const override; |
+ void UpdateUIForDragPoint(const gfx::Point& point) override; |
// Overridden from views::View: |
gfx::Size CalculatePreferredSize() const override; |
void Layout() override; |
private: |
- void CalculateButtonWidthAndSpacing(int contents_width); |
+ void CalculateButtonHeightAndSpacing(int contents_height); |
// Overridden from views::ButtonListener: |
void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
@@ -50,11 +45,11 @@ class PageSwitcher : public views::View, |
void TransitionChanged() override; |
PaginationModel* model_; // Owned by AppsGridView. |
- views::View* buttons_; // Owned by views hierarchy. |
+ views::View* buttons_; // Owned by views hierarchy. |
- DISALLOW_COPY_AND_ASSIGN(PageSwitcher); |
+ DISALLOW_COPY_AND_ASSIGN(PageSwitcherVertical); |
}; |
} // namespace app_list |
-#endif // UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_ |
+#endif // UI_APP_LIST_VIEWS_PAGE_SWITCHER_VERTICAL_H_ |