summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-12 17:59:09 +0000
committersuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-12 17:59:09 +0000
commita93c437038ea156163901d4962f1881c98a55bd1 (patch)
treeb800afd8f80e42606f493030ce18d7a42a9b4b72 /views
parent21e5541bdb7bbf7de3acca55640f623036684ed3 (diff)
downloadchromium_src-a93c437038ea156163901d4962f1881c98a55bd1.zip
chromium_src-a93c437038ea156163901d4962f1881c98a55bd1.tar.gz
chromium_src-a93c437038ea156163901d4962f1881c98a55bd1.tar.bz2
[Linux Views] Handle focus in event of native views and controls correctly.
BUG=http://crosbug.com/1800 TEST=Build chromium with toolkit_views=1, and run it with ibus input method, then try if the input method can be enabled inside find bar. Review URL: http://codereview.chromium.org/1547027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44260 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/native/native_view_host_gtk.cc11
-rw-r--r--views/controls/native/native_view_host_gtk.h8
-rw-r--r--views/controls/native_control_gtk.cc15
-rw-r--r--views/controls/native_control_gtk.h12
4 files changed, 24 insertions, 22 deletions
diff --git a/views/controls/native/native_view_host_gtk.cc b/views/controls/native/native_view_host_gtk.cc
index 8708238..533683e 100644
--- a/views/controls/native/native_view_host_gtk.cc
+++ b/views/controls/native/native_view_host_gtk.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -338,9 +338,9 @@ void NativeViewHostGtk::CallDestroy(GtkObject* object,
}
// static
-void NativeViewHostGtk::CallFocusIn(GtkWidget* widget,
- GdkEventFocus* event,
- NativeViewHostGtk* host) {
+gboolean NativeViewHostGtk::CallFocusIn(GtkWidget* widget,
+ GdkEventFocus* event,
+ NativeViewHostGtk* host) {
FocusManager* focus_manager =
FocusManager::GetFocusManagerForNativeView(widget);
if (!focus_manager) {
@@ -348,9 +348,10 @@ void NativeViewHostGtk::CallFocusIn(GtkWidget* widget,
// options page is only based on views.
// NOTREACHED();
NOTIMPLEMENTED();
- return;
+ return false;
}
focus_manager->SetFocusedView(host->host_->focus_view());
+ return false;
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/views/controls/native/native_view_host_gtk.h b/views/controls/native/native_view_host_gtk.h
index b055098..4c7bb25 100644
--- a/views/controls/native/native_view_host_gtk.h
+++ b/views/controls/native/native_view_host_gtk.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -59,9 +59,9 @@ class NativeViewHostGtk : public NativeViewHostWrapper {
static void CallDestroy(GtkObject* object, NativeViewHostGtk* host);
// Invoked from the 'focus-in-event' signal.
- static void CallFocusIn(GtkWidget* widget,
- GdkEventFocus* event,
- NativeViewHostGtk* button);
+ static gboolean CallFocusIn(GtkWidget* widget,
+ GdkEventFocus* event,
+ NativeViewHostGtk* button);
// Our associated NativeViewHost.
NativeViewHost* host_;
diff --git a/views/controls/native_control_gtk.cc b/views/controls/native_control_gtk.cc
index 6857d48..3b0325c 100644
--- a/views/controls/native_control_gtk.cc
+++ b/views/controls/native_control_gtk.cc
@@ -1,6 +1,6 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
-// source code is governed by a BSD-style license that can be found in the
-// LICENSE file.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#include "views/controls/native_control_gtk.h"
@@ -80,9 +80,9 @@ void NativeControlGtk::NativeControlCreated(GtkWidget* native_control) {
}
// static
-void NativeControlGtk::CallFocusIn(GtkWidget* widget,
- GdkEventFocus* event,
- NativeControlGtk* control) {
+gboolean NativeControlGtk::CallFocusIn(GtkWidget* widget,
+ GdkEventFocus* event,
+ NativeControlGtk* control) {
FocusManager* focus_manager =
FocusManager::GetFocusManagerForNativeView(widget);
if (!focus_manager) {
@@ -90,9 +90,10 @@ void NativeControlGtk::CallFocusIn(GtkWidget* widget,
// options page is only based on views.
// NOTREACHED();
NOTIMPLEMENTED();
- return;
+ return false;
}
focus_manager->SetFocusedView(control->focus_view());
+ return false;
}
} // namespace views
diff --git a/views/controls/native_control_gtk.h b/views/controls/native_control_gtk.h
index ce2f187..ff54033 100644
--- a/views/controls/native_control_gtk.h
+++ b/views/controls/native_control_gtk.h
@@ -1,6 +1,6 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
-// source code is governed by a BSD-style license that can be found in the
-// LICENSE file.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#ifndef VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_
#define VIEWS_CONTROLS_NATIVE_CONTROL_GTK_H_
@@ -36,9 +36,9 @@ class NativeControlGtk : public NativeViewHost {
virtual void NativeControlCreated(GtkWidget* widget);
private:
- static void CallFocusIn(GtkWidget* widget,
- GdkEventFocus* event,
- NativeControlGtk* button);
+ static gboolean CallFocusIn(GtkWidget* widget,
+ GdkEventFocus* event,
+ NativeControlGtk* button);
DISALLOW_COPY_AND_ASSIGN(NativeControlGtk);
};