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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 1849563002: Re-order the BookmarkBarView to be behind the ToolbarView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments to BrowserView::SetBookmarkBarParent(). Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index f0e4383ae15bd76c454c0d9a496ffc9c697c0f0d..0bb9feb4d09107d06916a63aca843feb646da3bc 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2214,16 +2214,33 @@ bool BrowserView::MaybeShowBookmarkBar(WebContents* contents) {
}
void BrowserView::SetBookmarkBarParent(views::View* new_parent) {
+ // NOTE: The ink drops hosted by the |toolbar_| exceed the bounds of the
+ // |toolbar_| so in order to have them visible above the |bookmark_bar_view_|
+ // we need to explicitly add the |bookmark_bar_view_| as a child view at a
+ // specific index because that is what determines z-order.
Peter Kasting 2016/03/31 22:22:57 Nit: How about this. TODO is optional, I don't kn
bruthig 2016/04/01 16:15:12 Modified slightly but done.
+
if (new_parent == this) {
- // Add it underneath |top_container_| or at the end if top container isn't
- // found.
+ // BookmarkBarView is detached.
int top_container_index = GetIndexOf(top_container_);
- if (top_container_index >= 0)
+ if (top_container_index >= 0) {
+ // |this| parents the |top_container_| and the |top_container_| parents
+ // the |toolbar_| so we have to stack the |bookmark_bar_view_| behind the
+ // |top_container_|.
Peter Kasting 2016/03/31 22:22:56 Nit: How about: |top_container_| contains the too
bruthig 2016/04/01 16:15:12 Done.
AddChildViewAt(bookmark_bar_view_.get(), top_container_index);
- else
+ } else {
+ // This is not an expected case and should only happen if
+ // BrowserView::InitViews() has not been called. Presumably the |toolbar_|
+ // is not visible so the z-order does not matter.
Peter Kasting 2016/03/31 22:22:57 Seems like if this is true we should remove this c
bruthig 2016/04/01 16:15:12 Done.
AddChildView(bookmark_bar_view_.get());
+ }
+ } else if (new_parent == top_container_) {
+ // BookmarkBarView is detached.
Peter Kasting 2016/03/31 22:22:57 Do you mean "attached"?
bruthig 2016/04/01 16:15:12 Done.
+
+ // The |top_container_| parents the |toolbar_| too so we stack the
+ // |bookmark_bar_view_| first so it is behind the |toolbar_|.
Peter Kasting 2016/03/31 22:22:57 Nit: How about: The toolbar is a child of |top_co
bruthig 2016/04/01 16:15:12 Done.
+ new_parent->AddChildViewAt(bookmark_bar_view_.get(), 0);
} else if (new_parent) {
- // No special stacking is required for other parents.
+ // This is not an expected case so we will default to no special stacking.
Peter Kasting 2016/03/31 22:22:57 Seems like if this is true we should remove this c
bruthig 2016/04/01 16:15:12 Done.
new_parent->AddChildView(bookmark_bar_view_.get());
} else {
// Bookmark bar is being detached from all views because it is hidden.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698