Skip to content

Commit

Permalink
WebView: suppress deprecation warnings
Browse files Browse the repository at this point in the history
supress deprecation warnings on ZoomButtonsController and
WebIconDatabase

BUG=755922

Change-Id: I7b0f6769127b45245652afcd53615d2f2fcde985
Reviewed-on: https://chromium-review.googlesource.com/682997
Reviewed-by: Paul Miller <paulmiller@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: James Wallace-Lee <jamwalla@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504192}
  • Loading branch information
James Wallace-Lee authored and Commit Bot committed Sep 25, 2017
1 parent b02c0a2 commit 3b09d5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
package com.android.webview.chromium;

import android.content.ContentResolver;
import android.webkit.WebIconDatabase;
import android.webkit.WebIconDatabase.IconListener;

import org.chromium.android_webview.AwContents;

/**
* Chromium implementation of WebIconDatabase -- big old no-op (base class is deprecated).
*/
@SuppressWarnings("deprecation")
final class WebIconDatabaseAdapter extends WebIconDatabase {
final class WebIconDatabaseAdapter extends android.webkit.WebIconDatabase {
@Override
public void open(String path) {
AwContents.setShouldDownloadFavicons();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,37 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ZoomButtonsController;

class AwZoomControls {

private AwContents mAwContents;
// It is advised to use getZoomController() where possible.
private ZoomButtonsController mZoomButtonsController;
@SuppressWarnings("deprecation")
private android.widget.ZoomButtonsController mZoomButtonsController;

AwZoomControls(AwContents awContents) {
mAwContents = awContents;
}

@SuppressWarnings("deprecation")
public void invokeZoomPicker() {
ZoomButtonsController zoomController = getZoomController();
android.widget.ZoomButtonsController zoomController = getZoomController();
if (zoomController != null) {
zoomController.setVisible(true);
}
}

@SuppressWarnings("deprecation")
public void dismissZoomPicker() {
ZoomButtonsController zoomController = getZoomController();
android.widget.ZoomButtonsController zoomController = getZoomController();
if (zoomController != null) {
zoomController.setVisible(false);
}
}

@SuppressWarnings("deprecation")
public void updateZoomControls() {
ZoomButtonsController zoomController = getZoomController();
android.widget.ZoomButtonsController zoomController = getZoomController();
if (zoomController == null) {
return;
}
Expand All @@ -58,10 +61,11 @@ View getZoomControlsViewForTest() {
}

@SuppressLint("RtlHardcoded")
private ZoomButtonsController getZoomController() {
@SuppressWarnings("deprecation")
private android.widget.ZoomButtonsController getZoomController() {
if (mZoomButtonsController == null
&& mAwContents.getSettings().shouldDisplayZoomControls()) {
mZoomButtonsController = new ZoomButtonsController(
mZoomButtonsController = new android.widget.ZoomButtonsController(
mAwContents.getContentViewCore().getContainerView());
mZoomButtonsController.setOnZoomListener(new ZoomListener());
// ZoomButtonsController positions the buttons at the bottom, but in
Expand All @@ -76,7 +80,8 @@ private ZoomButtonsController getZoomController() {
return mZoomButtonsController;
}

private class ZoomListener implements ZoomButtonsController.OnZoomListener {
@SuppressWarnings("deprecation")
private class ZoomListener implements android.widget.ZoomButtonsController.OnZoomListener {
@Override
public void onVisibilityChanged(boolean visible) {
if (visible) {
Expand Down

0 comments on commit 3b09d5a

Please sign in to comment.