Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/ash_layout_constants.h" | 9 #include "ash/ash_layout_constants.h" |
| 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 #include "chrome/browser/ui/browser_commands.h" | 22 #include "chrome/browser/ui/browser_commands.h" |
| 23 #include "chrome/browser/ui/layout_constants.h" | 23 #include "chrome/browser/ui/layout_constants.h" |
| 24 #include "chrome/browser/ui/views/frame/browser_frame.h" | 24 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 25 #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h" | 25 #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h" |
| 26 #include "chrome/browser/ui/views/frame/browser_view.h" | 26 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 27 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 27 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| 28 #include "chrome/browser/ui/views/frame/web_app_left_header_view_ash.h" | 28 #include "chrome/browser/ui/views/frame/web_app_left_header_view_ash.h" |
| 29 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" | 29 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" |
| 30 #include "chrome/browser/ui/views/tab_icon_view.h" | 30 #include "chrome/browser/ui/views/tab_icon_view.h" |
| 31 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 31 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 32 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | |
| 32 #include "chrome/browser/web_applications/web_app.h" | 33 #include "chrome/browser/web_applications/web_app.h" |
| 33 #include "components/signin/core/common/profile_management_switches.h" | 34 #include "components/signin/core/common/profile_management_switches.h" |
| 34 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
| 35 #include "extensions/browser/extension_registry.h" | 36 #include "extensions/browser/extension_registry.h" |
| 36 #include "grit/theme_resources.h" | 37 #include "grit/theme_resources.h" |
| 37 #include "ui/accessibility/ax_view_state.h" | 38 #include "ui/accessibility/ax_view_state.h" |
| 38 #include "ui/aura/client/aura_constants.h" | 39 #include "ui/aura/client/aura_constants.h" |
| 39 #include "ui/aura/window.h" | 40 #include "ui/aura/window.h" |
| 40 #include "ui/base/hit_test.h" | 41 #include "ui/base/hit_test.h" |
| 41 #include "ui/base/layout.h" | 42 #include "ui/base/layout.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 return ((frame()->IsMaximized() || frame()->IsFullscreen()) && !restored) ? | 183 return ((frame()->IsMaximized() || frame()->IsFullscreen()) && !restored) ? |
| 183 kTabstripTopSpacingShort : kTabstripTopSpacingTall; | 184 kTabstripTopSpacingShort : kTabstripTopSpacingTall; |
| 184 } | 185 } |
| 185 | 186 |
| 186 if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) | 187 if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) |
| 187 return header_painter_->GetHeaderHeight(); | 188 return header_painter_->GetHeaderHeight(); |
| 188 | 189 |
| 189 int caption_buttons_bottom = caption_button_container_->bounds().bottom(); | 190 int caption_buttons_bottom = caption_button_container_->bounds().bottom(); |
| 190 | 191 |
| 191 // The toolbar partially overlaps the caption buttons. | 192 // The toolbar partially overlaps the caption buttons. |
| 192 if (browser_view()->IsToolbarVisible()) | 193 if (IsToolbarVisible()) |
| 193 return caption_buttons_bottom - kContentShadowHeight; | 194 return caption_buttons_bottom; |
| 194 | 195 |
| 195 return caption_buttons_bottom + kClientEdgeThickness; | 196 return caption_buttons_bottom + kClientEdgeThickness; |
| 196 } | 197 } |
| 197 | 198 |
| 198 int BrowserNonClientFrameViewAsh::GetThemeBackgroundXInset() const { | 199 int BrowserNonClientFrameViewAsh::GetThemeBackgroundXInset() const { |
| 199 return ash::HeaderPainterUtil::GetThemeBackgroundXInset(); | 200 return ash::HeaderPainterUtil::GetThemeBackgroundXInset(); |
| 200 } | 201 } |
| 201 | 202 |
| 202 void BrowserNonClientFrameViewAsh::UpdateThrobber(bool running) { | 203 void BrowserNonClientFrameViewAsh::UpdateThrobber(bool running) { |
| 203 if (window_icon_) | 204 if (window_icon_) |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 return; | 300 return; |
| 300 } | 301 } |
| 301 | 302 |
| 302 caption_button_container_->SetPaintAsActive(ShouldPaintAsActive()); | 303 caption_button_container_->SetPaintAsActive(ShouldPaintAsActive()); |
| 303 if (web_app_left_header_view_) | 304 if (web_app_left_header_view_) |
| 304 web_app_left_header_view_->SetPaintAsActive(ShouldPaintAsActive()); | 305 web_app_left_header_view_->SetPaintAsActive(ShouldPaintAsActive()); |
| 305 | 306 |
| 306 ash::HeaderPainter::Mode header_mode = ShouldPaintAsActive() ? | 307 ash::HeaderPainter::Mode header_mode = ShouldPaintAsActive() ? |
| 307 ash::HeaderPainter::MODE_ACTIVE : ash::HeaderPainter::MODE_INACTIVE; | 308 ash::HeaderPainter::MODE_ACTIVE : ash::HeaderPainter::MODE_INACTIVE; |
| 308 header_painter_->PaintHeader(canvas, header_mode); | 309 header_painter_->PaintHeader(canvas, header_mode); |
| 309 if (browser_view()->IsToolbarVisible()) | 310 |
| 311 if (IsToolbarVisible()) | |
| 310 PaintToolbarBackground(canvas); | 312 PaintToolbarBackground(canvas); |
| 311 else if (!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()) | 313 PaintContentEdge(canvas); |
| 312 PaintContentEdge(canvas); | |
| 313 } | 314 } |
| 314 | 315 |
| 315 void BrowserNonClientFrameViewAsh::Layout() { | 316 void BrowserNonClientFrameViewAsh::Layout() { |
| 316 // The header must be laid out before computing |painted_height| because the | 317 // The header must be laid out before computing |painted_height| because the |
| 317 // computation of |painted_height| for app and popup windows depends on the | 318 // computation of |painted_height| for app and popup windows depends on the |
| 318 // position of the window controls. | 319 // position of the window controls. |
| 319 header_painter_->LayoutHeader(); | 320 header_painter_->LayoutHeader(); |
| 320 | 321 |
| 321 int painted_height = GetTopInset(false); | 322 int painted_height = GetTopInset(false); |
| 322 if (browser_view()->IsTabStripVisible()) { | 323 if (browser_view()->IsTabStripVisible()) |
| 323 painted_height += browser_view()->tabstrip()->GetPreferredSize().height(); | 324 painted_height += browser_view()->tabstrip()->GetPreferredSize().height(); |
| 324 } else if (browser_view()->IsToolbarVisible()) { | 325 |
| 325 // Paint the header so that it overlaps with the top few pixels of the | |
| 326 // toolbar because the top few pixels of the toolbar are not opaque. | |
| 327 const int kToolbarTopEdgeExclusion = 2; | |
| 328 painted_height += kToolbarTopEdgeExclusion; | |
| 329 } | |
| 330 header_painter_->SetHeaderHeightForPainting(painted_height); | 326 header_painter_->SetHeaderHeightForPainting(painted_height); |
| 331 | 327 |
| 332 if (avatar_button()) { | 328 if (avatar_button()) { |
| 333 LayoutAvatar(); | 329 LayoutAvatar(); |
| 334 header_painter_->UpdateLeftViewXInset(avatar_button()->bounds().right()); | 330 header_painter_->UpdateLeftViewXInset(avatar_button()->bounds().right()); |
| 335 } | 331 } |
| 336 header_painter_->UpdateLeftViewXInset( | 332 header_painter_->UpdateLeftViewXInset( |
| 337 ash::HeaderPainterUtil::GetDefaultLeftViewXInset()); | 333 ash::HeaderPainterUtil::GetDefaultLeftViewXInset()); |
| 338 BrowserNonClientFrameView::Layout(); | 334 BrowserNonClientFrameView::Layout(); |
| 339 } | 335 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 534 } | 530 } |
| 535 | 531 |
| 536 void BrowserNonClientFrameViewAsh::PaintImmersiveLightbarStyleHeader( | 532 void BrowserNonClientFrameViewAsh::PaintImmersiveLightbarStyleHeader( |
| 537 gfx::Canvas* canvas) { | 533 gfx::Canvas* canvas) { |
| 538 // The light bar header is not themed because theming it does not look good. | 534 // The light bar header is not themed because theming it does not look good. |
| 539 canvas->FillRect( | 535 canvas->FillRect( |
| 540 gfx::Rect(width(), header_painter_->GetHeaderHeightForPainting()), | 536 gfx::Rect(width(), header_painter_->GetHeaderHeightForPainting()), |
| 541 SK_ColorBLACK); | 537 SK_ColorBLACK); |
| 542 } | 538 } |
| 543 | 539 |
| 540 bool BrowserNonClientFrameViewAsh::IsToolbarVisible() const { | |
| 541 return browser_view()->IsToolbarVisible() && | |
| 542 !browser_view()->toolbar()->GetPreferredSize().IsEmpty(); | |
| 543 } | |
| 544 | |
| 544 void BrowserNonClientFrameViewAsh::PaintToolbarBackground(gfx::Canvas* canvas) { | 545 void BrowserNonClientFrameViewAsh::PaintToolbarBackground(gfx::Canvas* canvas) { |
| 545 gfx::Rect toolbar_bounds(browser_view()->GetToolbarBounds()); | 546 gfx::Rect toolbar_bounds(browser_view()->GetToolbarBounds()); |
| 546 if (toolbar_bounds.IsEmpty()) | 547 if (toolbar_bounds.IsEmpty()) |
| 547 return; | 548 return; |
| 548 gfx::Point toolbar_origin(toolbar_bounds.origin()); | 549 gfx::Point toolbar_origin(toolbar_bounds.origin()); |
| 549 View::ConvertPointToTarget(browser_view(), this, &toolbar_origin); | 550 View::ConvertPointToTarget(browser_view(), this, &toolbar_origin); |
| 550 toolbar_bounds.set_origin(toolbar_origin); | 551 toolbar_bounds.set_origin(toolbar_origin); |
| 552 const int h = toolbar_bounds.height(); | |
| 553 const bool md = ui::MaterialDesignController::IsModeMaterial(); | |
| 554 const ui::ThemeProvider* tp = GetThemeProvider(); | |
| 555 const SkColor separator_color = | |
| 556 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR); | |
| 551 | 557 |
| 552 int x = toolbar_bounds.x(); | 558 if (browser_view()->IsTabStripVisible()) { |
| 553 int w = toolbar_bounds.width(); | 559 gfx::ImageSkia* bg = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR); |
| 554 int y = toolbar_bounds.y(); | 560 int x = toolbar_bounds.x(); |
| 555 int h = toolbar_bounds.height(); | 561 const int y = toolbar_bounds.y(); |
| 556 const ui::ThemeProvider* tp = GetThemeProvider(); | 562 const int bg_y = |
| 563 GetTopInset(false) + Tab::GetYInsetForActiveTabBackground(); | |
| 564 const int w = toolbar_bounds.width(); | |
| 557 | 565 |
| 558 if (ui::MaterialDesignController::IsModeMaterial()) { | 566 if (md) { |
| 559 if (tp->HasCustomImage(IDR_THEME_TOOLBAR)) { | 567 if (tp->HasCustomImage(IDR_THEME_TOOLBAR)) { |
| 560 // Paint the main toolbar image. Since this image is also used to draw | 568 // Paint the main toolbar image. Since this image is also used to draw |
|
Peter Kasting
2016/02/03 01:09:23
It would be nice to make this line up even more cl
tdanderson
2016/02/04 16:38:36
I think the variable names here are already identi
| |
| 561 // the tab background, we must use the tab strip offset to compute the | 569 // the tab background, we must use the tab strip offset to compute the |
| 562 // image source y position. If you have to debug this code use an image | 570 // image source y position. If you have to debug this code use an image |
| 563 // editor to paint a diagonal line through the toolbar image and ensure it | 571 // editor to paint a diagonal line through the toolbar image and ensure |
| 564 // lines up across the tab and toolbar. | 572 // it lines up across the tab and toolbar. |
| 565 gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR); | 573 canvas->TileImageInt(*bg, x + GetThemeBackgroundXInset(), y - bg_y, x, |
| 566 canvas->TileImageInt(*theme_toolbar, x + GetThemeBackgroundXInset(), | 574 y, w, h); |
| 567 y - GetTopInset(false), x, y, w, | 575 } else { |
| 568 theme_toolbar->height()); | 576 canvas->FillRect(toolbar_bounds, |
| 569 } else { | 577 tp->GetColor(ThemeProperties::COLOR_TOOLBAR)); |
| 570 canvas->FillRect(toolbar_bounds, | 578 } |
| 571 tp->GetColor(ThemeProperties::COLOR_TOOLBAR)); | |
| 572 } | |
| 573 | 579 |
| 574 // Draw the separator line atop the toolbar, on the left and right of the | 580 // Separator line above the toolbar, which coincides with the bottom edge |
| 575 // tabstrip. | 581 // of the tab strip. |
| 576 // TODO(tdanderson): Draw the separator line for non-tabbed windows. | |
| 577 if (browser_view()->IsTabStripVisible()) { | |
| 578 gfx::Rect separator_rect(x, y, w, 0); | 582 gfx::Rect separator_rect(x, y, w, 0); |
| 579 gfx::ScopedCanvas scoped_canvas(canvas); | 583 gfx::ScopedCanvas scoped_canvas(canvas); |
| 580 gfx::Rect tabstrip_bounds( | 584 gfx::Rect tabstrip_bounds( |
| 581 GetBoundsForTabStrip(browser_view()->tabstrip())); | 585 GetBoundsForTabStrip(browser_view()->tabstrip())); |
| 582 tabstrip_bounds.set_x(GetMirroredXForRect(tabstrip_bounds)); | 586 tabstrip_bounds.set_x(GetMirroredXForRect(tabstrip_bounds)); |
| 583 canvas->sk_canvas()->clipRect(gfx::RectToSkRect(tabstrip_bounds), | 587 canvas->sk_canvas()->clipRect(gfx::RectToSkRect(tabstrip_bounds), |
| 584 SkRegion::kDifference_Op); | 588 SkRegion::kDifference_Op); |
| 585 separator_rect.set_y(tabstrip_bounds.bottom()); | 589 separator_rect.set_y(tabstrip_bounds.bottom()); |
| 586 BrowserView::Paint1pxHorizontalLine( | 590 BrowserView::Paint1pxHorizontalLine( |
| 587 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR), | 591 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR), |
| 588 separator_rect, true); | 592 separator_rect, true); |
| 593 } else { | |
| 594 // Gross hack: We split the toolbar images into two pieces, since | |
| 595 // sometimes (popup mode) the toolbar isn't tall enough to show the whole | |
| 596 // image. The split happens between the top shadow section and the bottom | |
| 597 // gradient section so that we never break the gradient. | |
| 598 // NOTE(pkotwicz): If the computation for |bottom_y| is changed, Layout() | |
| 599 // must be changed as well. | |
| 600 int split_point = kFrameShadowThickness * 2; | |
| 601 int bottom_y = y + split_point; | |
| 602 int bottom_edge_height = h - split_point; | |
| 603 | |
| 604 canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height), | |
| 605 tp->GetColor(ThemeProperties::COLOR_TOOLBAR)); | |
| 606 | |
| 607 // Paint the main toolbar image. Since this image is also used to draw | |
| 608 // the tab background, we must use the tab strip offset to compute the | |
| 609 // image source y position. If you have to debug this code use an image | |
| 610 // editor to paint a diagonal line through the toolbar image and ensure it | |
| 611 // lines up across the tab and toolbar. | |
| 612 canvas->TileImageInt( | |
| 613 *bg, | |
| 614 x + GetThemeBackgroundXInset(), | |
| 615 bottom_y - bg_y, | |
| 616 x, bottom_y, | |
| 617 w, bg->height()); | |
| 618 | |
| 619 // The pre-material design content area line has a shadow that extends a | |
| 620 // couple of pixels above the toolbar bounds. | |
| 621 const int kContentShadowHeight = 2; | |
| 622 gfx::ImageSkia* toolbar_top = | |
| 623 tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_TOP); | |
| 624 canvas->TileImageInt(*toolbar_top, | |
| 625 0, 0, | |
| 626 x, y - kContentShadowHeight, | |
| 627 w, split_point + kContentShadowHeight + 1); | |
| 628 | |
| 629 // Draw the "lightening" shade line around the edges of the toolbar. | |
| 630 gfx::ImageSkia* toolbar_left = | |
| 631 tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_LEFT); | |
| 632 canvas->TileImageInt(*toolbar_left, | |
| 633 0, 0, | |
| 634 x + kClientEdgeThickness, | |
| 635 y + kClientEdgeThickness + kContentShadowHeight, | |
| 636 toolbar_left->width(), bg->height()); | |
| 637 gfx::ImageSkia* toolbar_right = | |
| 638 tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_RIGHT); | |
| 639 canvas->TileImageInt(*toolbar_right, | |
| 640 0, 0, | |
| 641 w - toolbar_right->width() - 2*kClientEdgeThickness, | |
| 642 y + kClientEdgeThickness + kContentShadowHeight, | |
| 643 toolbar_right->width(), bg->height()); | |
| 589 } | 644 } |
| 645 } | |
| 590 | 646 |
| 591 // Draw the content/toolbar separator. | 647 // Draw the toolbar/content separator. |
| 592 toolbar_bounds.Inset(kClientEdgeThickness, 0); | 648 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, |
| 593 BrowserView::Paint1pxHorizontalLine( | 649 kClientEdgeThickness, 0); |
| 594 canvas, | 650 if (md) { |
| 595 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), | 651 // On devices having a device scale factor other than 1, a transparent gap |
| 596 toolbar_bounds, true); | 652 // will appear along the bottom edge of the location bar. Fill this region |
| 653 // with white so it appears that the location bar extends to the bottom | |
| 654 // separator line. | |
| 655 // TODO(pkasting|tdanderson): Remove this hack. | |
| 656 canvas->FillRect(toolbar_bounds, SK_ColorWHITE); | |
|
Peter Kasting
2016/02/03 01:09:23
Doesn't this look gruesomely bad in incognito?
I
tdanderson
2016/02/04 16:38:36
OK, removed. Is there a bug for that?
| |
| 657 | |
| 658 BrowserView::Paint1pxHorizontalLine(canvas, separator_color, | |
| 659 toolbar_bounds, true); | |
| 597 } else { | 660 } else { |
| 598 // Gross hack: We split the toolbar images into two pieces, since sometimes | 661 canvas->FillRect(toolbar_bounds, separator_color); |
| 599 // (popup mode) the toolbar isn't tall enough to show the whole image. The | |
| 600 // split happens between the top shadow section and the bottom gradient | |
| 601 // section so that we never break the gradient. | |
| 602 // NOTE(pkotwicz): If the computation for |bottom_y| is changed, Layout() | |
| 603 // must be changed as well. | |
| 604 int split_point = kFrameShadowThickness * 2; | |
| 605 int bottom_y = y + split_point; | |
| 606 int bottom_edge_height = h - split_point; | |
| 607 | |
| 608 canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height), | |
| 609 tp->GetColor(ThemeProperties::COLOR_TOOLBAR)); | |
| 610 | |
| 611 // Paint the main toolbar image. Since this image is also used to draw the | |
| 612 // tab background, we must use the tab strip offset to compute the image | |
| 613 // source y position. If you have to debug this code use an image editor | |
| 614 // to paint a diagonal line through the toolbar image and ensure it lines up | |
| 615 // across the tab and toolbar. | |
| 616 gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR); | |
| 617 canvas->TileImageInt( | |
| 618 *theme_toolbar, | |
| 619 x + GetThemeBackgroundXInset(), | |
| 620 bottom_y - GetTopInset(false), | |
| 621 x, bottom_y, | |
| 622 w, theme_toolbar->height()); | |
| 623 | |
| 624 // The pre-material design content area line has a shadow that extends a | |
| 625 // couple of pixels above the toolbar bounds. | |
| 626 const int kContentShadowHeight = 2; | |
| 627 gfx::ImageSkia* toolbar_top = tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_TOP); | |
| 628 canvas->TileImageInt(*toolbar_top, | |
| 629 0, 0, | |
| 630 x, y - kContentShadowHeight, | |
| 631 w, split_point + kContentShadowHeight + 1); | |
| 632 | |
| 633 // Draw the "lightening" shade line around the edges of the toolbar. | |
| 634 gfx::ImageSkia* toolbar_left = | |
| 635 tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_LEFT); | |
| 636 canvas->TileImageInt(*toolbar_left, | |
| 637 0, 0, | |
| 638 x + kClientEdgeThickness, | |
| 639 y + kClientEdgeThickness + kContentShadowHeight, | |
| 640 toolbar_left->width(), theme_toolbar->height()); | |
| 641 gfx::ImageSkia* toolbar_right = | |
| 642 tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_RIGHT); | |
| 643 canvas->TileImageInt(*toolbar_right, | |
| 644 0, 0, | |
| 645 w - toolbar_right->width() - 2 * kClientEdgeThickness, | |
| 646 y + kClientEdgeThickness + kContentShadowHeight, | |
| 647 toolbar_right->width(), theme_toolbar->height()); | |
| 648 | |
| 649 // Draw the content/toolbar separator. | |
| 650 canvas->FillRect( | |
| 651 gfx::Rect(x + kClientEdgeThickness, | |
| 652 toolbar_bounds.bottom() - kClientEdgeThickness, | |
| 653 w - (2 * kClientEdgeThickness), kClientEdgeThickness), | |
| 654 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR)); | |
| 655 } | 662 } |
| 656 } | 663 } |
| 657 | 664 |
| 658 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { | 665 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { |
| 659 DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()); | 666 if (browser_view()->IsTabStripVisible()) |
| 660 canvas->FillRect( | 667 return; |
| 661 gfx::Rect(0, caption_button_container_->bounds().bottom(), width(), | 668 |
| 662 kClientEdgeThickness), | 669 // The content separator is drawn by DefaultHeaderPainter in these cases. |
| 663 GetThemeProvider()->GetColor( | 670 if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) |
| 664 ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR)); | 671 return; |
| 672 | |
| 673 gfx::Rect separator_rect( | |
| 674 0, caption_button_container_->bounds().bottom(), width(), 0); | |
| 675 BrowserView::Paint1pxHorizontalLine( | |
| 676 canvas, GetThemeProvider()->GetColor( | |
| 677 ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), | |
| 678 separator_rect, true); | |
|
Peter Kasting
2016/02/03 01:09:23
It seems like this is drawing the same bottom sepa
tdanderson
2016/02/04 16:38:36
Thanks for catching that, fixed.
| |
| 665 } | 679 } |
| OLD | NEW |