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

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

Issue 2179643002: Fix infobar painting issues at fractional scales (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pkasting final review Created 4 years, 4 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 | « no previous file | chrome/browser/ui/views/infobars/infobar_background.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/ui/views/frame/browser_view_layout.h" 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/observer_list.h" 8 #include "base/observer_list.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 459
460 int BrowserViewLayout::LayoutInfoBar(int top) { 460 int BrowserViewLayout::LayoutInfoBar(int top) {
461 // In immersive fullscreen, the infobar always starts near the top of the 461 // In immersive fullscreen, the infobar always starts near the top of the
462 // screen, just under the "light bar" rectangular stripes. 462 // screen, just under the "light bar" rectangular stripes.
463 if (immersive_mode_controller_->IsEnabled()) { 463 if (immersive_mode_controller_->IsEnabled()) {
464 top = browser_view_->y(); 464 top = browser_view_->y();
465 if (!immersive_mode_controller_->ShouldHideTabIndicators()) 465 if (!immersive_mode_controller_->ShouldHideTabIndicators())
466 top += TabStrip::GetImmersiveHeight(); 466 top += TabStrip::GetImmersiveHeight();
467 } 467 }
468 // Raise the |infobar_container_| by its vertical overlap.
469 infobar_container_->SetVisible(InfobarVisible()); 468 infobar_container_->SetVisible(InfobarVisible());
470 infobar_container_->SetBounds( 469 infobar_container_->SetBounds(
471 vertical_layout_rect_.x(), top, vertical_layout_rect_.width(), 470 vertical_layout_rect_.x(), top, vertical_layout_rect_.width(),
472 infobar_container_->GetPreferredSize().height()); 471 infobar_container_->GetPreferredSize().height());
473 return top + infobar_container_->height(); 472 return top + infobar_container_->height();
474 } 473 }
475 474
476 void BrowserViewLayout::LayoutContentsContainerView(int top, int bottom) { 475 void BrowserViewLayout::LayoutContentsContainerView(int top, int bottom) {
477 // |contents_container_| contains web page contents and devtools. 476 // |contents_container_| contains web page contents and devtools.
478 // See browser_view.h for details. 477 // See browser_view.h for details.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 return bottom; 544 return bottom;
546 } 545 }
547 546
548 bool BrowserViewLayout::InfobarVisible() const { 547 bool BrowserViewLayout::InfobarVisible() const {
549 // Cast to a views::View to access GetPreferredSize(). 548 // Cast to a views::View to access GetPreferredSize().
550 views::View* infobar_container = infobar_container_; 549 views::View* infobar_container = infobar_container_;
551 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. 550 // NOTE: Can't check if the size IsEmpty() since it's always 0-width.
552 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && 551 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) &&
553 (infobar_container->GetPreferredSize().height() != 0); 552 (infobar_container->GetPreferredSize().height() != 0);
554 } 553 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/infobars/infobar_background.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698