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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_view.cc

Issue 1455193003: Draw popup window toolbars as only containing a location bar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@arbitrary_heights
Patch Set: Glass cleanups Created 5 years, 1 month 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 | « chrome/browser/ui/views/toolbar/toolbar_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/toolbar_view.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc
index 21b4d61102a51018ef02e91eb6b23c892a4d5a06..b235663d4be6fade250e6bdd2b715cdb6336ebaa 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -628,20 +628,6 @@ void ToolbarView::Layout() {
child_height);
}
-void ToolbarView::OnPaint(gfx::Canvas* canvas) {
- View::OnPaint(canvas);
-
- if (is_display_mode_normal())
- return;
-
- // For glass, we need to draw a black line below the location bar to separate
- // it from the content area. For non-glass, the NonClientView draws the
- // toolbar background below the location bar for us.
- // NOTE: Keep this in sync with BrowserView::GetInfoBarSeparatorColor()!
- if (GetWidget()->ShouldWindowContentsBeTransparent())
- canvas->FillRect(gfx::Rect(0, height() - 1, width(), 1), SK_ColorBLACK);
-}
-
void ToolbarView::OnThemeChanged() {
LoadImages();
}
@@ -657,10 +643,6 @@ bool ToolbarView::AcceleratorPressed(const ui::Accelerator& accelerator) {
return AccessiblePaneView::AcceleratorPressed(accelerator);
}
-bool ToolbarView::ShouldPaintBackground() const {
- return display_mode_ == DISPLAYMODE_NORMAL;
-}
-
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, protected:
@@ -737,9 +719,10 @@ void ToolbarView::UpdateBadgeSeverity(AppMenuBadgeController::BadgeType type,
}
int ToolbarView::PopupTopSpacing() const {
- const int kPopupTopSpacingNonGlass = 3;
- return GetWidget()->ShouldWindowContentsBeTransparent() ?
- 0 : kPopupTopSpacingNonGlass;
+ const int kAdditionalPopupTopSpacingNonGlass = 2;
+ return views::NonClientFrameView::kClientEdgeThickness +
+ (GetWidget()->ShouldWindowContentsBeTransparent() ?
+ 0 : kAdditionalPopupTopSpacingNonGlass);
}
gfx::Size ToolbarView::SizeForContentSize(gfx::Size size) const {
@@ -766,12 +749,8 @@ gfx::Size ToolbarView::SizeForContentSize(gfx::Size size) const {
if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH)
size.Enlarge(0, kAshBorderSpacing);
} else {
- const int kPopupBottomSpacingGlass = 1;
- const int kPopupBottomSpacingNonGlass = 2;
size.Enlarge(
- 0,
- PopupTopSpacing() + (GetWidget()->ShouldWindowContentsBeTransparent() ?
- kPopupBottomSpacingGlass : kPopupBottomSpacingNonGlass));
+ 0, PopupTopSpacing() + views::NonClientFrameView::kClientEdgeThickness);
}
return size;
}
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698