| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 13 #include "ui/views/layout/layout_manager.h" | 13 #include "ui/views/layout/layout_manager.h" |
| 14 | 14 |
| 15 class BookmarkBarView; | 15 class BookmarkBarView; |
| 16 class Browser; | 16 class Browser; |
| 17 class BrowserView; | 17 class BrowserView; |
| 18 class ContentsContainer; | 18 class ContentsContainer; |
| 19 class DownloadShelfView; | 19 class DownloadShelfView; |
| 20 class InfoBarContainerView; | 20 class InfoBarContainerView; |
| 21 class TabContentsContainer; | 21 class TabContentsContainer; |
| 22 class TabStrip; | 22 class TabStrip; |
| 23 class ToolbarView; | 23 class ToolbarView; |
| 24 class WebContentsModalDialogHost; | |
| 25 | 24 |
| 26 namespace gfx { | 25 namespace gfx { |
| 27 class Point; | 26 class Point; |
| 28 class Size; | 27 class Size; |
| 29 } | 28 } |
| 30 | 29 |
| 31 namespace views { | 30 namespace views { |
| 32 class SingleSplitView; | 31 class SingleSplitView; |
| 33 } | 32 } |
| 34 | 33 |
| 34 namespace web_modal { |
| 35 class WebContentsModalDialogHost; |
| 36 } |
| 37 |
| 35 // The layout manager used in chrome browser. | 38 // The layout manager used in chrome browser. |
| 36 class BrowserViewLayout : public views::LayoutManager { | 39 class BrowserViewLayout : public views::LayoutManager { |
| 37 public: | 40 public: |
| 38 // The vertical overlap between the TabStrip and the Toolbar. | 41 // The vertical overlap between the TabStrip and the Toolbar. |
| 39 static const int kToolbarTabStripVerticalOverlap; | 42 static const int kToolbarTabStripVerticalOverlap; |
| 40 | 43 |
| 41 BrowserViewLayout(); | 44 BrowserViewLayout(); |
| 42 virtual ~BrowserViewLayout(); | 45 virtual ~BrowserViewLayout(); |
| 43 | 46 |
| 44 // Sets all the views to be managed. Tests may inject stubs or NULL. | 47 // Sets all the views to be managed. Tests may inject stubs or NULL. |
| 45 void Init(Browser* browser, | 48 void Init(Browser* browser, |
| 46 BrowserView* browser_view, | 49 BrowserView* browser_view, |
| 47 InfoBarContainerView* infobar_container, | 50 InfoBarContainerView* infobar_container, |
| 48 views::SingleSplitView* contents_split, | 51 views::SingleSplitView* contents_split, |
| 49 ContentsContainer* contents_container); | 52 ContentsContainer* contents_container); |
| 50 | 53 |
| 51 // Sets or updates views that are not available when |this| is initialized. | 54 // Sets or updates views that are not available when |this| is initialized. |
| 52 void set_bookmark_bar(BookmarkBarView* bookmark_bar) { | 55 void set_bookmark_bar(BookmarkBarView* bookmark_bar) { |
| 53 bookmark_bar_ = bookmark_bar; | 56 bookmark_bar_ = bookmark_bar; |
| 54 } | 57 } |
| 55 void set_download_shelf(DownloadShelfView* download_shelf) { | 58 void set_download_shelf(DownloadShelfView* download_shelf) { |
| 56 download_shelf_ = download_shelf; | 59 download_shelf_ = download_shelf; |
| 57 } | 60 } |
| 58 | 61 |
| 59 WebContentsModalDialogHost* GetWebContentsModalDialogHost(); | 62 web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost(); |
| 60 | 63 |
| 61 // Returns the minimum size of the browser view. | 64 // Returns the minimum size of the browser view. |
| 62 gfx::Size GetMinimumSize(); | 65 gfx::Size GetMinimumSize(); |
| 63 | 66 |
| 64 // Returns the bounding box, in widget coordinates, for the find bar. | 67 // Returns the bounding box, in widget coordinates, for the find bar. |
| 65 gfx::Rect GetFindBarBoundingBox() const; | 68 gfx::Rect GetFindBarBoundingBox() const; |
| 66 | 69 |
| 67 // Returns true if the specified point(BrowserView coordinates) is in | 70 // Returns true if the specified point(BrowserView coordinates) is in |
| 68 // in the window caption area of the browser window. | 71 // in the window caption area of the browser window. |
| 69 bool IsPositionInWindowCaption(const gfx::Point& point); | 72 bool IsPositionInWindowCaption(const gfx::Point& point); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 scoped_ptr<WebContentsModalDialogHostViews> dialog_host_; | 166 scoped_ptr<WebContentsModalDialogHostViews> dialog_host_; |
| 164 | 167 |
| 165 // The distance the web contents modal dialog is from the top of the window, | 168 // The distance the web contents modal dialog is from the top of the window, |
| 166 // in pixels. | 169 // in pixels. |
| 167 int web_contents_modal_dialog_top_y_; | 170 int web_contents_modal_dialog_top_y_; |
| 168 | 171 |
| 169 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); | 172 DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); |
| 170 }; | 173 }; |
| 171 | 174 |
| 172 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ | 175 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_LAYOUT_H_ |
| OLD | NEW |