summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 21:10:22 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 21:10:22 +0000
commitb7a763ad855baecbbf22a617164d5b5fd43ae899 (patch)
treeb5af064882a0dcf112e59378f7b2f3f01ca0bb06 /chrome
parentae1eeb8d890e96db6ccb20e50e023c494fb9b024 (diff)
downloadchromium_src-b7a763ad855baecbbf22a617164d5b5fd43ae899.zip
chromium_src-b7a763ad855baecbbf22a617164d5b5fd43ae899.tar.gz
chromium_src-b7a763ad855baecbbf22a617164d5b5fd43ae899.tar.bz2
Fixes a couple of related bugs:
. gdk_display_get_pointer requires a display. . Don't do anything in NativeViewHostGtk if asked to remove and there is no native view. . Make NativeViewHostGtk deal with the native view already having the same parent. . Implement a couple of methods in NativeTabContentsContainerGtk. BUG=none TEST=none Review URL: http://codereview.chromium.org/115989 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17349 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/views/tab_contents/native_tab_contents_container_gtk.cc16
-rw-r--r--chrome/browser/views/tabs/dragged_tab_controller.cc2
2 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/views/tab_contents/native_tab_contents_container_gtk.cc b/chrome/browser/views/tab_contents/native_tab_contents_container_gtk.cc
index 9ca9b8c..c56d062 100644
--- a/chrome/browser/views/tab_contents/native_tab_contents_container_gtk.cc
+++ b/chrome/browser/views/tab_contents/native_tab_contents_container_gtk.cc
@@ -39,6 +39,8 @@ void NativeTabContentsContainerGtk::AttachContents(TabContents* contents) {
HWND contents_hwnd = contents->GetContentNativeView();
if (contents_hwnd)
views::FocusManager::InstallFocusSubclass(contents_hwnd, this);
+#else
+ NOTIMPLEMENTED();
#endif
}
@@ -64,6 +66,8 @@ void NativeTabContentsContainerGtk::DetachContents(TabContents* contents) {
// displaying the sad tab for example.
views::FocusManager::UninstallFocusSubclass(hwnd);
}
+#else
+ gtk_widget_hide(contents->GetNativeView());
#endif
// Now detach the TabContents.
@@ -94,6 +98,13 @@ void NativeTabContentsContainerGtk::RenderViewHostChanged(
GetRootView()->GetWidget()->GetNativeView());
if (focus_manager->GetFocusedView() == this)
Focus();
+#else
+ // If we are focused, we need to pass the focus to the new RenderViewHost.
+ // TODO: uncomment this once FocusManager has been ported.
+ // views::FocusManager* focus_manager = views::FocusManager::GetFocusManager(
+ // GetRootView()->GetWidget()->GetNativeView());
+ // if (focus_manager->GetFocusedView() == this)
+ // Focus();
#endif
}
@@ -133,10 +144,7 @@ void NativeTabContentsContainerGtk::Focus() {
container_->tab_contents()->interstitial_page()->Focus();
return;
}
- // TODO(port): set focus to inner content widget.
-#if defined(OS_WIN)
- SetFocus(container_->tab_contents()->GetContentNativeView());
-#endif
+ gtk_widget_grab_focus(container_->tab_contents()->GetContentNativeView());
}
}
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc
index fb60b78..6f97a9c 100644
--- a/chrome/browser/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/views/tabs/dragged_tab_controller.cc
@@ -1076,7 +1076,7 @@ gfx::Point DraggedTabController::GetCursorScreenPoint() const {
return gfx::Point(pt);
#else
gint x, y;
- gdk_display_get_pointer(NULL, NULL, &x, &y, NULL);
+ gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, &y, NULL);
return gfx::Point(x, y);
#endif
}