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

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

Issue 2893343002: Resize avatar button as appropriate for opaque browser frame. (Closed)
Patch Set: Created 3 years, 7 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
Index: chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
index 44845e01404d0aa646c3e06942d07c8b36fa60ec..8f0064b64b950d2ff1396e876e5a767ea958a472 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
@@ -71,6 +71,21 @@ views::View* BrowserNonClientFrameView::GetProfileSwitcherView() const {
void BrowserNonClientFrameView::UpdateClientArea() {}
+void BrowserNonClientFrameView::ChildPreferredSizeChanged(views::View* child) {
+ if (child == GetProfileSwitcherView()) {
+ // Need to layout the root view here, too, as the avatar button may change
Peter Kasting 2017/05/22 18:44:14 Nit: Not clear what "here, too," means in this con
Evan Stade 2017/05/22 20:32:48 Done.
+ // between the text and the icon when a profile is added or removed, which
+ // changes its width. This may cause it to start or stop overlapping the
+ // the tabstrip horizontally, which in turn causes it to change height, as
+ // calculated in LayoutProfileSwitcher(). Calling LayoutProfileSwitcher()
Peter Kasting 2017/05/22 18:44:15 Nit: LayoutProfileSwitcher() is not a member of th
Evan Stade 2017/05/22 20:32:48 I replaced this comment with the one we used to ha
+ // is not enough here - it does not re-draw the line below the tabstrip
+ // properly when a profile is added or removed. Even adding
+ // browser_view()->tabstrip()->Layout() and SchedulePaint() is not enough.
+ // TODO(bsep): Figure out the most efficient way to do this.
+ frame()->GetRootView()->Layout();
+ }
+}
+
void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from,
bool is_visible) {
// UpdateTaskbarDecoration() calls DrawTaskbarDecoration(), but that does

Powered by Google App Engine
This is Rietveld 408576698