OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "views/layout_manager.h" | 9 #include "views/layout_manager.h" |
10 | 10 |
11 class BaseTabStrip; | 11 class BaseTabStrip; |
12 class BookmarkBarView; | 12 class BookmarkBarView; |
13 class Browser; | 13 class Browser; |
14 class BrowserView; | 14 class BrowserView; |
15 class ContentsContainer; | 15 class ContentsContainer; |
16 class DownloadShelfView; | 16 class DownloadShelfView; |
| 17 class TabContentsContainer; |
17 class ToolbarView; | 18 class ToolbarView; |
18 | 19 |
| 20 namespace views { |
| 21 class SingleSplitView; |
| 22 } |
| 23 |
19 // The layout manager used in chrome browser. | 24 // The layout manager used in chrome browser. |
20 class BrowserViewLayout : public views::LayoutManager { | 25 class BrowserViewLayout : public views::LayoutManager { |
21 public: | 26 public: |
22 BrowserViewLayout(); | 27 BrowserViewLayout(); |
23 virtual ~BrowserViewLayout() {} | 28 virtual ~BrowserViewLayout() {} |
24 | 29 |
25 // Returns the minimum size of the browser view. | 30 // Returns the minimum size of the browser view. |
26 virtual gfx::Size GetMinimumSize(); | 31 virtual gfx::Size GetMinimumSize(); |
27 | 32 |
28 // Returns the bounding box for the find bar. | 33 // Returns the bounding box for the find bar. |
(...skipping 25 matching lines...) Expand all Loading... |
54 // for laying out subsequent controls. | 59 // for laying out subsequent controls. |
55 virtual int LayoutTabStrip(); | 60 virtual int LayoutTabStrip(); |
56 | 61 |
57 // Layout the following controls, starting at |top|, returns the coordinate | 62 // Layout the following controls, starting at |top|, returns the coordinate |
58 // of the bottom of the control, for laying out the next control. | 63 // of the bottom of the control, for laying out the next control. |
59 virtual int LayoutToolbar(int top); | 64 virtual int LayoutToolbar(int top); |
60 int LayoutBookmarkAndInfoBars(int top); | 65 int LayoutBookmarkAndInfoBars(int top); |
61 int LayoutBookmarkBar(int top); | 66 int LayoutBookmarkBar(int top); |
62 int LayoutInfoBar(int top); | 67 int LayoutInfoBar(int top); |
63 | 68 |
| 69 // Updates |source|'s reserved contents rect by mapping BrowserView's |
| 70 // |browser_reserved_rect| into |future_source_bounds|. |
| 71 void UpdateReservedContentsRect(const gfx::Rect& browser_reserved_rect, |
| 72 TabContentsContainer* source, |
| 73 const gfx::Rect& would_be_rect); |
| 74 |
64 // Layout the TabContents container, between the coordinates |top| and | 75 // Layout the TabContents container, between the coordinates |top| and |
65 // |bottom|. | 76 // |bottom|. |
66 void LayoutTabContents(int top, int bottom); | 77 void LayoutTabContents(int top, int bottom); |
67 | 78 |
68 // Returns the top margin to adjust the contents_container_ by. This is used | 79 // Returns the top margin to adjust the contents_container_ by. This is used |
69 // to make the bookmark bar and contents_container_ overlap so that the | 80 // to make the bookmark bar and contents_container_ overlap so that the |
70 // preview contents hides the bookmark bar. | 81 // preview contents hides the bookmark bar. |
71 int GetTopMarginForActiveContent(); | 82 int GetTopMarginForActiveContent(); |
72 | 83 |
73 // Layout the Download Shelf, returns the coordinate of the top of the | 84 // Layout the Download Shelf, returns the coordinate of the top of the |
74 // control, for laying out the previous control. | 85 // control, for laying out the previous control. |
75 int LayoutDownloadShelf(int bottom); | 86 int LayoutDownloadShelf(int bottom); |
76 | 87 |
77 // Returns true if an infobar is showing. | 88 // Returns true if an infobar is showing. |
78 bool InfobarVisible() const; | 89 bool InfobarVisible() const; |
79 | 90 |
80 // See description above vertical_layout_rect_ for details. | 91 // See description above vertical_layout_rect_ for details. |
81 void set_vertical_layout_rect(const gfx::Rect& bounds) { | 92 void set_vertical_layout_rect(const gfx::Rect& bounds) { |
82 vertical_layout_rect_ = bounds; | 93 vertical_layout_rect_ = bounds; |
83 } | 94 } |
84 const gfx::Rect& vertical_layout_rect() const { | 95 const gfx::Rect& vertical_layout_rect() const { |
85 return vertical_layout_rect_; | 96 return vertical_layout_rect_; |
86 } | 97 } |
87 | 98 |
88 // Child views that the layout manager manages. | 99 // Child views that the layout manager manages. |
89 BaseTabStrip* tabstrip_; | 100 BaseTabStrip* tabstrip_; |
90 ToolbarView* toolbar_; | 101 ToolbarView* toolbar_; |
91 views::View* contents_split_; | 102 views::SingleSplitView* contents_split_; |
92 ContentsContainer* contents_container_; | 103 ContentsContainer* contents_container_; |
93 views::View* infobar_container_; | 104 views::View* infobar_container_; |
94 DownloadShelfView* download_shelf_; | 105 DownloadShelfView* download_shelf_; |
95 BookmarkBarView* active_bookmark_bar_; | 106 BookmarkBarView* active_bookmark_bar_; |
96 | 107 |
97 BrowserView* browser_view_; | 108 BrowserView* browser_view_; |
98 | 109 |
99 // The bounds within which the vertically-stacked contents of the BrowserView | 110 // The bounds within which the vertically-stacked contents of the BrowserView |
100 // should be laid out within. When the SideTabstrip is not visible, this is | 111 // should be laid out within. When the SideTabstrip is not visible, this is |
101 // just the local bounds of the BrowserView, otherwise it's the local bounds | 112 // just the local bounds of the BrowserView, otherwise it's the local bounds |
102 // of the BrowserView less the width of the SideTabstrip. | 113 // of the BrowserView less the width of the SideTabstrip. |
103 gfx::Rect vertical_layout_rect_; | 114 gfx::Rect vertical_layout_rect_; |
104 | 115 |
105 // The distance the FindBar is from the top of the window, in pixels. | 116 // The distance the FindBar is from the top of the window, in pixels. |
106 int find_bar_y_; | 117 int find_bar_y_; |
107 | 118 |
108 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); | 119 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); |
109 }; | 120 }; |
110 | 121 |
111 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ | 122 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ |
112 | 123 |
OLD | NEW |