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

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

Issue 9479031: aura: Implement new app list mock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation error Created 8 years, 10 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/app_list.cc ('k') | ash/app_list/app_list_groups_view.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) 2011 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_APP_LIST_GROUPS_VIEW_H_
6 #define ASH_APP_LIST_APP_LIST_GROUPS_VIEW_H_
7 #pragma once
8
9 #include <string>
10 #include <vector>
11
12 #include "ash/ash_export.h"
13 #include "ui/base/models/list_model_observer.h"
14 #include "ui/views/controls/button/button.h"
15 #include "ui/views/view.h"
16
17 namespace views {
18 class BoundsAnimator;
19 }
20
21 namespace ash {
22
23 class AppListItemGroupView;
24 class AppListItemViewListener;
25 class AppListModel;
26
27 // AppListGroupsView displays the UI for an AppListModel. If there are more than
28 // one group in the model , a button strip is displayed to allow user to switch
29 // between pages.
30 class ASH_EXPORT AppListGroupsView : public views::View,
31 public views::ButtonListener,
32 public ui::ListModelObserver {
33 public:
34 AppListGroupsView(AppListModel* model,
35 AppListItemViewListener* listener);
36 virtual ~AppListGroupsView();
37
38 // Gets current focused tile.
39 views::View* GetFocusedTile() const;
40
41 private:
42 // Updates from model.
43 void Update();
44
45 // Adds a result group page.
46 void AddPage(const std::string& title, AppListItemGroupView* page);
47
48 // Gets preferred number of tiles per row.
49 int GetPreferredTilesPerRow() const;
50
51 // Gets current result page.
52 AppListItemGroupView* GetCurrentPageView() const;
53
54 // Sets current result page.
55 void SetCurrentPage(int page);
56
57 // Overridden from views::View:
58 virtual void Layout() OVERRIDE;
59 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
60
61 // Overridden from views::ButtonListener:
62 virtual void ButtonPressed(views::Button* sender,
63 const views::Event& event) OVERRIDE;
64
65 // Overridden from ListModelObserver:
66 virtual void ListItemsAdded(int start, int count) OVERRIDE;
67 virtual void ListItemsRemoved(int start, int count) OVERRIDE;
68 virtual void ListItemsChanged(int start, int count) OVERRIDE;
69
70 AppListModel* model_; // Owned by parent AppListView.
71 AppListItemViewListener* listener_;
72
73 std::vector<AppListItemGroupView*> pages_;
74 views::View* page_buttons_;
75 int current_page_;
76
77 scoped_ptr<views::BoundsAnimator> animator_;
78
79 DISALLOW_COPY_AND_ASSIGN(AppListGroupsView);
80 };
81
82 } // namespace ash
83
84 #endif // ASH_APP_LIST_APP_LIST_GROUPS_VIEW_H_
OLDNEW
« no previous file with comments | « ash/app_list/app_list.cc ('k') | ash/app_list/app_list_groups_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698