| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // Sets all the views to be managed. Takes ownership of |delegate|. | 47 // Sets all the views to be managed. Takes ownership of |delegate|. |
| 48 // |browser_view| may be NULL in tests. | 48 // |browser_view| may be NULL in tests. |
| 49 void Init(BrowserViewLayoutDelegate* delegate, | 49 void Init(BrowserViewLayoutDelegate* delegate, |
| 50 Browser* browser, | 50 Browser* browser, |
| 51 views::ClientView* browser_view, | 51 views::ClientView* browser_view, |
| 52 views::View* top_container, | 52 views::View* top_container, |
| 53 TabStrip* tab_strip, | 53 TabStrip* tab_strip, |
| 54 views::View* toolbar, | 54 views::View* toolbar, |
| 55 InfoBarContainerView* infobar_container, | 55 InfoBarContainerView* infobar_container, |
| 56 views::View* contents_split, | |
| 57 ContentsContainer* contents_container, | 56 ContentsContainer* contents_container, |
| 58 ImmersiveModeController* immersive_mode_controller); | 57 ImmersiveModeController* immersive_mode_controller); |
| 59 | 58 |
| 60 // Sets or updates views that are not available when |this| is initialized. | 59 // Sets or updates views that are not available when |this| is initialized. |
| 61 void set_tab_strip(TabStrip* tab_strip) { | 60 void set_tab_strip(TabStrip* tab_strip) { |
| 62 tab_strip_ = tab_strip; | 61 tab_strip_ = tab_strip; |
| 63 } | 62 } |
| 64 void set_bookmark_bar(BookmarkBarView* bookmark_bar) { | 63 void set_bookmark_bar(BookmarkBarView* bookmark_bar) { |
| 65 bookmark_bar_ = bookmark_bar; | 64 bookmark_bar_ = bookmark_bar; |
| 66 } | 65 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 95 Browser* browser() { return browser_; } | 94 Browser* browser() { return browser_; } |
| 96 | 95 |
| 97 // Layout the following controls, starting at |top|, returns the coordinate | 96 // Layout the following controls, starting at |top|, returns the coordinate |
| 98 // of the bottom of the control, for laying out the next control. | 97 // of the bottom of the control, for laying out the next control. |
| 99 int LayoutTabStripRegion(int top); | 98 int LayoutTabStripRegion(int top); |
| 100 int LayoutToolbar(int top); | 99 int LayoutToolbar(int top); |
| 101 int LayoutBookmarkAndInfoBars(int top, int browser_view_y); | 100 int LayoutBookmarkAndInfoBars(int top, int browser_view_y); |
| 102 int LayoutBookmarkBar(int top); | 101 int LayoutBookmarkBar(int top); |
| 103 int LayoutInfoBar(int top); | 102 int LayoutInfoBar(int top); |
| 104 | 103 |
| 105 // Layout the |contents_split_| view between the coordinates |top| and | 104 // Layout the |contents_container_| view between the coordinates |top| and |
| 106 // |bottom|. See browser_view.h for details of the relationship between | 105 // |bottom|. See browser_view.h for details of the relationship between |
| 107 // |contents_split_| and other views. | 106 // |contents_container_| and other views. |
| 108 void LayoutContentsSplitView(int top, int bottom); | 107 void LayoutContentsContainerView(int top, int bottom); |
| 109 | 108 |
| 110 // Updates |top_container_|'s bounds. The new bounds depend on the size of | 109 // Updates |top_container_|'s bounds. The new bounds depend on the size of |
| 111 // the bookmark bar and the toolbar. | 110 // the bookmark bar and the toolbar. |
| 112 void UpdateTopContainerBounds(); | 111 void UpdateTopContainerBounds(); |
| 113 | 112 |
| 114 // Returns the vertical offset for the web contents to account for a | 113 // Returns the vertical offset for the web contents to account for a |
| 115 // detached bookmarks bar. | 114 // detached bookmarks bar. |
| 116 int GetContentsOffsetForBookmarkBar(); | 115 int GetContentsOffsetForBookmarkBar(); |
| 117 | 116 |
| 118 // Returns the top margin to adjust the contents_container_ by. This is used | 117 // Returns the top margin to adjust the contents_container_ by. This is used |
| (...skipping 18 matching lines...) Expand all Loading... |
| 137 views::ClientView* browser_view_; | 136 views::ClientView* browser_view_; |
| 138 | 137 |
| 139 // Child views that the layout manager manages. | 138 // Child views that the layout manager manages. |
| 140 // NOTE: If you add a view, try to add it as a views::View, which makes | 139 // NOTE: If you add a view, try to add it as a views::View, which makes |
| 141 // testing much easier. | 140 // testing much easier. |
| 142 views::View* top_container_; | 141 views::View* top_container_; |
| 143 TabStrip* tab_strip_; | 142 TabStrip* tab_strip_; |
| 144 views::View* toolbar_; | 143 views::View* toolbar_; |
| 145 BookmarkBarView* bookmark_bar_; | 144 BookmarkBarView* bookmark_bar_; |
| 146 InfoBarContainerView* infobar_container_; | 145 InfoBarContainerView* infobar_container_; |
| 147 views::View* contents_split_; | |
| 148 ContentsContainer* contents_container_; | 146 ContentsContainer* contents_container_; |
| 149 views::View* download_shelf_; | 147 views::View* download_shelf_; |
| 150 | 148 |
| 151 ImmersiveModeController* immersive_mode_controller_; | 149 ImmersiveModeController* immersive_mode_controller_; |
| 152 | 150 |
| 153 // The bounds within which the vertically-stacked contents of the BrowserView | 151 // The bounds within which the vertically-stacked contents of the BrowserView |
| 154 // 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 |
| 155 // BrowserView. | 153 // BrowserView. |
| 156 // TODO(jamescook): Remove this and just use browser_view_->GetLocalBounds(). | 154 // TODO(jamescook): Remove this and just use browser_view_->GetLocalBounds(). |
| 157 gfx::Rect vertical_layout_rect_; | 155 gfx::Rect vertical_layout_rect_; |
| 158 | 156 |
| 159 // The host for use in positioning the web contents modal dialog. | 157 // The host for use in positioning the web contents modal dialog. |
| 160 scoped_ptr<WebContentsModalDialogHostViews> dialog_host_; | 158 scoped_ptr<WebContentsModalDialogHostViews> dialog_host_; |
| 161 | 159 |
| 162 // The distance the web contents modal dialog is from the top of the window, | 160 // The distance the web contents modal dialog is from the top of the window, |
| 163 // in pixels. | 161 // in pixels. |
| 164 int web_contents_modal_dialog_top_y_; | 162 int web_contents_modal_dialog_top_y_; |
| 165 | 163 |
| 166 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); | 164 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); |
| 167 }; | 165 }; |
| 168 | 166 |
| 169 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ | 167 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ |
| OLD | NEW |