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

Unified Diff: chrome/browser/ui/views/dropdown_bar_host_gtk.cc

Issue 5857002: no native implementation of Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 10 years 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/chromeos/login/screen_locker_tester.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/dropdown_bar_host_gtk.cc
diff --git a/chrome/browser/ui/views/dropdown_bar_host_gtk.cc b/chrome/browser/ui/views/dropdown_bar_host_gtk.cc
index 2a4e4befd896b3a66e2d7da003cf75e138c3464f..b321c30219e76f853df85c543c8edbd9950c4d06 100644
--- a/chrome/browser/ui/views/dropdown_bar_host_gtk.cc
+++ b/chrome/browser/ui/views/dropdown_bar_host_gtk.cc
@@ -11,6 +11,10 @@
#include "views/widget/widget_gtk.h"
#include "views/controls/textfield/textfield.h"
+#if defined(TOUCH_UI)
+#include "app/keyboard_code_conversion_gtk.h"
+#endif
+
views::Widget* DropdownBarHost::CreateHost() {
views::WidgetGtk* host = new views::WidgetGtk(views::WidgetGtk::TYPE_CHILD);
// We own the host.
@@ -27,5 +31,22 @@ void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos,
NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent(
const TabContents* contents,
const views::Textfield::Keystroke& key_stroke) {
+#if defined(TOUCH_UI)
+ // TODO(oshima): This is a copy from
+ // RenderWidgetHostViewViews::OnKeyPressed().
+ // Refactor and eliminate the dup code.
+ const views::KeyEvent& e = key_stroke.key_event();
+ NativeWebKeyboardEvent wke;
+ wke.type = WebKit::WebInputEvent::KeyDown;
+ wke.windowsKeyCode = e.GetKeyCode();
+ wke.setKeyIdentifierFromWindowsKeyCode();
+
+ wke.text[0] = wke.unmodifiedText[0] =
+ static_cast<unsigned short>(gdk_keyval_to_unicode(
+ app::GdkKeyCodeForWindowsKeyCode(e.GetKeyCode(),
+ e.IsShiftDown() ^ e.IsCapsLockDown())));
+ return wke;
+#else
return NativeWebKeyboardEvent(key_stroke.event());
+#endif
}
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker_tester.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698