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

Unified Diff: athena/home/athena_start_page_view.h

Issue 478293004: Refactor the home card structure and introduce animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 4 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 | « no previous file | athena/home/athena_start_page_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/athena_start_page_view.h
diff --git a/athena/home/athena_start_page_view.h b/athena/home/athena_start_page_view.h
index e8a78936a1d0790c181ef65c961ca46480339003..09c30d7667a3c605591015e91a3988fd4a6eb71f 100644
--- a/athena/home/athena_start_page_view.h
+++ b/athena/home/athena_start_page_view.h
@@ -17,8 +17,6 @@ class SearchResultListView;
namespace athena {
-// It will replace app_list::StartPageView in Athena UI in the future.
-// Right now it's simply used for VISIBLE_BOTTOM state.
class AthenaStartPageView : public views::View,
public app_list::SearchBoxViewDelegate {
public:
@@ -28,7 +26,33 @@ class AthenaStartPageView : public views::View,
// Requests the focus on the search box in the start page view.
void RequestFocusOnSearchBox();
+ // Updates the layout state. See the comment of |layout_state_| field.
+ void SetLayoutState(float layout_state);
+
+ // Updates the layout state and move the subviews to the target location with
+ // animation.
+ void SetLayoutStateWithAnimation(float layout_state);
+
private:
+ static const char kViewClassName[];
+
+ // A struct which bundles the layout data of subviews.
+ struct LayoutData {
+ gfx::Rect search_box;
+ gfx::Rect icons;
+ gfx::Rect controls;
+ float logo_opacity;
+ float background_opacity;
+
+ LayoutData();
+ };
+
+ // Returns the bounds for |VISIBLE_BOTTOM|.
+ LayoutData CreateBottomBounds(int width);
+
+ // Returns the bounds for |VISIBLE_CENTERED|.
+ LayoutData CreateCenteredBounds(int width);
+
// Schedules the animation for the layout the search box and the search
// results.
void LayoutSearchResults(bool should_show_search_results);
@@ -55,9 +79,17 @@ class AthenaStartPageView : public views::View,
app_list::SearchBoxView* search_box_view_;
app_list::SearchResultListView* search_results_view_;
+ // Do not use views::Background but a views::View with ui::Layer for gradient
+ // background opacity update and animation.
+ views::View* background_;
+
// The expected height of |search_results_view_|
int search_results_height_;
+ // The state to specify how each of the subviews should be laid out, in the
+ // range of [0, 1]. 0 means fully BOTTOM state, and 1 is fully CENTERED state.
+ float layout_state_;
+
base::WeakPtrFactory<AthenaStartPageView> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(AthenaStartPageView);
« no previous file with comments | « no previous file | athena/home/athena_start_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698