summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-14 01:18:00 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-14 01:18:00 +0000
commitb8595e9c25fc47e4e0e91683b38f4772b4789f1b (patch)
tree9cc63c58e432b835a3af85ac89d4cd9df0d33aa9 /chrome/browser/tab_contents
parent5da4928116a7168b456415f9af412f93138b6dcb (diff)
downloadchromium_src-b8595e9c25fc47e4e0e91683b38f4772b4789f1b.zip
chromium_src-b8595e9c25fc47e4e0e91683b38f4772b4789f1b.tar.gz
chromium_src-b8595e9c25fc47e4e0e91683b38f4772b4789f1b.tar.bz2
gtk: Hide the status bubble when the mouse nears it.
This isn't as slick as other platforms, in that the bubble just slides down and gets cropped instead of sliding down out of the browser window -- doing the latter will probably require reparenting the bubble into its own window when we want to move it. BUG=18311 TEST=ran "nc -l -p 8080", went to localhost:8080, and made sure that the bubble ran away with both LTR and RTL languages Review URL: http://codereview.chromium.org/392007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.h9
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.cc6
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_mac.mm7
3 files changed, 15 insertions, 7 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
index f5fdfcf..b4d3009 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents/tab_contents_delegate.h
@@ -94,11 +94,14 @@ class TabContentsDelegate {
// Notification that the starredness of the current URL changed.
virtual void URLStarredChanged(TabContents* source, bool starred) = 0;
- // Notification that the target URL has changed
+ // Notification that the target URL has changed.
virtual void UpdateTargetURL(TabContents* source, const GURL& url) = 0;
- // Notification that there was a mouse event
- virtual void ContentsMouseEvent(TabContents* source, bool motion) { }
+ // Notification that there was a mouse event, along with the absolute
+ // coordinates of the mouse pointer and whether it was a normal motion event
+ // (otherwise, the pointer left the contents area).
+ virtual void ContentsMouseEvent(
+ TabContents* source, const gfx::Point& location, bool motion) { }
// Request the delegate to change the zoom level of the current tab.
virtual void ContentsZoomChange(bool zoom_in) { }
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
index 332c7cd..61c685e 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
@@ -69,7 +69,8 @@ gboolean OnFocus(GtkWidget* widget, GtkDirectionType focus,
gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event,
TabContents* tab_contents) {
if (tab_contents->delegate())
- tab_contents->delegate()->ContentsMouseEvent(tab_contents, false);
+ tab_contents->delegate()->ContentsMouseEvent(
+ tab_contents, gfx::Point(event->x_root, event->y_root), false);
return FALSE;
}
@@ -77,7 +78,8 @@ gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event,
gboolean OnMouseMove(GtkWidget* widget, GdkEventMotion* event,
TabContents* tab_contents) {
if (tab_contents->delegate())
- tab_contents->delegate()->ContentsMouseEvent(tab_contents, true);
+ tab_contents->delegate()->ContentsMouseEvent(
+ tab_contents, gfx::Point(event->x_root, event->y_root), true);
return FALSE;
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm
index 9a06d66..60bc43a 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm
@@ -406,10 +406,13 @@ void TabContentsViewMac::Observe(NotificationType type,
- (void)mouseEvent:(NSEvent *)theEvent {
TabContents* tabContents = [self tabContents];
if (tabContents->delegate()) {
+ NSPoint location = [NSEvent mouseLocation];
if ([theEvent type] == NSMouseMoved)
- tabContents->delegate()->ContentsMouseEvent(tabContents, true);
+ tabContents->delegate()->ContentsMouseEvent(
+ tabContents, gfx::Point(location.x, location.y), true);
if ([theEvent type] == NSMouseExited)
- tabContents->delegate()->ContentsMouseEvent(tabContents, false);
+ tabContents->delegate()->ContentsMouseEvent(
+ tabContents, gfx::Point(location.x, location.y), false);
}
}