Chromium Code Reviews| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 void Prerender(); | 97 void Prerender(); |
| 98 | 98 |
| 99 AppsContainerView* apps_container_view() { return apps_container_view_; } | 99 AppsContainerView* apps_container_view() { return apps_container_view_; } |
| 100 StartPageView* start_page_view() { return start_page_view_; } | 100 StartPageView* start_page_view() { return start_page_view_; } |
| 101 SearchResultListView* search_results_view() { return search_results_view_; } | 101 SearchResultListView* search_results_view() { return search_results_view_; } |
| 102 views::View* GetPageView(int index); | 102 views::View* GetPageView(int index); |
| 103 | 103 |
| 104 // Adds a blank launcher page. For use in tests only. | 104 // Adds a blank launcher page. For use in tests only. |
| 105 void AddBlankPageForTesting(); | 105 void AddBlankPageForTesting(); |
| 106 | 106 |
| 107 // Returns the pagination model for the ContentsView. | |
| 108 const PaginationModel& pagination_model() { return pagination_model_; } | |
| 109 | |
| 110 // Returns the default bounds of the search box. | |
|
Matt Giuca
2014/10/24 03:21:40
I don't like the use of the word "default" in thes
calamity
2014/10/24 06:13:08
They're default because they will be customized by
| |
| 111 gfx::Rect GetDefaultSearchBoxBounds() const; | |
| 112 | |
| 113 // Returns the bounds of the default content area. | |
|
Matt Giuca
2014/10/24 03:21:40
This is the bounds of the main area under the sear
calamity
2014/10/24 06:13:08
Done.
| |
| 114 gfx::Rect GetDefaultContentsBounds() const; | |
| 115 | |
| 107 // Overridden from views::View: | 116 // Overridden from views::View: |
| 108 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 117 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 109 virtual void Layout() OVERRIDE; | 118 virtual void Layout() OVERRIDE; |
| 110 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 119 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
| 111 | 120 |
| 112 // Overridden from PaginationModelObserver: | 121 // Overridden from PaginationModelObserver: |
| 113 virtual void TotalPagesChanged() OVERRIDE; | 122 virtual void TotalPagesChanged() OVERRIDE; |
| 114 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; | 123 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; |
| 115 virtual void TransitionStarted() OVERRIDE; | 124 virtual void TransitionStarted() OVERRIDE; |
| 116 virtual void TransitionChanged() OVERRIDE; | 125 virtual void TransitionChanged() OVERRIDE; |
| 117 | 126 |
| 118 // Returns the pagination model for the ContentsView. | |
| 119 const PaginationModel& pagination_model() { return pagination_model_; } | |
| 120 | |
| 121 private: | 127 private: |
| 122 // Sets the active launcher page, accounting for whether the change is for | 128 // Sets the active launcher page, accounting for whether the change is for |
| 123 // search results. | 129 // search results. |
| 124 void SetActivePageInternal(int page_index, bool show_search_results); | 130 void SetActivePageInternal(int page_index, bool show_search_results); |
| 125 | 131 |
| 126 // Invoked when active view is changed. | 132 // Invoked when active view is changed. |
| 127 void ActivePageChanged(bool show_search_results); | 133 void ActivePageChanged(bool show_search_results); |
| 128 | 134 |
| 135 // Returns the size of the default content area. | |
| 136 gfx::Size GetDefaultContentsSize() const; | |
| 137 | |
| 129 // Gets the origin (the off-screen resting place) for a given launcher page | 138 // Gets the origin (the off-screen resting place) for a given launcher page |
| 130 // with index |page_index|. | 139 // with index |page_index|. |
| 131 gfx::Rect GetOffscreenPageBounds(int page_index) const; | 140 gfx::Rect GetOffscreenPageBounds(int page_index) const; |
| 132 | 141 |
| 133 // Calculates and sets the bounds for the subviews. If there is currently an | 142 // Calculates and sets the bounds for the subviews. If there is currently an |
| 134 // animation, this positions the views as appropriate for the current frame. | 143 // animation, this positions the views as appropriate for the current frame. |
| 135 void UpdatePageBounds(); | 144 void UpdatePageBounds(); |
| 136 | 145 |
| 137 // Adds |view| as a new page to the end of the list of launcher pages. The | 146 // Adds |view| as a new page to the end of the list of launcher pages. The |
| 138 // view is inserted as a child of the ContentsView, and a button with | 147 // view is inserted as a child of the ContentsView, and a button with |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 169 | 178 |
| 170 // Manages the pagination for the launcher pages. | 179 // Manages the pagination for the launcher pages. |
| 171 PaginationModel pagination_model_; | 180 PaginationModel pagination_model_; |
| 172 | 181 |
| 173 DISALLOW_COPY_AND_ASSIGN(ContentsView); | 182 DISALLOW_COPY_AND_ASSIGN(ContentsView); |
| 174 }; | 183 }; |
| 175 | 184 |
| 176 } // namespace app_list | 185 } // namespace app_list |
| 177 | 186 |
| 178 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ | 187 #endif // UI_APP_LIST_VIEWS_CONTENTS_VIEW_H_ |
| OLD | NEW |