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

Unified Diff: views/controls/native/native_view_host_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/native_view_host_gtk.h ('k') | views/controls/native/native_view_host_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/native/native_view_host_gtk.cc
===================================================================
--- views/controls/native/native_view_host_gtk.cc (revision 27114)
+++ views/controls/native/native_view_host_gtk.cc (working copy)
@@ -48,7 +48,7 @@
}
if (!focus_signal_id_) {
- focus_signal_id_ = g_signal_connect(G_OBJECT(host_->focus_native_view()),
+ focus_signal_id_ = g_signal_connect(G_OBJECT(host_->native_view()),
"focus-in-event",
G_CALLBACK(CallFocusIn), this);
}
@@ -70,7 +70,7 @@
destroy_signal_id_);
destroy_signal_id_ = 0;
- g_signal_handler_disconnect(G_OBJECT(host_->focus_native_view()),
+ g_signal_handler_disconnect(G_OBJECT(host_->native_view()),
focus_signal_id_);
focus_signal_id_ = 0;
@@ -164,6 +164,11 @@
gtk_widget_hide(fixed_);
}
+void NativeViewHostGtk::SetFocus() {
+ DCHECK(host_->native_view());
+ gtk_widget_grab_focus(host_->native_view());
+}
+
////////////////////////////////////////////////////////////////////////////////
// NativeViewHostGtk, private:
@@ -210,11 +215,19 @@
}
// static
-gboolean NativeViewHostGtk::CallFocusIn(GtkWidget* widget,
- GdkEventFocus* event,
- NativeViewHostGtk* host) {
- host->host_->GotNativeFocus();
- return false;
+void NativeViewHostGtk::CallFocusIn(GtkWidget* widget,
+ GdkEventFocus* event,
+ NativeViewHostGtk* host) {
+ 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(host->host_->focus_view());
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « views/controls/native/native_view_host_gtk.h ('k') | views/controls/native/native_view_host_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698