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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 12218029: Attach ImeAdapter as soon as native side is ready (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.ActivityManager; 8 import android.app.ActivityManager;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.pm.ActivityInfo; 10 import android.content.pm.ActivityInfo;
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 return mContainerViewInternals.super_dispatchKeyEventPreIme(event); 1424 return mContainerViewInternals.super_dispatchKeyEventPreIme(event);
1425 } finally { 1425 } finally {
1426 TraceEvent.end(); 1426 TraceEvent.end();
1427 } 1427 }
1428 } 1428 }
1429 1429
1430 /** 1430 /**
1431 * @see View#dispatchKeyEvent(KeyEvent) 1431 * @see View#dispatchKeyEvent(KeyEvent)
1432 */ 1432 */
1433 public boolean dispatchKeyEvent(KeyEvent event) { 1433 public boolean dispatchKeyEvent(KeyEvent event) {
1434 if (mImeAdapter != null &&
1435 !mImeAdapter.isNativeImeAdapterAttached() && mNativeContentViewC ore != 0) {
1436 mImeAdapter.attach(nativeGetNativeImeAdapter(mNativeContentViewCore) );
1437 }
1438
1439 if (getContentViewClient().shouldOverrideKeyEvent(event)) { 1434 if (getContentViewClient().shouldOverrideKeyEvent(event)) {
1440 return mContainerViewInternals.super_dispatchKeyEvent(event); 1435 return mContainerViewInternals.super_dispatchKeyEvent(event);
1441 } 1436 }
1442 1437
1443 if (mKeyboardConnected && mImeAdapter.dispatchKeyEvent(event)) return tr ue; 1438 if (mKeyboardConnected && mImeAdapter.dispatchKeyEvent(event)) return tr ue;
1444 1439
1445 return mContainerViewInternals.super_dispatchKeyEvent(event); 1440 return mContainerViewInternals.super_dispatchKeyEvent(event);
1446 } 1441 }
1447 1442
1448 /** 1443 /**
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 if (mAttachedToWindow && oldPid != newPid) { 2060 if (mAttachedToWindow && oldPid != newPid) {
2066 if (oldPid > 0) { 2061 if (oldPid > 0) {
2067 SandboxedProcessLauncher.unbindAsHighPriority(oldPid); 2062 SandboxedProcessLauncher.unbindAsHighPriority(oldPid);
2068 } 2063 }
2069 if (newPid > 0) { 2064 if (newPid > 0) {
2070 SandboxedProcessLauncher.bindAsHighPriority(newPid); 2065 SandboxedProcessLauncher.bindAsHighPriority(newPid);
2071 } 2066 }
2072 } 2067 }
2073 } 2068 }
2074 2069
2070 @SuppressWarnings("unused")
2071 @CalledByNative
2072 private void onWebContentsConnected() {
2073 if (mImeAdapter != null &&
2074 !mImeAdapter.isNativeImeAdapterAttached() && mNativeContentViewC ore != 0) {
2075 mImeAdapter.attach(nativeGetNativeImeAdapter(mNativeContentViewCore) );
2076 }
2077 }
2078
2075 /** 2079 /**
2076 * @return Whether a reload happens when this ContentView is activated. 2080 * @return Whether a reload happens when this ContentView is activated.
2077 */ 2081 */
2078 public boolean needsReload() { 2082 public boolean needsReload() {
2079 return mNativeContentViewCore != 0 && nativeNeedsReload(mNativeContentVi ewCore); 2083 return mNativeContentViewCore != 0 && nativeNeedsReload(mNativeContentVi ewCore);
2080 } 2084 }
2081 2085
2082 /** 2086 /**
2083 * @see View#hasFocus() 2087 * @see View#hasFocus()
2084 */ 2088 */
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2602 2606
2603 private native boolean nativePopulateBitmapFromCompositor(int nativeContentV iewCoreImpl, 2607 private native boolean nativePopulateBitmapFromCompositor(int nativeContentV iewCoreImpl,
2604 Bitmap bitmap); 2608 Bitmap bitmap);
2605 2609
2606 private native void nativeSetSize(int nativeContentViewCoreImpl, int width, int height); 2610 private native void nativeSetSize(int nativeContentViewCoreImpl, int width, int height);
2607 2611
2608 private native boolean nativeIsRenderWidgetHostViewReady(int nativeContentVi ewCoreImpl); 2612 private native boolean nativeIsRenderWidgetHostViewReady(int nativeContentVi ewCoreImpl);
2609 2613
2610 private native void nativeExitFullscreen(int nativeContentViewCoreImpl); 2614 private native void nativeExitFullscreen(int nativeContentViewCoreImpl);
2611 } 2615 }
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698