summaryrefslogtreecommitdiffstats
path: root/views/view.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-15 20:10:16 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-15 20:10:16 +0000
commit7e7c82a55f155887f30816d30d54ce5e8d8f38c4 (patch)
tree0d4e6bad63be82a95570f068c4e425ce087841dd /views/view.h
parent4110e83d3fa76393b865b078948a724f831f816b (diff)
downloadchromium_src-7e7c82a55f155887f30816d30d54ce5e8d8f38c4.zip
chromium_src-7e7c82a55f155887f30816d30d54ce5e8d8f38c4.tar.gz
chromium_src-7e7c82a55f155887f30816d30d54ce5e8d8f38c4.tar.bz2
Attempt 2 at:
Changes the tab close button to a dot, unless you're near the button or the tab is selected. The only difference between this and the first is that I missed a remove from the set if the view was deleted, which resulted in a crash. I've added an interactive test case that covers this. BUG=45743 TEST=none Review URL: http://codereview.chromium.org/2863003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49828 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view.h')
-rw-r--r--views/view.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/views/view.h b/views/view.h
index c0f6f07..a9012a5 100644
--- a/views/view.h
+++ b/views/view.h
@@ -178,6 +178,11 @@ class View : public AcceleratorTarget {
void SetX(int x) { SetBounds(x, y(), width(), height()); }
void SetY(int y) { SetBounds(x(), y, width(), height()); }
+ // Registers this view for mouse near events (OnMouseNear and
+ // OnMouseExitedNear). Mouse near events are sent for the extended rectangle
+ // defined by the bounds of this view + |insets|.
+ void RegisterForMouseNearEvents(const gfx::Insets& insets);
+
// Returns the left coordinate of the View, relative to the parent View,
// which is the value of bounds_.x().
//
@@ -686,6 +691,18 @@ class View : public AcceleratorTarget {
// Default implementation does nothing. Override as needed.
virtual void OnMouseExited(const MouseEvent& event);
+ // Sent when the mouse enters the rectangle defined by this views bounds and
+ // the insets passed to RegisterForMouseNearEvents. This is only sent for
+ // views that have explicitly registered for near notification
+ // (RegisterForMouseNearEvents).
+ virtual void OnMouseNear(const MouseEvent& event) {}
+
+ // Sent when the mouse exits the rectangle defined by this views bounds and
+ // the insets passed to RegisterForMouseNearEvents. This is only sent for
+ // views that have explicitly registered for near notification
+ // (RegisterForMouseNearEvents).
+ virtual void OnMouseExitedNear(const MouseEvent& event) {}
+
// Set the MouseHandler for a drag session.
//
// A drag session is a stream of mouse events starting
@@ -1176,11 +1193,11 @@ class View : public AcceleratorTarget {
// Recursively descends through all descendant views,
// registering/unregistering all views that want visible bounds in root
- // view notification.
- static void RegisterChildrenForVisibleBoundsNotification(RootView* root,
- View* view);
- static void UnregisterChildrenForVisibleBoundsNotification(RootView* root,
- View* view);
+ // view notification and/or mouse near events.
+ static void RegisterChildrenForRootNotifications(RootView* root, View* view);
+ static void UnregisterChildrenForRootNotifications(RootView* root,
+ View* view);
+
// Adds/removes view to the list of descendants that are notified any time
// this views location and possibly size are changed.
@@ -1280,6 +1297,9 @@ class View : public AcceleratorTarget {
// right-to-left locales for this View.
bool flip_canvas_on_paint_for_rtl_ui_;
+ // Insets passed to RegisterForMouseNearEvents.
+ scoped_ptr<gfx::Insets> near_insets_;
+
// The default value for how long to wait (in ms) before showing a menu
// button on hover. This value is used if the OS doesn't supply one.
static const int kShowFolderDropMenuDelay;