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

Side by Side Diff: ui/app_list/contents_view.h

Issue 11784034: Skeleton for app_list on OSX, and refactoring for enable_app_list=1 on OS=="mac". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase for 175876 and 175961 Created 7 years, 11 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
« no previous file with comments | « ui/app_list/cocoa/app_list_view_window_unittest.mm ('k') | ui/app_list/contents_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) 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 UI_APP_LIST_CONTENTS_VIEW_H_
6 #define UI_APP_LIST_CONTENTS_VIEW_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/views/view.h"
12
13 namespace views {
14 class BoundsAnimator;
15 class ViewModel;
16 }
17
18 namespace app_list {
19
20 class AppListModel;
21 class AppListView;
22 class PaginationModel;
23
24 // A view to manage sub views under the search box (apps grid view + page
25 // switcher and search results). The two sets of sub views are mutually
26 // exclusive. ContentsView manages a show state to choose one set to show
27 // and animates the transition between show states.
28 class ContentsView : public views::View {
29 public:
30 ContentsView(AppListView* app_list_view,
31 PaginationModel* pagination_model);
32 virtual ~ContentsView();
33
34 void SetModel(AppListModel* model);
35
36 void ShowSearchResults(bool show);
37
38 private:
39 enum ShowState {
40 SHOW_APPS,
41 SHOW_SEARCH_RESULTS,
42 };
43
44 // Sets show state.
45 void SetShowState(ShowState show_state);
46
47 // Invoked when show state is changed.
48 void ShowStateChanged();
49
50 void CalculateIdealBounds();
51 void AnimateToIdealBounds();
52
53 // Overridden from views::View:
54 virtual gfx::Size GetPreferredSize() OVERRIDE;
55 virtual void Layout() OVERRIDE;
56 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
57 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE;
58
59 // Overridden from ui::EventHandler:
60 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
61 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
62
63 ShowState show_state_;
64 PaginationModel* pagination_model_; // Owned by AppListController.
65
66 scoped_ptr<views::ViewModel> view_model_;
67 scoped_ptr<views::BoundsAnimator> bounds_animator_;
68
69 DISALLOW_COPY_AND_ASSIGN(ContentsView);
70 };
71
72 } // namespace app_list
73
74 #endif // UI_APP_LIST_CONTENTS_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/cocoa/app_list_view_window_unittest.mm ('k') | ui/app_list/contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698