This source file includes following definitions.
- onUpdateTitle
- onBackgroundColorChanged
- onOffsetsForFullscreenChanged
- shouldOverrideKeyEvent
- onImeEvent
- onImeStateChangeRequested
- getSelectActionModeCallback
- onContextualActionBarShown
- onContextualActionBarHidden
- performWebSearch
- doesPerformWebSearch
- onSelectionChanged
- onStartContentIntent
- getContentVideoViewClient
- shouldBlockMediaRequest
package org.chromium.content.browser;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.ActionMode;
import android.view.KeyEvent;
import org.chromium.content.browser.SelectActionModeCallback.ActionHandler;
import java.net.URISyntaxException;
public class ContentViewClient {
private static final String TAG = "ContentViewClient";
public void onUpdateTitle(String title) {
}
public void onBackgroundColorChanged(int color) {
}
public void onOffsetsForFullscreenChanged(
float topControlsOffsetYPix, float contentOffsetYPix, float overdrawBottomHeightPix) {
}
public boolean shouldOverrideKeyEvent(KeyEvent event) {
int keyCode = event.getKeyCode();
if (keyCode == KeyEvent.KEYCODE_MENU ||
keyCode == KeyEvent.KEYCODE_HOME ||
keyCode == KeyEvent.KEYCODE_BACK ||
keyCode == KeyEvent.KEYCODE_CALL ||
keyCode == KeyEvent.KEYCODE_ENDCALL ||
keyCode == KeyEvent.KEYCODE_POWER ||
keyCode == KeyEvent.KEYCODE_HEADSETHOOK ||
keyCode == KeyEvent.KEYCODE_CAMERA ||
keyCode == KeyEvent.KEYCODE_FOCUS ||
keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||
keyCode == KeyEvent.KEYCODE_VOLUME_MUTE ||
keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
return true;
}
if (event.isCtrlPressed() && (
keyCode == KeyEvent.KEYCODE_TAB ||
keyCode == KeyEvent.KEYCODE_W ||
keyCode == KeyEvent.KEYCODE_F4)) {
return true;
}
return false;
}
public void onImeEvent() {
}
public void onImeStateChangeRequested(boolean requestShow) {
}
public ActionMode.Callback getSelectActionModeCallback(
Context context, ActionHandler actionHandler, boolean incognito) {
return new SelectActionModeCallback(context, actionHandler, incognito);
}
public void onContextualActionBarShown() {
}
public void onContextualActionBarHidden() {
}
public void performWebSearch(String searchQuery) {
}
public boolean doesPerformWebSearch() {
return false;
}
public void onSelectionChanged(String selection) {
}
public void onStartContentIntent(Context context, String intentUrl) {
Intent intent;
try {
intent = Intent.parseUri(intentUrl, Intent.URI_INTENT_SCHEME);
} catch (URISyntaxException ex) {
Log.w(TAG, "Bad URI " + intentUrl + ": " + ex.getMessage());
return;
}
try {
context.startActivity(intent);
} catch (ActivityNotFoundException ex) {
Log.w(TAG, "No application can handle " + intentUrl);
}
}
public ContentVideoViewClient getContentVideoViewClient() {
return null;
}
public boolean shouldBlockMediaRequest(String url) {
return false;
}
}