| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.android_webview; | 5 package org.chromium.android_webview; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.Intent; | |
| 9 import android.view.KeyEvent; | 8 import android.view.KeyEvent; |
| 10 | 9 |
| 11 import org.chromium.content.browser.ContentViewClient; | 10 import org.chromium.content.browser.ContentViewClient; |
| 12 | 11 |
| 13 /** | 12 /** |
| 14 * ContentViewClient implementation for WebView | 13 * ContentViewClient implementation for WebView |
| 15 */ | 14 */ |
| 16 public class AwContentViewClient extends ContentViewClient { | 15 public class AwContentViewClient extends ContentViewClient { |
| 17 private final AwContentsClient mAwContentsClient; | 16 private final AwContentsClient mAwContentsClient; |
| 18 private final AwSettings mAwSettings; | 17 private final AwSettings mAwSettings; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 48 public boolean shouldOverrideKeyEvent(KeyEvent event) { | 47 public boolean shouldOverrideKeyEvent(KeyEvent event) { |
| 49 if (mAwContentsClient.hasWebViewClient()) { | 48 if (mAwContentsClient.hasWebViewClient()) { |
| 50 // The check below is reflecting Chrome's behavior and is a workarou
nd for | 49 // The check below is reflecting Chrome's behavior and is a workarou
nd for |
| 51 // http://b/7697782. | 50 // http://b/7697782. |
| 52 if (!ContentViewClient.shouldPropagateKey(event.getKeyCode())) retur
n true; | 51 if (!ContentViewClient.shouldPropagateKey(event.getKeyCode())) retur
n true; |
| 53 return mAwContentsClient.shouldOverrideKeyEvent(event); | 52 return mAwContentsClient.shouldOverrideKeyEvent(event); |
| 54 } | 53 } |
| 55 | 54 |
| 56 return super.shouldOverrideKeyEvent(event); | 55 return super.shouldOverrideKeyEvent(event); |
| 57 } | 56 } |
| 58 | |
| 59 @Override | |
| 60 public boolean doesPerformProcessText() { | |
| 61 return true; | |
| 62 } | |
| 63 | |
| 64 @Override | |
| 65 public void startProcessTextIntent(Intent intent) { | |
| 66 mAwContents.startProcessTextIntent(intent); | |
| 67 } | |
| 68 | |
| 69 @Override | |
| 70 public boolean isSelectActionModeAllowed(int actionModeItem) { | |
| 71 return mAwContents.isSelectActionModeAllowed(actionModeItem); | |
| 72 } | |
| 73 } | 57 } |
| OLD | NEW |