| OLD | NEW |
| 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 "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 9 #include "ui/app_list/views/search_box_view_delegate.h" | 10 #include "ui/app_list/views/search_box_view_delegate.h" |
| 10 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
| 11 | 12 |
| 12 namespace app_list { | 13 namespace app_list { |
| 13 class AppListViewDelegate; | 14 class AppListViewDelegate; |
| 14 class SearchBoxView; | 15 class SearchBoxView; |
| 15 class SearchResultListView; | 16 class SearchResultListView; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace athena { | 19 namespace athena { |
| 19 | 20 |
| 20 class AthenaStartPageView : public views::View, | 21 class ATHENA_EXPORT AthenaStartPageView |
| 21 public app_list::SearchBoxViewDelegate { | 22 : public views::View, |
| 23 public app_list::SearchBoxViewDelegate { |
| 22 public: | 24 public: |
| 23 explicit AthenaStartPageView(app_list::AppListViewDelegate* delegate); | 25 explicit AthenaStartPageView(app_list::AppListViewDelegate* delegate); |
| 24 virtual ~AthenaStartPageView(); | 26 virtual ~AthenaStartPageView(); |
| 25 | 27 |
| 26 // Requests the focus on the search box in the start page view. | 28 // Requests the focus on the search box in the start page view. |
| 27 void RequestFocusOnSearchBox(); | 29 void RequestFocusOnSearchBox(); |
| 28 | 30 |
| 29 // Updates the layout state. See the comment of |layout_state_| field. | 31 // Updates the layout state. See the comment of |layout_state_| field. |
| 30 void SetLayoutState(float layout_state); | 32 void SetLayoutState(float layout_state); |
| 31 | 33 |
| 32 // Updates the layout state and move the subviews to the target location with | 34 // Updates the layout state and move the subviews to the target location with |
| 33 // animation. | 35 // animation. |
| 34 void SetLayoutStateWithAnimation(float layout_state); | 36 void SetLayoutStateWithAnimation(float layout_state); |
| 35 | 37 |
| 36 private: | 38 private: |
| 39 friend class AthenaStartPageViewTest; |
| 40 |
| 37 static const char kViewClassName[]; | 41 static const char kViewClassName[]; |
| 38 | 42 |
| 39 // A struct which bundles the layout data of subviews. | 43 // A struct which bundles the layout data of subviews. |
| 40 struct LayoutData { | 44 struct LayoutData { |
| 41 gfx::Rect search_box; | 45 gfx::Rect search_box; |
| 42 gfx::Rect icons; | 46 gfx::Rect icons; |
| 43 gfx::Rect controls; | 47 gfx::Rect controls; |
| 44 float logo_opacity; | 48 float logo_opacity; |
| 45 float background_opacity; | 49 float background_opacity; |
| 46 | 50 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 float layout_state_; | 95 float layout_state_; |
| 92 | 96 |
| 93 base::WeakPtrFactory<AthenaStartPageView> weak_factory_; | 97 base::WeakPtrFactory<AthenaStartPageView> weak_factory_; |
| 94 | 98 |
| 95 DISALLOW_COPY_AND_ASSIGN(AthenaStartPageView); | 99 DISALLOW_COPY_AND_ASSIGN(AthenaStartPageView); |
| 96 }; | 100 }; |
| 97 | 101 |
| 98 } // namespace athena | 102 } // namespace athena |
| 99 | 103 |
| 100 #endif // ATHENA_HOME_ATHENA_START_PAGE_VIEW_H_ | 104 #endif // ATHENA_HOME_ATHENA_START_PAGE_VIEW_H_ |
| OLD | NEW |