OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 StartPageView* start_page_view() { return start_page_view_; } | 81 StartPageView* start_page_view() { return start_page_view_; } |
82 SearchResultListView* search_results_view() { return search_results_view_; } | 82 SearchResultListView* search_results_view() { return search_results_view_; } |
83 | 83 |
84 // Overridden from views::View: | 84 // Overridden from views::View: |
85 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 85 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
86 virtual void Layout() OVERRIDE; | 86 virtual void Layout() OVERRIDE; |
87 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 87 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
88 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; | 88 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; |
89 | 89 |
90 private: | 90 private: |
| 91 // Sets the active launcher page, accounting for whether the change is for |
| 92 // search results. |
| 93 void SetActivePageInternal(int page_index, bool show_search_results); |
| 94 |
91 // Invoked when active view is changed. | 95 // Invoked when active view is changed. |
92 void ActivePageChanged(); | 96 void ActivePageChanged(bool show_search_results); |
93 | 97 |
94 void CalculateIdealBounds(); | 98 void CalculateIdealBounds(); |
95 void AnimateToIdealBounds(); | 99 void AnimateToIdealBounds(); |
96 | 100 |
97 // Adds |view| as a new page to the end of the list of launcher pages. The | 101 // Adds |view| as a new page to the end of the list of launcher pages. The |
98 // view is inserted as a child of the ContentsView. There is no name | 102 // view is inserted as a child of the ContentsView. There is no name |
99 // associated with the page. Returns the index of the new page. | 103 // associated with the page. Returns the index of the new page. |
100 int AddLauncherPage(views::View* view); | 104 int AddLauncherPage(views::View* view); |
101 | 105 |
102 // Adds |view| as a new page to the end of the list of launcher pages. The | 106 // Adds |view| as a new page to the end of the list of launcher pages. The |
(...skipping 22 matching lines...) Expand all Loading... |
125 // Maps NamedPage onto |view_model_| indices. | 129 // Maps NamedPage onto |view_model_| indices. |
126 std::map<NamedPage, int> named_page_to_view_; | 130 std::map<NamedPage, int> named_page_to_view_; |
127 scoped_ptr<views::BoundsAnimator> bounds_animator_; | 131 scoped_ptr<views::BoundsAnimator> bounds_animator_; |
128 | 132 |
129 DISALLOW_COPY_AND_ASSIGN(ContentsView); | 133 DISALLOW_COPY_AND_ASSIGN(ContentsView); |
130 }; | 134 }; |
131 | 135 |
132 } // namespace app_list | 136 } // namespace app_list |
133 | 137 |
134 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 138 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
OLD | NEW |