| Index: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/frame/opaque_browser_frame_view.cc (revision 84320)
|
| +++ chrome/browser/ui/views/frame/opaque_browser_frame_view.cc (working copy)
|
| @@ -106,8 +106,21 @@
|
| const int kProfileTagYPosition = 1;
|
| // Offset y position of profile button and tag by this amount when maximized.
|
| const int kProfileElementMaximizedYOffset = 6;
|
| +
|
| +// Converts |bounds| from |src|'s coordinate system to |dst|, and checks if
|
| +// |pt| is contained within.
|
| +bool ConvertedContainsCheck(gfx::Rect bounds, const views::View* src,
|
| + const views::View* dst, const gfx::Point& pt) {
|
| + DCHECK(src);
|
| + DCHECK(dst);
|
| + gfx::Point origin(bounds.origin());
|
| + views::View::ConvertPointToView(src, dst, &origin);
|
| + bounds.set_origin(origin);
|
| + return bounds.Contains(pt);
|
| }
|
|
|
| +}
|
| +
|
| ///////////////////////////////////////////////////////////////////////////////
|
| // OpaqueBrowserFrameView, public:
|
|
|
| @@ -443,7 +456,8 @@
|
| else
|
| PaintRestoredFrameBorder(canvas);
|
| PaintTitleBar(canvas);
|
| - if (browser_view_->IsToolbarVisible())
|
| + if (browser_view_->IsToolbarVisible() ||
|
| + browser_view_->UseCompactNavigationBar())
|
| PaintToolbarBackground(canvas);
|
| if (browser_view_->ShouldShowOffTheRecordAvatar())
|
| PaintOTRAvatar(canvas);
|
| @@ -477,6 +491,22 @@
|
| return false;
|
| }
|
|
|
| + // Claim it only if we're also not in the compact navigation buttons.
|
| + if (browser_view_->UseCompactNavigationBar()) {
|
| + if (ConvertedContainsCheck(browser_view_->GetCompactNavigationBarBounds(),
|
| + frame_->GetWindow()->client_view(),
|
| + static_cast<const View*>(this),
|
| + l)) {
|
| + return false;
|
| + }
|
| + if (ConvertedContainsCheck(browser_view_->GetCompactOptionsBarBounds(),
|
| + frame_->GetWindow()->client_view(),
|
| + static_cast<const View*>(this),
|
| + l)) {
|
| + return false;
|
| + }
|
| + }
|
| +
|
| // We convert from our parent's coordinates since we assume we fill its bounds
|
| // completely. We need to do this since we're not a parent of the tabstrip,
|
| // meaning ConvertPointToView would otherwise return something bogus.
|
| @@ -962,9 +992,10 @@
|
| gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height());
|
| SkColor toolbar_color = tp->GetColor(ThemeService::COLOR_TOOLBAR);
|
|
|
| - if (browser_view_->IsToolbarVisible()) {
|
| + if (browser_view_->IsToolbarVisible() ||
|
| + browser_view_->UseCompactNavigationBar()) {
|
| // The client edge images always start below the toolbar corner images. The
|
| - // client edge filled rects start there or at the bottom of the tooolbar,
|
| + // client edge filled rects start there or at the bottom of the toolbar,
|
| // whichever is shorter.
|
| gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds());
|
| image_top += toolbar_bounds.y() +
|
|
|