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

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

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/pagination_model.h ('k') | ash/app_list/pagination_model_observer.h » ('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 #include "ash/app_list/pagination_model.h"
6
7 #include "ash/app_list/pagination_model_observer.h"
8
9 namespace ash {
10
11 PaginationModel::PaginationModel()
12 : total_pages_(-1),
13 selected_page_(-1) {
14 }
15
16 PaginationModel::~PaginationModel() {
17 }
18
19 void PaginationModel::SetTotalPages(int total_pages) {
20 if (total_pages == total_pages_)
21 return;
22
23 total_pages_ = total_pages;
24 FOR_EACH_OBSERVER(PaginationModelObserver,
25 observers_,
26 TotalPagesChanged());
27 }
28
29 void PaginationModel::SelectPage(int page) {
30 DCHECK(page >= 0 && page < total_pages_);
31
32 if (page == selected_page_)
33 return;
34
35 int old_selected = selected_page_;
36 selected_page_ = page;
37 FOR_EACH_OBSERVER(PaginationModelObserver,
38 observers_,
39 SelectedPageChanged(old_selected, selected_page_));
40 }
41
42 void PaginationModel::AddObserver(PaginationModelObserver* observer) {
43 observers_.AddObserver(observer);
44 }
45
46 void PaginationModel::RemoveObserver(PaginationModelObserver* observer) {
47 observers_.RemoveObserver(observer);
48 }
49
50 } // namespace ash
OLDNEW
« no previous file with comments | « ash/app_list/pagination_model.h ('k') | ash/app_list/pagination_model_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698