diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 17:40:13 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 17:40:13 +0000 |
commit | cec6c9c550f44741c7acacfd5d3f67e919110c4c (patch) | |
tree | f6778f4a10b1aa5b0a7b74526c632377214703b1 /views/widget/widget_gtk.cc | |
parent | 210796e7c8207e56dae29392b62e1e79ec9f837f (diff) | |
download | chromium_src-cec6c9c550f44741c7acacfd5d3f67e919110c4c.zip chromium_src-cec6c9c550f44741c7acacfd5d3f67e919110c4c.tar.gz chromium_src-cec6c9c550f44741c7acacfd5d3f67e919110c4c.tar.bz2 |
See original review at
http://codereview.chromium.org/251001/show
This CL hooks the focus traversal for the TabbedPaneView on Linux with toolkit views.
It also has few focus related fixed (focus with buttons, clearing focus effectively in the focus manager).
BUG=None
TEST=Run the view_examples app. Press tab to move the focus. Try the different tabs.
Review URL: http://codereview.chromium.org/246030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27504 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/widget_gtk.cc')
-rw-r--r-- | views/widget/widget_gtk.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 81c214d..fb50103 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -490,6 +490,43 @@ void WidgetGtk::DidProcessEvent(GdkEvent* event) { } //////////////////////////////////////////////////////////////////////////////// +// FocusTraversable + +View* WidgetGtk::FindNextFocusableView( + View* starting_view, bool reverse, Direction direction, + bool check_starting_view, FocusTraversable** focus_traversable, + View** focus_traversable_view) { + return root_view_->FindNextFocusableView(starting_view, + reverse, + direction, + check_starting_view, + focus_traversable, + focus_traversable_view); +} + +FocusTraversable* WidgetGtk::GetFocusTraversableParent() { + // We are a proxy to the root view, so we should be bypassed when traversing + // up and as a result this should not be called. + NOTREACHED(); + return NULL; +} + +void WidgetGtk::SetFocusTraversableParent(FocusTraversable* parent) { + root_view_->SetFocusTraversableParent(parent); +} + +View* WidgetGtk::GetFocusTraversableParentView() { + // We are a proxy to the root view, so we should be bypassed when traversing + // up and as a result this should not be called. + NOTREACHED(); + return NULL; +} + +void WidgetGtk::SetFocusTraversableParentView(View* parent_view) { + root_view_->SetFocusTraversableParentView(parent_view); +} + +//////////////////////////////////////////////////////////////////////////////// // TODO(beng): organize into sections: void WidgetGtk::CreateGtkWidget(GtkWidget* parent, const gfx::Rect& bounds) { @@ -543,6 +580,7 @@ void WidgetGtk::CreateGtkWidget(GtkWidget* parent, const gfx::Rect& bounds) { if (transparent_) ConfigureWidgetForTransparentBackground(); } + // The widget needs to be realized before handlers like size-allocate can // function properly. gtk_widget_realize(widget_); |