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

Unified Diff: chrome/browser/views/tab_contents/tab_contents_view_gtk.cc

Issue 1594003: A patch to fix a couple of issues in interactive_ui_tests on ChromeOS (Closed)
Patch Set: Created 10 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/tab_contents/native_tab_contents_container_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
diff --git a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
index e302838f855ba08050086f025e6c700f5ddb9769..b8d29078eda9fa90df079a7bb698c05876d03451 100644
--- a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
@@ -326,10 +326,16 @@ void TabContentsViewGtk::GotFocus() {
}
void TabContentsViewGtk::TakeFocus(bool reverse) {
- // This is called when we the renderer asks us to take focus back (i.e., it
- // has iterated past the last focusable element on the page).
- gtk_widget_child_focus(GTK_WIDGET(GetTopLevelNativeWindow()),
- reverse ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD);
+ if (!tab_contents()->delegate()->TakeFocus(reverse)) {
+
+ views::FocusManager* focus_manager =
+ views::FocusManager::GetFocusManagerForNativeView(GetNativeView());
+
+ // We may not have a focus manager if the tab has been switched before this
+ // message arrived.
+ if (focus_manager)
+ focus_manager->AdvanceFocus(reverse);
+ }
}
void TabContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) {
« no previous file with comments | « chrome/browser/views/tab_contents/native_tab_contents_container_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698