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

Side by Side Diff: athena/home/athena_start_page_view.h

Issue 483033003: [Athena] Add status icons and system time to the centered home card (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 ATHENA_HOME_ATHENA_START_PAGE_VIEW_H_ 5 #ifndef ATHENA_HOME_ATHENA_START_PAGE_VIEW_H_
6 #define ATHENA_HOME_ATHENA_START_PAGE_VIEW_H_ 6 #define ATHENA_HOME_ATHENA_START_PAGE_VIEW_H_
7 7
8 #include "athena/athena_export.h" 8 #include "athena/athena_export.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "ui/app_list/views/search_box_view_delegate.h" 10 #include "ui/app_list/views/search_box_view_delegate.h"
(...skipping 27 matching lines...) Expand all
38 private: 38 private:
39 friend class AthenaStartPageViewTest; 39 friend class AthenaStartPageViewTest;
40 40
41 static const char kViewClassName[]; 41 static const char kViewClassName[];
42 42
43 // A struct which bundles the layout data of subviews. 43 // A struct which bundles the layout data of subviews.
44 struct LayoutData { 44 struct LayoutData {
45 gfx::Rect search_box; 45 gfx::Rect search_box;
46 gfx::Rect icons; 46 gfx::Rect icons;
47 gfx::Rect controls; 47 gfx::Rect controls;
48 float top_view_opacity;
48 float logo_opacity; 49 float logo_opacity;
49 float background_opacity; 50 float background_opacity;
50 51
51 LayoutData(); 52 LayoutData();
52 }; 53 };
53 54
54 // Returns the bounds for |VISIBLE_BOTTOM|. 55 // Returns the bounds for |VISIBLE_BOTTOM|.
55 LayoutData CreateBottomBounds(int width); 56 LayoutData CreateBottomBounds(int width);
56 57
57 // Returns the bounds for |VISIBLE_CENTERED|. 58 // Returns the bounds for |VISIBLE_CENTERED|.
58 LayoutData CreateCenteredBounds(int width); 59 LayoutData CreateCenteredBounds(int width);
59 60
60 // Schedules the animation for the layout the search box and the search 61 // Schedules the animation for the layout the search box and the search
61 // results. 62 // results.
62 void LayoutSearchResults(bool should_show_search_results); 63 void LayoutSearchResults(bool should_show_search_results);
63 64
64 // Called when the animation of search box / search results layout has 65 // Called when the animation of search box / search results layout has
65 // completed. 66 // completed.
66 void OnSearchResultLayoutAnimationCompleted(bool should_show_search_results); 67 void OnSearchResultLayoutAnimationCompleted(bool should_show_search_results);
67 68
68 // views::View: 69 // views::View:
69 virtual void Layout() OVERRIDE; 70 virtual void Layout() OVERRIDE;
70 virtual bool OnKeyPressed(const ui::KeyEvent& key_event) OVERRIDE; 71 virtual bool OnKeyPressed(const ui::KeyEvent& key_event) OVERRIDE;
72 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
71 73
72 // app_list::SearchBoxViewDelegate: 74 // app_list::SearchBoxViewDelegate:
73 virtual void QueryChanged(app_list::SearchBoxView* sender) OVERRIDE; 75 virtual void QueryChanged(app_list::SearchBoxView* sender) OVERRIDE;
74 76
75 // Not owned. 77 // Not owned.
76 app_list::AppListViewDelegate* delegate_; 78 app_list::AppListViewDelegate* delegate_;
77 79
78 // Views are owned through its hierarchy. 80 // Views are owned through its hierarchy.
81 views::View* time_view_;
82 views::View* status_icon_view_;
sadrul 2014/09/02 15:11:14 Instead of having these two separate items, can th
Jun Mukai 2014/09/02 17:00:58 +1
pkotwicz 2014/09/02 19:47:49 Done.
79 views::View* app_icon_container_; 83 views::View* app_icon_container_;
80 views::View* search_box_container_; 84 views::View* search_box_container_;
81 views::View* control_icon_container_; 85 views::View* control_icon_container_;
82 views::View* logo_; 86 views::View* logo_;
83 app_list::SearchBoxView* search_box_view_; 87 app_list::SearchBoxView* search_box_view_;
84 app_list::SearchResultListView* search_results_view_; 88 app_list::SearchResultListView* search_results_view_;
85 89
86 // Do not use views::Background but a views::View with ui::Layer for gradient 90 // Do not use views::Background but a views::View with ui::Layer for gradient
87 // background opacity update and animation. 91 // background opacity update and animation.
88 views::View* background_; 92 views::View* background_;
89 93
90 // The expected height of |search_results_view_| 94 // The expected height of |search_results_view_|
91 int search_results_height_; 95 int search_results_height_;
92 96
93 // The state to specify how each of the subviews should be laid out, in the 97 // The state to specify how each of the subviews should be laid out, in the
94 // range of [0, 1]. 0 means fully BOTTOM state, and 1 is fully CENTERED state. 98 // range of [0, 1]. 0 means fully BOTTOM state, and 1 is fully CENTERED state.
95 float layout_state_; 99 float layout_state_;
96 100
97 base::WeakPtrFactory<AthenaStartPageView> weak_factory_; 101 base::WeakPtrFactory<AthenaStartPageView> weak_factory_;
98 102
99 DISALLOW_COPY_AND_ASSIGN(AthenaStartPageView); 103 DISALLOW_COPY_AND_ASSIGN(AthenaStartPageView);
100 }; 104 };
101 105
102 } // namespace athena 106 } // namespace athena
103 107
104 #endif // ATHENA_HOME_ATHENA_START_PAGE_VIEW_H_ 108 #endif // ATHENA_HOME_ATHENA_START_PAGE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698