OLD | NEW |
| (Empty) |
1 // Copyright 2013 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_VIEWS_APPS_CONTAINER_VIEW_H_ | |
6 #define UI_APP_LIST_VIEWS_APPS_CONTAINER_VIEW_H_ | |
7 | |
8 #include "ui/views/view.h" | |
9 | |
10 namespace content { | |
11 class WebContents; | |
12 } | |
13 | |
14 namespace app_list { | |
15 | |
16 class AppsGridView; | |
17 class AppListFolderItem; | |
18 class AppListFolderView; | |
19 class AppListMainView; | |
20 class AppListModel; | |
21 class ContentsView; | |
22 class PaginationModel; | |
23 | |
24 // AppsContainerView contains a root level AppsGridView to render the root level | |
25 // app items, and a AppListFolderView to render the app items inside the | |
26 // active folder. Only one if them is visible to user at any time. | |
27 class AppsContainerView : public views::View { | |
28 public: | |
29 AppsContainerView(AppListMainView* app_list_main_view, | |
30 PaginationModel* pagination_model, | |
31 AppListModel* model, | |
32 content::WebContents* start_page_contents); | |
33 virtual ~AppsContainerView(); | |
34 | |
35 // Shows the active folder content specified by |folder_item|. | |
36 void ShowActiveFolder(AppListFolderItem* folder_item); | |
37 | |
38 // Shows the apps list from root. | |
39 void ShowApps(); | |
40 | |
41 // Overridden from views::View: | |
42 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
43 virtual void Layout() OVERRIDE; | |
44 | |
45 AppsGridView* apps_grid_view() { return apps_grid_view_; } | |
46 | |
47 private: | |
48 enum ShowState { | |
49 SHOW_APPS, | |
50 SHOW_ACTIVE_FOLDER, | |
51 }; | |
52 | |
53 void SetShowState(ShowState show_state); | |
54 | |
55 AppListModel* model_; | |
56 AppsGridView* apps_grid_view_; // Owned by views hierarchy. | |
57 AppListFolderView* app_list_folder_view_; // Owned by views hierarchy. | |
58 ShowState show_state_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(AppsContainerView); | |
61 }; | |
62 | |
63 } // namespace app_list | |
64 | |
65 | |
66 #endif // UI_APP_LIST_VIEWS_APPS_CONTAINER_VIEW_H_ | |
OLD | NEW |