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

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

Issue 442433002: Not allowing user to type more chars than max length value for text field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: few nits resolved 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 java_ime_adapter_ = JavaObjectWeakGlobalRef(env, java_object); 240 java_ime_adapter_ = JavaObjectWeakGlobalRef(env, java_object);
241 } 241 }
242 242
243 void ImeAdapterAndroid::CancelComposition() { 243 void ImeAdapterAndroid::CancelComposition() {
244 base::android::ScopedJavaLocalRef<jobject> obj = 244 base::android::ScopedJavaLocalRef<jobject> obj =
245 java_ime_adapter_.get(AttachCurrentThread()); 245 java_ime_adapter_.get(AttachCurrentThread());
246 if (!obj.is_null()) 246 if (!obj.is_null())
247 Java_ImeAdapter_cancelComposition(AttachCurrentThread(), obj.obj()); 247 Java_ImeAdapter_cancelComposition(AttachCurrentThread(), obj.obj());
248 } 248 }
249 249
250 void ImeAdapterAndroid::FocusedNodeChanged(bool is_editable_node) { 250 void ImeAdapterAndroid::FocusedNodeChanged(bool is_editable_node,
251 int editable_node_max_length) {
251 base::android::ScopedJavaLocalRef<jobject> obj = 252 base::android::ScopedJavaLocalRef<jobject> obj =
252 java_ime_adapter_.get(AttachCurrentThread()); 253 java_ime_adapter_.get(AttachCurrentThread());
253 if (!obj.is_null()) { 254 if (!obj.is_null()) {
254 Java_ImeAdapter_focusedNodeChanged(AttachCurrentThread(), 255 Java_ImeAdapter_focusedNodeChanged(AttachCurrentThread(),
255 obj.obj(), 256 obj.obj(),
256 is_editable_node); 257 is_editable_node,
258 editable_node_max_length);
257 } 259 }
258 } 260 }
259 261
260 void ImeAdapterAndroid::SetEditableSelectionOffsets(JNIEnv*, jobject, 262 void ImeAdapterAndroid::SetEditableSelectionOffsets(JNIEnv*, jobject,
261 int start, int end) { 263 int start, int end) {
262 RenderFrameHost* rfh = GetFocusedFrame(); 264 RenderFrameHost* rfh = GetFocusedFrame();
263 if (!rfh) 265 if (!rfh)
264 return; 266 return;
265 267
266 rfh->Send(new FrameMsg_SetEditableSelectionOffsets(rfh->GetRoutingID(), 268 rfh->Send(new FrameMsg_SetEditableSelectionOffsets(rfh->GetRoutingID(),
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 WebContents* ImeAdapterAndroid::GetWebContents() { 353 WebContents* ImeAdapterAndroid::GetWebContents() {
352 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 354 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
353 if (!rwh) 355 if (!rwh)
354 return NULL; 356 return NULL;
355 if (!rwh->IsRenderView()) 357 if (!rwh->IsRenderView())
356 return NULL; 358 return NULL;
357 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 359 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
358 } 360 }
359 361
360 } // namespace content 362 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/ime_adapter_android.h ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698