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

Unified Diff: ui/app_list/views/apps_container_view.h

Issue 140203003: Implement animation UI for opening/closing an app list folder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address code review comments. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/views/app_list_item_view.cc ('k') | ui/app_list/views/apps_container_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2d339d5a441716df6f30a9eb16d3b8c1ced22d67 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,24 @@ 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 {
public:
AppsContainerView(AppListMainView* app_list_main_view,
PaginationModel* pagination_model,
@@ -35,14 +50,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 +72,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.
+ Rects 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);
};
« no previous file with comments | « ui/app_list/views/app_list_item_view.cc ('k') | ui/app_list/views/apps_container_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698