| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/layout_constants.h" | 10 #include "chrome/browser/ui/layout_constants.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 // Verify basic layout. | 90 // Verify basic layout. |
| 91 EXPECT_EQ(0, top_container->x()); | 91 EXPECT_EQ(0, top_container->x()); |
| 92 EXPECT_EQ(0, top_container->y()); | 92 EXPECT_EQ(0, top_container->y()); |
| 93 EXPECT_EQ(browser_view()->width(), top_container->width()); | 93 EXPECT_EQ(browser_view()->width(), top_container->width()); |
| 94 // Tabstrip layout varies based on window frame sizes. | 94 // Tabstrip layout varies based on window frame sizes. |
| 95 gfx::Point expected_tabstrip_origin = ExpectedTabStripOrigin(browser_view()); | 95 gfx::Point expected_tabstrip_origin = ExpectedTabStripOrigin(browser_view()); |
| 96 EXPECT_EQ(expected_tabstrip_origin.x(), tabstrip->x()); | 96 EXPECT_EQ(expected_tabstrip_origin.x(), tabstrip->x()); |
| 97 EXPECT_EQ(expected_tabstrip_origin.y(), tabstrip->y()); | 97 EXPECT_EQ(expected_tabstrip_origin.y(), tabstrip->y()); |
| 98 EXPECT_EQ(0, toolbar->x()); | 98 EXPECT_EQ(0, toolbar->x()); |
| 99 const int overlap = GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP); | 99 EXPECT_EQ(tabstrip->bounds().bottom(), toolbar->y()); |
| 100 EXPECT_EQ(tabstrip->bounds().bottom() - overlap, toolbar->y()); | |
| 101 EXPECT_EQ(0, contents_container->x()); | 100 EXPECT_EQ(0, contents_container->x()); |
| 102 EXPECT_EQ(toolbar->bounds().bottom(), contents_container->y()); | 101 EXPECT_EQ(toolbar->bounds().bottom(), contents_container->y()); |
| 103 EXPECT_EQ(top_container->bounds().bottom(), contents_container->y()); | 102 EXPECT_EQ(top_container->bounds().bottom(), contents_container->y()); |
| 104 EXPECT_EQ(0, devtools_web_view->x()); | 103 EXPECT_EQ(0, devtools_web_view->x()); |
| 105 EXPECT_EQ(0, devtools_web_view->y()); | 104 EXPECT_EQ(0, devtools_web_view->y()); |
| 106 EXPECT_EQ(0, contents_web_view->x()); | 105 EXPECT_EQ(0, contents_web_view->x()); |
| 107 EXPECT_EQ(0, contents_web_view->y()); | 106 EXPECT_EQ(0, contents_web_view->y()); |
| 108 | 107 |
| 109 // Verify bookmark bar visibility. | 108 // Verify bookmark bar visibility. |
| 110 BookmarkBarView* bookmark_bar = browser_view()->GetBookmarkBarView(); | 109 BookmarkBarView* bookmark_bar = browser_view()->GetBookmarkBarView(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 130 EXPECT_EQ(browser_view()->child_count() - 1, | 129 EXPECT_EQ(browser_view()->child_count() - 1, |
| 131 browser_view()->GetIndexOf(browser_view()->find_bar_host_view())); | 130 browser_view()->GetIndexOf(browser_view()->find_bar_host_view())); |
| 132 EXPECT_EQ(browser_view()->child_count() - 2, | 131 EXPECT_EQ(browser_view()->child_count() - 2, |
| 133 browser_view()->GetIndexOf(browser_view()->infobar_container())); | 132 browser_view()->GetIndexOf(browser_view()->infobar_container())); |
| 134 EXPECT_EQ(browser_view()->child_count() - 3, | 133 EXPECT_EQ(browser_view()->child_count() - 3, |
| 135 browser_view()->GetIndexOf(top_container)); | 134 browser_view()->GetIndexOf(top_container)); |
| 136 | 135 |
| 137 // Bookmark bar layout on NTP. | 136 // Bookmark bar layout on NTP. |
| 138 EXPECT_EQ(0, bookmark_bar->x()); | 137 EXPECT_EQ(0, bookmark_bar->x()); |
| 139 EXPECT_EQ( | 138 EXPECT_EQ( |
| 140 tabstrip->bounds().bottom() + toolbar->height() - overlap - | 139 tabstrip->bounds().bottom() + toolbar->height() - |
| 141 views::NonClientFrameView::kClientEdgeThickness, | 140 views::NonClientFrameView::kClientEdgeThickness, |
| 142 bookmark_bar->y()); | 141 bookmark_bar->y()); |
| 143 EXPECT_EQ(toolbar->bounds().bottom(), contents_container->y()); | 142 EXPECT_EQ(toolbar->bounds().bottom(), contents_container->y()); |
| 144 // Contents view has a "top margin" pushing it below the bookmark bar. | 143 // Contents view has a "top margin" pushing it below the bookmark bar. |
| 145 EXPECT_EQ(bookmark_bar->height() - | 144 EXPECT_EQ(bookmark_bar->height() - |
| 146 views::NonClientFrameView::kClientEdgeThickness, | 145 views::NonClientFrameView::kClientEdgeThickness, |
| 147 devtools_web_view->y()); | 146 devtools_web_view->y()); |
| 148 EXPECT_EQ(bookmark_bar->height() - | 147 EXPECT_EQ(bookmark_bar->height() - |
| 149 views::NonClientFrameView::kClientEdgeThickness, | 148 views::NonClientFrameView::kClientEdgeThickness, |
| 150 contents_web_view->y()); | 149 contents_web_view->y()); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 header_offset.y(); | 217 header_offset.y(); |
| 219 | 218 |
| 220 // The web contents should be flush with the bottom of the header. | 219 // The web contents should be flush with the bottom of the header. |
| 221 EXPECT_EQ(bottom_of_header, contents_container->y()); | 220 EXPECT_EQ(bottom_of_header, contents_container->y()); |
| 222 | 221 |
| 223 // The find bar should overlap the 1px header/web-contents separator at the | 222 // The find bar should overlap the 1px header/web-contents separator at the |
| 224 // bottom of the header. | 223 // bottom of the header. |
| 225 EXPECT_LT(browser_view()->GetFindBarBoundingBox().y(), | 224 EXPECT_LT(browser_view()->GetFindBarBoundingBox().y(), |
| 226 browser_view()->frame()->GetTopInset(false)); | 225 browser_view()->frame()->GetTopInset(false)); |
| 227 } | 226 } |
| OLD | NEW |