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

Side by Side Diff: content/browser/renderer_host/ime_adapter_android.cc

Issue 426063002: Fix keycode problems for modified keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed style issues Created 6 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/ime_adapter_android.h" 5 #include "content/browser/renderer_host/ime_adapter_android.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <android/input.h> 8 #include <android/input.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 base::android::ScopedJavaLocalRef<jobject> obj = java_ime_adapter_.get(env); 141 base::android::ScopedJavaLocalRef<jobject> obj = java_ime_adapter_.get(env);
142 if (!obj.is_null()) 142 if (!obj.is_null())
143 Java_ImeAdapter_detach(env, obj.obj()); 143 Java_ImeAdapter_detach(env, obj.obj());
144 } 144 }
145 145
146 bool ImeAdapterAndroid::SendSyntheticKeyEvent(JNIEnv*, 146 bool ImeAdapterAndroid::SendSyntheticKeyEvent(JNIEnv*,
147 jobject, 147 jobject,
148 int type, 148 int type,
149 long time_ms, 149 long time_ms,
150 int key_code, 150 int key_code,
151 int modifiers,
151 int text) { 152 int text) {
152 NativeWebKeyboardEvent event(static_cast<blink::WebInputEvent::Type>(type), 153 NativeWebKeyboardEvent event(static_cast<blink::WebInputEvent::Type>(type),
153 0 /* modifiers */, time_ms / 1000.0, key_code, 154 modifiers, time_ms / 1000.0, key_code,
154 text, false /* is_system_key */); 155 text, false /* is_system_key */);
155 rwhva_->SendKeyEvent(event); 156 rwhva_->SendKeyEvent(event);
156 return true; 157 return true;
157 } 158 }
158 159
159 bool ImeAdapterAndroid::SendKeyEvent(JNIEnv* env, jobject, 160 bool ImeAdapterAndroid::SendKeyEvent(JNIEnv* env, jobject,
160 jobject original_key_event, 161 jobject original_key_event,
161 int action, int modifiers, 162 int action, int modifiers,
162 long time_ms, int key_code, 163 long time_ms, int key_code,
163 bool is_system_key, int unicode_char) { 164 bool is_system_key, int unicode_char) {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 WebContents* ImeAdapterAndroid::GetWebContents() { 352 WebContents* ImeAdapterAndroid::GetWebContents() {
352 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 353 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
353 if (!rwh) 354 if (!rwh)
354 return NULL; 355 return NULL;
355 if (!rwh->IsRenderView()) 356 if (!rwh->IsRenderView())
356 return NULL; 357 return NULL;
357 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 358 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
358 } 359 }
359 360
360 } // namespace content 361 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698