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

Unified Diff: chrome/browser/ui/views/tabs/base_tab.cc

Issue 10938009: Views fuzzing for Aura and Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Work in progress. Created 8 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/tabs/base_tab.cc
diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc
index 81e6038938df546fc8bda80f51749451b144983a..b94fbf12421d4e23b6f10286c3ebe8ec61af0fce 100644
--- a/chrome/browser/ui/views/tabs/base_tab.cc
+++ b/chrome/browser/ui/views/tabs/base_tab.cc
@@ -52,21 +52,22 @@ class BaseTab::TabCloseButton : public views::ImageButton {
virtual ~TabCloseButton() {}
// Overridden from views::View.
- virtual View* GetEventHandlerForPoint(const gfx::Point& point) OVERRIDE {
+ virtual View* GetEventHandler(const gfx::Rect& rect, EventType type)
+ OVERRIDE {
// Ignore the padding set on the button.
- gfx::Rect rect = GetContentsBounds();
- rect.set_x(GetMirroredXForRect(rect));
+ gfx::Rect contents_rect = GetContentsBounds();
+ contents_rect.set_x(GetMirroredXForRect(contents_rect));
#if defined(USE_ASH)
// Include the padding in hit-test for touch events.
if (aura::Env::GetInstance()->is_touch_down())
- rect = GetLocalBounds();
+ contents_rect = GetLocalBounds();
#elif defined(OS_WIN)
// TODO(sky): Use local-bounds if a touch-point is active.
// http://crbug.com/145258
#endif
- return rect.Contains(point) ? this : parent();
+ return contents_rect.Intersects(rect) ? this : parent();
}
virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE {
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698