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

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

Issue 6913026: Compact Navigation prototype (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added missing DropdownBarHostDelegate header file. Created 9 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/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() +

Powered by Google App Engine
This is Rietveld 408576698