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

Unified Diff: views/controls/native/native_view_host_gtk.cc

Issue 214029: Adding focus to NaviteViewHost. (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 27081)
+++ 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_->native_view()),
+ focus_signal_id_ = g_signal_connect(G_OBJECT(host_->focus_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_->native_view()),
+ g_signal_handler_disconnect(G_OBJECT(host_->focus_native_view()),
focus_signal_id_);
focus_signal_id_ = 0;
@@ -164,11 +164,6 @@
gtk_widget_hide(fixed_);
}
-void NativeViewHostGtk::SetFocus() {
- DCHECK(host_->native_view());
- gtk_widget_grab_focus(host_->native_view());
-}
-
////////////////////////////////////////////////////////////////////////////////
// NativeViewHostGtk, private:
@@ -215,19 +210,11 @@
}
// static
-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());
+gboolean NativeViewHostGtk::CallFocusIn(GtkWidget* widget,
+ GdkEventFocus* event,
+ NativeViewHostGtk* host) {
+ host->host_->GotNativeFocus();
+ return false;
}
////////////////////////////////////////////////////////////////////////////////
« 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