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 24 matching lines...) Expand all Loading... |
35 class WebContentsModalDialogHost; | 35 class WebContentsModalDialogHost; |
36 } | 36 } |
37 | 37 |
38 // The layout manager used in chrome browser. | 38 // The layout manager used in chrome browser. |
39 class BrowserViewLayout : public views::LayoutManager { | 39 class BrowserViewLayout : public views::LayoutManager { |
40 public: | 40 public: |
41 // The vertical overlap between the TabStrip and the Toolbar. | 41 // The vertical overlap between the TabStrip and the Toolbar. |
42 static const int kToolbarTabStripVerticalOverlap; | 42 static const int kToolbarTabStripVerticalOverlap; |
43 | 43 |
44 BrowserViewLayout(); | 44 BrowserViewLayout(); |
45 virtual ~BrowserViewLayout(); | 45 ~BrowserViewLayout() override; |
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, |
(...skipping 20 matching lines...) Expand all Loading... |
76 // Returns the bounding box, in widget coordinates, for the find bar. | 76 // Returns the bounding box, in widget coordinates, for the find bar. |
77 gfx::Rect GetFindBarBoundingBox() const; | 77 gfx::Rect GetFindBarBoundingBox() const; |
78 | 78 |
79 // Tests to see if the specified |point| (in nonclient view's coordinates) | 79 // Tests to see if the specified |point| (in nonclient view's coordinates) |
80 // is within the views managed by the laymanager. Returns one of | 80 // is within the views managed by the laymanager. Returns one of |
81 // HitTestCompat enum defined in ui/base/hit_test.h. | 81 // HitTestCompat enum defined in ui/base/hit_test.h. |
82 // See also ClientView::NonClientHitTest. | 82 // See also ClientView::NonClientHitTest. |
83 int NonClientHitTest(const gfx::Point& point); | 83 int NonClientHitTest(const gfx::Point& point); |
84 | 84 |
85 // views::LayoutManager overrides: | 85 // views::LayoutManager overrides: |
86 virtual void Layout(views::View* host) override; | 86 void Layout(views::View* host) override; |
87 virtual gfx::Size GetPreferredSize(const views::View* host) const override; | 87 gfx::Size GetPreferredSize(const views::View* host) const override; |
88 | 88 |
89 private: | 89 private: |
90 FRIEND_TEST_ALL_PREFIXES(BrowserViewLayoutTest, BrowserViewLayout); | 90 FRIEND_TEST_ALL_PREFIXES(BrowserViewLayoutTest, BrowserViewLayout); |
91 FRIEND_TEST_ALL_PREFIXES(BrowserViewLayoutTest, Layout); | 91 FRIEND_TEST_ALL_PREFIXES(BrowserViewLayoutTest, Layout); |
92 FRIEND_TEST_ALL_PREFIXES(BrowserViewLayoutTest, LayoutDownloadShelf); | 92 FRIEND_TEST_ALL_PREFIXES(BrowserViewLayoutTest, LayoutDownloadShelf); |
93 class WebContentsModalDialogHostViews; | 93 class WebContentsModalDialogHostViews; |
94 | 94 |
95 Browser* browser() { return browser_; } | 95 Browser* browser() { return browser_; } |
96 | 96 |
97 // Layout the following controls, starting at |top|, returns the coordinate | 97 // Layout the following controls, starting at |top|, returns the coordinate |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 gfx::Rect latest_dialog_bounds_; | 163 gfx::Rect latest_dialog_bounds_; |
164 | 164 |
165 // The distance the web contents modal dialog is from the top of the window, | 165 // The distance the web contents modal dialog is from the top of the window, |
166 // in pixels. | 166 // in pixels. |
167 int web_contents_modal_dialog_top_y_; | 167 int web_contents_modal_dialog_top_y_; |
168 | 168 |
169 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); | 169 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); |
170 }; | 170 }; |
171 | 171 |
172 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ | 172 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ |
OLD | NEW |