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

Unified Diff: views/controls/native_control_gtk.cc

Issue 231022: Reverting 27113. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | « views/controls/native_control_gtk.h ('k') | views/controls/native_control_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/native_control_gtk.cc
===================================================================
--- views/controls/native_control_gtk.cc (revision 27114)
+++ views/controls/native_control_gtk.cc (working copy)
@@ -63,6 +63,26 @@
// Update the newly created GtkWdigetwith any resident enabled state.
gtk_widget_set_sensitive(native_view(), IsEnabled());
+
+ // Listen for focus change event to update the FocusManager focused view.
+ g_signal_connect(G_OBJECT(native_control), "focus-in-event",
+ G_CALLBACK(CallFocusIn), this);
}
+// static
+void NativeControlGtk::CallFocusIn(GtkWidget* widget,
+ GdkEventFocus* event,
+ NativeControlGtk* control) {
+ FocusManager* focus_manager =
+ FocusManager::GetFocusManagerForNativeView(widget);
+ if (!focus_manager) {
+ // TODO(jcampan): http://crbug.com/21378 Reenable this NOTREACHED() when the
+ // options page is only based on views.
+ // NOTREACHED();
+ NOTIMPLEMENTED();
+ return;
+ }
+ focus_manager->SetFocusedView(control->focus_view());
+}
+
} // namespace views
« no previous file with comments | « views/controls/native_control_gtk.h ('k') | views/controls/native_control_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698