| OLD | NEW |
| 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_APP_LIST_PAGE_SWITCHER_H_ | 5 #ifndef UI_APP_LIST_PAGE_SWITCHER_H_ |
| 6 #define UI_APP_LIST_PAGE_SWITCHER_H_ | 6 #define UI_APP_LIST_PAGE_SWITCHER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "ui/app_list/pagination_model_observer.h" | 9 #include "ui/app_list/pagination_model_observer.h" |
| 10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public PaginationModelObserver { | 22 public PaginationModelObserver { |
| 23 public: | 23 public: |
| 24 explicit PageSwitcher(PaginationModel* model); | 24 explicit PageSwitcher(PaginationModel* model); |
| 25 virtual ~PageSwitcher(); | 25 virtual ~PageSwitcher(); |
| 26 | 26 |
| 27 // Overridden from views::View: | 27 // Overridden from views::View: |
| 28 virtual gfx::Size GetPreferredSize() OVERRIDE; | 28 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 29 virtual void Layout() OVERRIDE; | 29 virtual void Layout() OVERRIDE; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 void CalculateButtonWidth(int contents_width); | 32 void CalculateButtonWidthAndSpacing(int contents_width); |
| 33 | 33 |
| 34 // Overridden from views::ButtonListener: | 34 // Overridden from views::ButtonListener: |
| 35 virtual void ButtonPressed(views::Button* sender, | 35 virtual void ButtonPressed(views::Button* sender, |
| 36 const ui::Event& event) OVERRIDE; | 36 const ui::Event& event) OVERRIDE; |
| 37 | 37 |
| 38 // Overridden from PaginationModelObserver: | 38 // Overridden from PaginationModelObserver: |
| 39 virtual void TotalPagesChanged() OVERRIDE; | 39 virtual void TotalPagesChanged() OVERRIDE; |
| 40 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; | 40 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; |
| 41 virtual void TransitionChanged() OVERRIDE; | 41 virtual void TransitionChanged() OVERRIDE; |
| 42 | 42 |
| 43 PaginationModel* model_; // Owned by parent AppListView. | 43 PaginationModel* model_; // Owned by parent AppListView. |
| 44 views::View* buttons_; // Owned by views hierarchy. | 44 views::View* buttons_; // Owned by views hierarchy. |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(PageSwitcher); | 46 DISALLOW_COPY_AND_ASSIGN(PageSwitcher); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace app_list | 49 } // namespace app_list |
| 50 | 50 |
| 51 #endif // UI_APP_LIST_PAGE_SWITCHER_H_ | 51 #endif // UI_APP_LIST_PAGE_SWITCHER_H_ |
| OLD | NEW |