Chromium Code Reviews| 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 animation to show or hide the view. |
|
xiyuan
2014/01/16 01:46:48
nit: Schedules _an_ animation
jennyz
2014/01/16 17:49:52
Done.
| |
| 45 void ScheduleAnimationToShow(bool show); | |
|
xiyuan
2014/01/16 01:46:48
nit: ScheduleAnimationToShow makes reader think it
jennyz
2014/01/16 17:49:52
Done.
| |
| 46 | |
| 47 // Gets icon image bounds of the item at |index|, relative to | |
| 48 // AppListFolderView. | |
| 49 gfx::Rect GetItemIconBoundsAt(int index); | |
| 50 | |
| 51 | |
|
xiyuan
2014/01/16 01:46:48
nit: nuke one empty line
jennyz
2014/01/16 17:49:52
Done.
| |
| 52 // views::View overrides: | |
| 43 virtual gfx::Size GetPreferredSize() OVERRIDE; | 53 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 44 virtual void Layout() OVERRIDE; | 54 virtual void Layout() OVERRIDE; |
| 45 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 55 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
| 46 | 56 |
| 57 // ui::ImplicitAnimationObserver overrides: | |
| 58 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | |
| 59 | |
| 47 private: | 60 private: |
| 48 void CalculateIdealBounds(); | 61 void CalculateIdealBounds(); |
| 49 | 62 |
| 50 // Overridden from FolderHeaderViewDelegate: | 63 // Overridden from FolderHeaderViewDelegate: |
| 51 virtual void NavigateBack(AppListFolderItem* item, | 64 virtual void NavigateBack(AppListFolderItem* item, |
| 52 const ui::Event& event_flags) OVERRIDE; | 65 const ui::Event& event_flags) OVERRIDE; |
| 53 | 66 |
| 54 AppsContainerView* container_view_; // Not owned. | 67 AppsContainerView* container_view_; // Not owned. |
| 55 FolderHeaderView* folder_header_view_; // Owned by views hierarchy. | 68 FolderHeaderView* folder_header_view_; // Owned by views hierarchy. |
| 56 AppsGridView* items_grid_view_; // Owned by the views hierarchy. | 69 AppsGridView* items_grid_view_; // Owned by the views hierarchy. |
| 57 | 70 |
| 58 scoped_ptr<views::ViewModel> view_model_; | 71 scoped_ptr<views::ViewModel> view_model_; |
| 59 | 72 |
| 60 AppListFolderItem* folder_item_; // Not owned. | 73 AppListFolderItem* folder_item_; // Not owned. |
| 61 | 74 |
| 62 scoped_ptr<PaginationModel> pagination_model_; | 75 scoped_ptr<PaginationModel> pagination_model_; |
| 63 | 76 |
| 77 // Animated to show or hide the view. | |
| 78 bool animate_to_show_; | |
| 79 | |
| 64 DISALLOW_COPY_AND_ASSIGN(AppListFolderView); | 80 DISALLOW_COPY_AND_ASSIGN(AppListFolderView); |
| 65 }; | 81 }; |
| 66 | 82 |
| 67 } // namespace app_list | 83 } // namespace app_list |
| 68 | 84 |
| 69 #endif // UI_APP_LIST_VIEWS_APP_LIST_FOLDER_VIEW_H_ | 85 #endif // UI_APP_LIST_VIEWS_APP_LIST_FOLDER_VIEW_H_ |
| 70 | 86 |
| 71 | 87 |
| OLD | NEW |