Chromium Code Reviews| Index: ui/app_list/views/apps_container_view.h |
| diff --git a/ui/app_list/views/apps_container_view.h b/ui/app_list/views/apps_container_view.h |
| index 802f033efc22a077be633ae1c850f420b64eaec1..0dc319a7effa446a14bae0f628a0d4e861a2fc46 100644 |
| --- a/ui/app_list/views/apps_container_view.h |
| +++ b/ui/app_list/views/apps_container_view.h |
| @@ -5,6 +5,7 @@ |
| #ifndef UI_APP_LIST_VIEWS_APPS_CONTAINER_VIEW_H_ |
| #define UI_APP_LIST_VIEWS_APPS_CONTAINER_VIEW_H_ |
| +#include "ui/app_list/app_list_folder_item.h" |
| #include "ui/views/view.h" |
| namespace content { |
| @@ -21,10 +22,25 @@ class AppListModel; |
| class ContentsView; |
| class PaginationModel; |
| +class TopIconAnimationObserver { |
| + public: |
| + // Called when top icon animation completes. |
| + virtual void OnTopIconAnimationsComplete(views::View* icon_view) {} |
| + |
| + protected: |
| + TopIconAnimationObserver() {} |
| + virtual ~TopIconAnimationObserver() {} |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(TopIconAnimationObserver); |
| +}; |
| + |
| // AppsContainerView contains a root level AppsGridView to render the root level |
| // app items, and a AppListFolderView to render the app items inside the |
| // active folder. Only one if them is visible to user at any time. |
| -class AppsContainerView : public views::View { |
| +class AppsContainerView : public views::View, |
| + public TopIconAnimationObserver |
| +{ |
|
xiyuan
2014/01/16 01:46:48
nit: This goes to the end of previous line.
jennyz
2014/01/16 17:49:52
Done.
|
| public: |
| AppsContainerView(AppListMainView* app_list_main_view, |
| PaginationModel* pagination_model, |
| @@ -35,14 +51,18 @@ class AppsContainerView : public views::View { |
| // Shows the active folder content specified by |folder_item|. |
| void ShowActiveFolder(AppListFolderItem* folder_item); |
| - // Shows the apps list from root. |
| - void ShowApps(); |
| + // Shows the root level apps list. This is called when UI navigate back from |
| + // a folder view with |folder_item|. |
| + void ShowApps(AppListFolderItem* folder_item); |
| // Overridden from views::View: |
| virtual gfx::Size GetPreferredSize() OVERRIDE; |
| virtual void Layout() OVERRIDE; |
| virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
| + // Overridden from TopIconAnimationObserver. |
| + virtual void OnTopIconAnimationsComplete(views::View* icon_view) OVERRIDE; |
| + |
| AppsGridView* apps_grid_view() { return apps_grid_view_; } |
| private: |
| @@ -53,11 +73,26 @@ class AppsContainerView : public views::View { |
| void SetShowState(ShowState show_state); |
| + // Calculates the top item icon bounds in the active folder icon. The bounds |
| + // is relative to AppsContainerView. |
| + // Returns the bounds of top items' icon in sequence of top left, top right, |
| + // bottom left, bottom right. |
| + TopIconsBounds GetTopItemIconBoundsInActiveFolder(); |
| + |
| + // Creates the transitional views for animating the top items in the folder |
| + // when opening or closing a folder. |
| + void CreateViewsForFolderTopItemsAnimation( |
| + AppListFolderItem* active_folder, bool open_folder); |
| + |
| AppListModel* model_; |
| AppsGridView* apps_grid_view_; // Owned by views hierarchy. |
| AppListFolderView* app_list_folder_view_; // Owned by views hierarchy. |
| ShowState show_state_; |
| + // The transitional views for animating the top items in folder |
| + // when opening or closing a folder. |
| + std::vector<views::View*> top_icon_views_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AppsContainerView); |
| }; |