OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_FOLDER_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_FOLDER_VIEW_H_ |
6 #define UI_APP_LIST_VIEWS_APP_LIST_FOLDER_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_APP_LIST_FOLDER_VIEW_H_ |
7 | 7 |
8 #include "ui/app_list/views/folder_header_view.h" | 8 #include "ui/app_list/views/folder_header_view.h" |
9 #include "ui/app_list/views/folder_header_view_delegate.h" | 9 #include "ui/app_list/views/folder_header_view_delegate.h" |
| 10 #include "ui/compositor/layer_animation_observer.h" |
10 #include "ui/views/controls/button/button.h" | 11 #include "ui/views/controls/button/button.h" |
11 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 class WebContents; | 15 class WebContents; |
15 } | 16 } |
16 | 17 |
17 namespace views { | 18 namespace views { |
18 class ViewModel; | 19 class ViewModel; |
19 } | 20 } |
20 | 21 |
21 namespace app_list { | 22 namespace app_list { |
22 | 23 |
23 class AppsContainerView; | 24 class AppsContainerView; |
24 class AppsGridView; | 25 class AppsGridView; |
25 class AppListFolderItem; | 26 class AppListFolderItem; |
26 class AppListMainView; | 27 class AppListMainView; |
27 class AppListModel; | 28 class AppListModel; |
28 class FolderHeaderView; | 29 class FolderHeaderView; |
29 class PaginationModel; | 30 class PaginationModel; |
30 | 31 |
31 class AppListFolderView : public views::View, | 32 class AppListFolderView : public views::View, |
32 public FolderHeaderViewDelegate { | 33 public FolderHeaderViewDelegate, |
| 34 public ui::ImplicitAnimationObserver { |
33 public: | 35 public: |
34 AppListFolderView(AppsContainerView* container_view, | 36 AppListFolderView(AppsContainerView* container_view, |
35 AppListModel* model, | 37 AppListModel* model, |
36 AppListMainView* app_list_main_view, | 38 AppListMainView* app_list_main_view, |
37 content::WebContents* start_page_contents); | 39 content::WebContents* start_page_contents); |
38 virtual ~AppListFolderView(); | 40 virtual ~AppListFolderView(); |
39 | 41 |
40 void SetAppListFolderItem(AppListFolderItem* folder); | 42 void SetAppListFolderItem(AppListFolderItem* folder); |
41 | 43 |
42 // Overridden from views::View: | 44 // Schedules an animation to show or hide the view. |
| 45 void ScheduleShowHideAnimation(bool show); |
| 46 |
| 47 // Gets icon image bounds of the item at |index|, relative to |
| 48 // AppListFolderView. |
| 49 gfx::Rect GetItemIconBoundsAt(int index); |
| 50 |
| 51 // views::View overrides: |
43 virtual gfx::Size GetPreferredSize() OVERRIDE; | 52 virtual gfx::Size GetPreferredSize() OVERRIDE; |
44 virtual void Layout() OVERRIDE; | 53 virtual void Layout() OVERRIDE; |
45 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 54 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
46 | 55 |
| 56 // ui::ImplicitAnimationObserver overrides: |
| 57 virtual void OnImplicitAnimationsCompleted() OVERRIDE; |
| 58 |
47 private: | 59 private: |
48 void CalculateIdealBounds(); | 60 void CalculateIdealBounds(); |
49 | 61 |
50 // Overridden from FolderHeaderViewDelegate: | 62 // Overridden from FolderHeaderViewDelegate: |
51 virtual void NavigateBack(AppListFolderItem* item, | 63 virtual void NavigateBack(AppListFolderItem* item, |
52 const ui::Event& event_flags) OVERRIDE; | 64 const ui::Event& event_flags) OVERRIDE; |
53 | 65 |
54 AppsContainerView* container_view_; // Not owned. | 66 AppsContainerView* container_view_; // Not owned. |
55 FolderHeaderView* folder_header_view_; // Owned by views hierarchy. | 67 FolderHeaderView* folder_header_view_; // Owned by views hierarchy. |
56 AppsGridView* items_grid_view_; // Owned by the views hierarchy. | 68 AppsGridView* items_grid_view_; // Owned by the views hierarchy. |
57 | 69 |
58 scoped_ptr<views::ViewModel> view_model_; | 70 scoped_ptr<views::ViewModel> view_model_; |
59 | 71 |
60 AppListFolderItem* folder_item_; // Not owned. | 72 AppListFolderItem* folder_item_; // Not owned. |
61 | 73 |
62 scoped_ptr<PaginationModel> pagination_model_; | 74 scoped_ptr<PaginationModel> pagination_model_; |
63 | 75 |
64 DISALLOW_COPY_AND_ASSIGN(AppListFolderView); | 76 DISALLOW_COPY_AND_ASSIGN(AppListFolderView); |
65 }; | 77 }; |
66 | 78 |
67 } // namespace app_list | 79 } // namespace app_list |
68 | 80 |
69 #endif // UI_APP_LIST_VIEWS_APP_LIST_FOLDER_VIEW_H_ | 81 #endif // UI_APP_LIST_VIEWS_APP_LIST_FOLDER_VIEW_H_ |
70 | 82 |
71 | 83 |
OLD | NEW |