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

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

Issue 22891016: Add support for rect-based event targeting in views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed, moved fuzzing utility functions to new file Created 7 years, 2 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/browser_non_client_frame_view_ash.cc
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
index 22ef7d3c058ac68bf2f612f7195339dc46a92fa7..cea77d6f4d0584859e137bdc8e9f9e7a6c2f2455 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -292,12 +292,9 @@ bool BrowserNonClientFrameViewAsh::HitTestRect(const gfx::Rect& rect) const {
return false;
}
// If the rect is outside the bounds of the client area, claim it.
- // TODO(tdanderson): Implement View::ConvertRectToTarget().
- gfx::Point rect_in_client_view_coords_origin(rect.origin());
- View::ConvertPointToTarget(this, frame()->client_view(),
- &rect_in_client_view_coords_origin);
- gfx::Rect rect_in_client_view_coords(
- rect_in_client_view_coords_origin, rect.size());
+ gfx::Rect rect_in_client_view_coords(rect);
+ View::ConvertRectToTarget(this, frame()->client_view(),
+ &rect_in_client_view_coords);
if (!frame()->client_view()->HitTestRect(rect_in_client_view_coords))
return true;
@@ -307,24 +304,17 @@ bool BrowserNonClientFrameViewAsh::HitTestRect(const gfx::Rect& rect) const {
if (!tabstrip || !browser_view()->IsTabStripVisible())
return false;
- gfx::Point rect_in_tabstrip_coords_origin(rect.origin());
- View::ConvertPointToTarget(this, tabstrip,
- &rect_in_tabstrip_coords_origin);
- gfx::Rect rect_in_tabstrip_coords(rect_in_tabstrip_coords_origin,
- rect.size());
+ gfx::Rect rect_in_tabstrip_coords(rect);
+ View::ConvertRectToTarget(this, tabstrip, &rect_in_tabstrip_coords);
- if (rect_in_tabstrip_coords.bottom() > tabstrip->GetLocalBounds().bottom()) {
+ if (rect_in_tabstrip_coords.y() > tabstrip->GetLocalBounds().bottom()) {
// |rect| is below the tabstrip.
return false;
}
if (tabstrip->HitTestRect(rect_in_tabstrip_coords)) {
// Claim |rect| if it is in a non-tab portion of the tabstrip.
- // TODO(tdanderson): Pass |rect_in_tabstrip_coords| instead of its center
- // point to TabStrip::IsPositionInWindowCaption() once
- // GetEventHandlerForRect() is implemented.
- return tabstrip->IsPositionInWindowCaption(
- rect_in_tabstrip_coords.CenterPoint());
+ return tabstrip->IsRectInWindowCaption(rect_in_tabstrip_coords);
}
// We claim |rect| because it is above the bottom of the tabstrip, but
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/opaque_browser_frame_view.cc » ('j') | ui/views/rect_based_targeting_utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698