Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view_unittest.cc

Issue 2899133004: Reduce overdraw on bookmark bar (Closed)
Patch Set: revert change in browserview Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/views/bookmarks/bookmark_bar_view.h" 10 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // infobar container and then top container. 133 // infobar container and then top container.
134 EXPECT_EQ(browser_view()->child_count() - 1, 134 EXPECT_EQ(browser_view()->child_count() - 1,
135 browser_view()->GetIndexOf(browser_view()->find_bar_host_view())); 135 browser_view()->GetIndexOf(browser_view()->find_bar_host_view()));
136 EXPECT_EQ(browser_view()->child_count() - 2, 136 EXPECT_EQ(browser_view()->child_count() - 2,
137 browser_view()->GetIndexOf(browser_view()->infobar_container())); 137 browser_view()->GetIndexOf(browser_view()->infobar_container()));
138 EXPECT_EQ(browser_view()->child_count() - 3, 138 EXPECT_EQ(browser_view()->child_count() - 3,
139 browser_view()->GetIndexOf(top_container)); 139 browser_view()->GetIndexOf(top_container));
140 140
141 // Bookmark bar layout on NTP. 141 // Bookmark bar layout on NTP.
142 EXPECT_EQ(0, bookmark_bar->x()); 142 EXPECT_EQ(0, bookmark_bar->x());
143 EXPECT_EQ(tabstrip->bounds().bottom() + toolbar->height() - 143 EXPECT_EQ(tabstrip->bounds().bottom() + toolbar->height(), bookmark_bar->y());
144 views::NonClientFrameView::kClientEdgeThickness,
145 bookmark_bar->y());
146 EXPECT_EQ(toolbar->bounds().bottom(), contents_container->y()); 144 EXPECT_EQ(toolbar->bounds().bottom(), contents_container->y());
147 // Contents view has a "top margin" pushing it below the bookmark bar. 145 EXPECT_EQ(bookmark_bar->height(), devtools_web_view->y());
148 EXPECT_EQ(bookmark_bar->height() - 146 EXPECT_EQ(bookmark_bar->height(), contents_web_view->y());
149 views::NonClientFrameView::kClientEdgeThickness,
150 devtools_web_view->y());
151 EXPECT_EQ(bookmark_bar->height() -
152 views::NonClientFrameView::kClientEdgeThickness,
153 contents_web_view->y());
154 147
155 // Bookmark bar is parented back to top container on normal page. 148 // Bookmark bar is parented back to top container on normal page.
156 NavigateAndCommitActiveTabWithTitle(browser, 149 NavigateAndCommitActiveTabWithTitle(browser,
157 GURL("about:blank"), 150 GURL("about:blank"),
158 base::string16()); 151 base::string16());
159 EXPECT_FALSE(bookmark_bar->visible()); 152 EXPECT_FALSE(bookmark_bar->visible());
160 EXPECT_FALSE(bookmark_bar->IsDetached()); 153 EXPECT_FALSE(bookmark_bar->IsDetached());
161 EXPECT_EQ(top_container, bookmark_bar->parent()); 154 EXPECT_EQ(top_container, bookmark_bar->parent());
162 // Top container is still third from front. 155 // Top container is still third from front.
163 EXPECT_EQ(browser_view()->child_count() - 3, 156 EXPECT_EQ(browser_view()->child_count() - 3,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 header_offset.y(); 213 header_offset.y();
221 214
222 // The web contents should be flush with the bottom of the header. 215 // The web contents should be flush with the bottom of the header.
223 EXPECT_EQ(bottom_of_header, contents_container->y()); 216 EXPECT_EQ(bottom_of_header, contents_container->y());
224 217
225 // The find bar should overlap the 1px header/web-contents separator at the 218 // The find bar should overlap the 1px header/web-contents separator at the
226 // bottom of the header. 219 // bottom of the header.
227 EXPECT_LT(browser_view()->GetFindBarBoundingBox().y(), 220 EXPECT_LT(browser_view()->GetFindBarBoundingBox().y(),
228 browser_view()->frame()->GetTopInset(false)); 221 browser_view()->frame()->GetTopInset(false));
229 } 222 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698