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

Side by Side Diff: ash/app_list/pagination_model.h

Issue 10388032: Move app list from ash to ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix win_aura bot and comments in #5 Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/app_list/page_switcher.cc ('k') | ash/app_list/pagination_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 // A simple pagination model that consists of two numbers: the total pages and
18 // the currently selected page. The model is a single selection model that at
19 // the most one page can become selected at any time.
20 class ASH_EXPORT PaginationModel {
21 public:
22 PaginationModel();
23 ~PaginationModel();
24
25 void SetTotalPages(int total_pages);
26 void SelectPage(int page);
27
28 void AddObserver(PaginationModelObserver* observer);
29 void RemoveObserver(PaginationModelObserver* observer);
30
31 int total_pages() const {
32 return total_pages_;
33 }
34
35 int selected_page() const {
36 return selected_page_;
37 }
38
39 private:
40 int total_pages_;
41 int selected_page_;
42 ObserverList<PaginationModelObserver> observers_;
43
44 DISALLOW_COPY_AND_ASSIGN(PaginationModel);
45 };
46
47 } // namespace ash
48
49 #endif // ASH_APP_LIST_PAGINATION_MODEL_H_
OLDNEW
« no previous file with comments | « ash/app_list/page_switcher.cc ('k') | ash/app_list/pagination_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698