Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_APP_LIST_PAGINATION_MODEL_H_ | |
| 6 #define ASH_APP_LIST_PAGINATION_MODEL_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ash/ash_export.h" | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/observer_list.h" | |
| 12 | |
| 13 namespace ash { | |
| 14 | |
| 15 class PaginationModelObserver; | |
| 16 | |
| 17 class ASH_EXPORT PaginationModel { | |
| 18 public: | |
| 19 PaginationModel(); | |
| 20 ~PaginationModel(); | |
| 21 | |
| 22 void SetTotalPages(int total_pages); | |
| 23 void SelectPage(int page); | |
| 24 | |
| 25 void AddObserver(PaginationModelObserver* observer); | |
| 26 void RemoveObserver(PaginationModelObserver* observer); | |
| 27 | |
| 28 int total_pages() const { | |
| 29 return total_pages_; | |
| 30 } | |
| 31 | |
| 32 int selected_page() const { | |
| 33 return selected_page_; | |
| 34 } | |
| 35 | |
| 36 private: | |
| 37 int total_pages_; | |
| 38 int selected_page_; | |
| 39 ObserverList<PaginationModelObserver> observers_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(PaginationModel); | |
| 42 }; | |
| 43 | |
| 44 } // namespace ui | |
|
tfarina
2012/05/04 22:39:19
nit: namespace ash
xiyuan
2012/05/04 23:00:28
Done.
| |
| 45 | |
| 46 #endif // ASH_APP_LIST_PAGINATION_MODEL_H_ | |
| OLD | NEW |