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

Unified Diff: ui/app_list/views/page_switcher_horizontal.h

Issue 2938563002: Vertically centered app list page switcher (Closed)
Patch Set: Clean up code Created 3 years, 6 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
Index: ui/app_list/views/page_switcher_horizontal.h
diff --git a/ui/app_list/views/page_switcher.h b/ui/app_list/views/page_switcher_horizontal.h
similarity index 57%
copy from ui/app_list/views/page_switcher.h
copy to ui/app_list/views/page_switcher_horizontal.h
index 127124d05263f20669618f56795cb3db8a4027ee..c7f46a307b6e309c2de0e6287c8f593f1d14e5e7 100644
--- a/ui/app_list/views/page_switcher.h
+++ b/ui/app_list/views/page_switcher_horizontal.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_HORIZONTAL_H_
+#define UI_APP_LIST_VIEWS_PAGE_SWITCHER_HORIZONTAL_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,21 +17,16 @@ 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 PageSwitcherHorizontal : public PageSwitcher,
+ public views::ButtonListener,
+ public PaginationModelObserver {
public:
- explicit PageSwitcher(PaginationModel* model);
- ~PageSwitcher() override;
+ explicit PageSwitcherHorizontal(PaginationModel* model);
+ ~PageSwitcherHorizontal() 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;
@@ -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(PageSwitcherHorizontal);
};
} // namespace app_list
-#endif // UI_APP_LIST_VIEWS_PAGE_SWITCHER_H_
+#endif // UI_APP_LIST_VIEWS_PAGE_SWITCHER_HORIZONTAL_H_

Powered by Google App Engine
This is Rietveld 408576698