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 CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/views/layout/layout_manager.h" | 14 #include "ui/views/layout/layout_manager.h" |
14 | 15 |
15 class BookmarkBarView; | 16 class BookmarkBarView; |
16 class Browser; | 17 class Browser; |
17 class BrowserViewLayoutDelegate; | 18 class BrowserViewLayoutDelegate; |
18 class ContentsLayoutManager; | 19 class ContentsLayoutManager; |
19 class ImmersiveModeController; | 20 class ImmersiveModeController; |
20 class InfoBarContainerView; | 21 class InfoBarContainerView; |
21 class TabContentsContainer; | 22 class TabContentsContainer; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 int GetTopMarginForActiveContent(); | 119 int GetTopMarginForActiveContent(); |
119 | 120 |
120 // Layout the Download Shelf, returns the coordinate of the top of the | 121 // Layout the Download Shelf, returns the coordinate of the top of the |
121 // control, for laying out the previous control. | 122 // control, for laying out the previous control. |
122 int LayoutDownloadShelf(int bottom); | 123 int LayoutDownloadShelf(int bottom); |
123 | 124 |
124 // Returns true if an infobar is showing. | 125 // Returns true if an infobar is showing. |
125 bool InfobarVisible() const; | 126 bool InfobarVisible() const; |
126 | 127 |
127 // The delegate interface. May be a mock in tests. | 128 // The delegate interface. May be a mock in tests. |
128 scoped_ptr<BrowserViewLayoutDelegate> delegate_; | 129 std::unique_ptr<BrowserViewLayoutDelegate> delegate_; |
129 | 130 |
130 // The browser from the owning BrowserView. | 131 // The browser from the owning BrowserView. |
131 Browser* browser_; | 132 Browser* browser_; |
132 | 133 |
133 // The owning browser view. | 134 // The owning browser view. |
134 views::ClientView* browser_view_; | 135 views::ClientView* browser_view_; |
135 | 136 |
136 // Child views that the layout manager manages. | 137 // Child views that the layout manager manages. |
137 // NOTE: If you add a view, try to add it as a views::View, which makes | 138 // NOTE: If you add a view, try to add it as a views::View, which makes |
138 // testing much easier. | 139 // testing much easier. |
139 views::View* top_container_; | 140 views::View* top_container_; |
140 TabStrip* tab_strip_; | 141 TabStrip* tab_strip_; |
141 views::View* toolbar_; | 142 views::View* toolbar_; |
142 BookmarkBarView* bookmark_bar_; | 143 BookmarkBarView* bookmark_bar_; |
143 InfoBarContainerView* infobar_container_; | 144 InfoBarContainerView* infobar_container_; |
144 views::View* contents_container_; | 145 views::View* contents_container_; |
145 ContentsLayoutManager* contents_layout_manager_; | 146 ContentsLayoutManager* contents_layout_manager_; |
146 views::View* download_shelf_; | 147 views::View* download_shelf_; |
147 | 148 |
148 ImmersiveModeController* immersive_mode_controller_; | 149 ImmersiveModeController* immersive_mode_controller_; |
149 | 150 |
150 // The bounds within which the vertically-stacked contents of the BrowserView | 151 // The bounds within which the vertically-stacked contents of the BrowserView |
151 // should be laid out within. This is just the local bounds of the | 152 // should be laid out within. This is just the local bounds of the |
152 // BrowserView. | 153 // BrowserView. |
153 // TODO(jamescook): Remove this and just use browser_view_->GetLocalBounds(). | 154 // TODO(jamescook): Remove this and just use browser_view_->GetLocalBounds(). |
154 gfx::Rect vertical_layout_rect_; | 155 gfx::Rect vertical_layout_rect_; |
155 | 156 |
156 // The host for use in positioning the web contents modal dialog. | 157 // The host for use in positioning the web contents modal dialog. |
157 scoped_ptr<WebContentsModalDialogHostViews> dialog_host_; | 158 std::unique_ptr<WebContentsModalDialogHostViews> dialog_host_; |
158 | 159 |
159 // The latest dialog bounds applied during a layout pass. | 160 // The latest dialog bounds applied during a layout pass. |
160 gfx::Rect latest_dialog_bounds_; | 161 gfx::Rect latest_dialog_bounds_; |
161 | 162 |
162 // The distance the web contents modal dialog is from the top of the window, | 163 // The distance the web contents modal dialog is from the top of the window, |
163 // in pixels. | 164 // in pixels. |
164 int web_contents_modal_dialog_top_y_; | 165 int web_contents_modal_dialog_top_y_; |
165 | 166 |
166 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); | 167 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); |
167 }; | 168 }; |
168 | 169 |
169 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ | 170 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ |
OLD | NEW |