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

Side by Side Diff: ui/views/view.h

Issue 22891016: Add support for rect-based event targeting in views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/message_center/views/notification_view.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef UI_VIEWS_VIEW_H_ 5 #ifndef UI_VIEWS_VIEW_H_
6 #define UI_VIEWS_VIEW_H_ 6 #define UI_VIEWS_VIEW_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 flip_canvas_on_paint_for_rtl_ui_ = enable; 564 flip_canvas_on_paint_for_rtl_ui_ = enable;
565 } 565 }
566 566
567 // Accelerated painting ------------------------------------------------------ 567 // Accelerated painting ------------------------------------------------------
568 568
569 // Enable/Disable accelerated compositing. 569 // Enable/Disable accelerated compositing.
570 static void set_use_acceleration_when_possible(bool use); 570 static void set_use_acceleration_when_possible(bool use);
571 static bool get_use_acceleration_when_possible(); 571 static bool get_use_acceleration_when_possible();
572 572
573 // Input --------------------------------------------------------------------- 573 // Input ---------------------------------------------------------------------
574 // The points (and mouse locations) in the following functions are in the 574 // The points, rects, mouse locations, and touch locations in the following
575 // view's coordinates, except for a RootView. 575 // functions are in the view's coordinates, except for a RootView.
576 576
577 // Returns the deepest visible descendant that contains the specified point 577 // Convenience functions which calls into GetEventHandler() with
578 // and supports event handling. 578 // a 1x1 rect centered at |point|.
579 virtual View* GetEventHandlerForPoint(const gfx::Point& point); 579 View* GetEventHandlerForPoint(const gfx::Point& point);
580
581 // If point-based targeting should be used, return the deepest visible
582 // descendant that contains the center point of |rect|.
583 // If rect-based targeting (i.e., fuzzing) should be used, return the
584 // closest visible descendant having at least kRectTargetOverlap of
585 // its area covered by |rect|. If no such descendant exists, return the
586 // deepest visible descendant that contains the center point of |rect|.
587 virtual View* GetEventHandlerForRect(const gfx::Rect& rect);
580 588
581 // Returns the deepest visible descendant that contains the specified point 589 // Returns the deepest visible descendant that contains the specified point
582 // and supports tooltips. If the view does not contain the point, returns 590 // and supports tooltips. If the view does not contain the point, returns
583 // NULL. 591 // NULL.
584 virtual View* GetTooltipHandlerForPoint(const gfx::Point& point); 592 virtual View* GetTooltipHandlerForPoint(const gfx::Point& point);
585 593
586 // Return the cursor that should be used for this view or the default cursor. 594 // Return the cursor that should be used for this view or the default cursor.
587 // The event location is in the receiver's coordinate system. The caller is 595 // The event location is in the receiver's coordinate system. The caller is
588 // responsible for managing the lifetime of the returned object, though that 596 // responsible for managing the lifetime of the returned object, though that
589 // lifetime may vary from platform to platform. On Windows and Aura, 597 // lifetime may vary from platform to platform. On Windows and Aura,
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 // Belongs to this view, but it's reference-counted on some platforms 1572 // Belongs to this view, but it's reference-counted on some platforms
1565 // so we can't use a scoped_ptr. It's dereferenced in the destructor. 1573 // so we can't use a scoped_ptr. It's dereferenced in the destructor.
1566 NativeViewAccessibility* native_view_accessibility_; 1574 NativeViewAccessibility* native_view_accessibility_;
1567 1575
1568 DISALLOW_COPY_AND_ASSIGN(View); 1576 DISALLOW_COPY_AND_ASSIGN(View);
1569 }; 1577 };
1570 1578
1571 } // namespace views 1579 } // namespace views
1572 1580
1573 #endif // UI_VIEWS_VIEW_H_ 1581 #endif // UI_VIEWS_VIEW_H_
OLDNEW
« no previous file with comments | « ui/message_center/views/notification_view.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698