Commit 2aa76fb2 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Remove dead methods from DomDistillerServiceAndroid

HasEntry and GetUrlForEntry were already removed from the native
DomDistillerService, and only had stub impls in ..Android.

Bug: 1007942
Change-Id: I6793ae036671c7e648c19300181d574944363938
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857320
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Auto-Submit: Marc Treib <treib@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705594}
parent 489eed73
...@@ -19,7 +19,6 @@ import org.chromium.chrome.R; ...@@ -19,7 +19,6 @@ import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior;
import org.chromium.chrome.browser.dom_distiller.DomDistillerServiceFactory;
import org.chromium.chrome.browser.dom_distiller.DomDistillerTabUtils; import org.chromium.chrome.browser.dom_distiller.DomDistillerTabUtils;
import org.chromium.chrome.browser.native_page.NativePageFactory; import org.chromium.chrome.browser.native_page.NativePageFactory;
import org.chromium.chrome.browser.ntp.NewTabPage; import org.chromium.chrome.browser.ntp.NewTabPage;
...@@ -34,7 +33,6 @@ import org.chromium.chrome.browser.tab.TrustedCdn; ...@@ -34,7 +33,6 @@ import org.chromium.chrome.browser.tab.TrustedCdn;
import org.chromium.chrome.browser.util.ColorUtils; import org.chromium.chrome.browser.util.ColorUtils;
import org.chromium.chrome.browser.util.UrlConstants; import org.chromium.chrome.browser.util.UrlConstants;
import org.chromium.chrome.browser.util.UrlUtilities; import org.chromium.chrome.browser.util.UrlUtilities;
import org.chromium.components.dom_distiller.core.DomDistillerService;
import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils;
import org.chromium.components.security_state.ConnectionSecurityLevel; import org.chromium.components.security_state.ConnectionSecurityLevel;
import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.WebContents;
...@@ -148,16 +146,6 @@ public class LocationBarModel implements ToolbarDataProvider, ToolbarCommonPrope ...@@ -148,16 +146,6 @@ public class LocationBarModel implements ToolbarDataProvider, ToolbarCommonPrope
if (mTab.isFrozen()) return buildUrlBarData(url, formattedUrl); if (mTab.isFrozen()) return buildUrlBarData(url, formattedUrl);
if (DomDistillerUrlUtils.isDistilledPage(url)) { if (DomDistillerUrlUtils.isDistilledPage(url)) {
DomDistillerService domDistillerService =
DomDistillerServiceFactory.getForProfile(getProfile());
String entryIdFromUrl = DomDistillerUrlUtils.getValueForKeyInUrl(url, "entry_id");
if (!TextUtils.isEmpty(entryIdFromUrl)
&& domDistillerService.hasEntry(entryIdFromUrl)) {
String originalUrl = domDistillerService.getUrlForEntry(entryIdFromUrl);
return buildUrlBarData(
DomDistillerTabUtils.getFormattedUrlFromOriginalDistillerUrl(originalUrl));
}
String originalUrl = DomDistillerUrlUtils.getOriginalUrlFromDistillerUrl(url); String originalUrl = DomDistillerUrlUtils.getOriginalUrlFromDistillerUrl(url);
if (originalUrl != null) { if (originalUrl != null) {
return buildUrlBarData( return buildUrlBarData(
......
...@@ -15,29 +15,18 @@ import org.chromium.base.annotations.NativeMethods; ...@@ -15,29 +15,18 @@ import org.chromium.base.annotations.NativeMethods;
@JNINamespace("dom_distiller::android") @JNINamespace("dom_distiller::android")
public final class DomDistillerService { public final class DomDistillerService {
private final long mDomDistillerServiceAndroid;
private final DistilledPagePrefs mDistilledPagePrefs; private final DistilledPagePrefs mDistilledPagePrefs;
private DomDistillerService(long nativeDomDistillerAndroidServicePtr) { private DomDistillerService(long nativeDomDistillerAndroidServicePtr) {
mDomDistillerServiceAndroid = nativeDomDistillerAndroidServicePtr; mDistilledPagePrefs =
mDistilledPagePrefs = new DistilledPagePrefs( new DistilledPagePrefs(DomDistillerServiceJni.get().getDistilledPagePrefsPtr(
DomDistillerServiceJni.get().getDistilledPagePrefsPtr(mDomDistillerServiceAndroid)); nativeDomDistillerAndroidServicePtr));
} }
public DistilledPagePrefs getDistilledPagePrefs() { public DistilledPagePrefs getDistilledPagePrefs() {
return mDistilledPagePrefs; return mDistilledPagePrefs;
} }
public boolean hasEntry(String entryId) {
return DomDistillerServiceJni.get().hasEntry(
mDomDistillerServiceAndroid, DomDistillerService.this, entryId);
}
public String getUrlForEntry(String entryId) {
return DomDistillerServiceJni.get().getUrlForEntry(
mDomDistillerServiceAndroid, DomDistillerService.this, entryId);
}
@CalledByNative @CalledByNative
private static DomDistillerService create(long nativeDomDistillerServiceAndroid) { private static DomDistillerService create(long nativeDomDistillerServiceAndroid) {
ThreadUtils.assertOnUiThread(); ThreadUtils.assertOnUiThread();
...@@ -46,10 +35,6 @@ public final class DomDistillerService { ...@@ -46,10 +35,6 @@ public final class DomDistillerService {
@NativeMethods @NativeMethods
interface Natives { interface Natives {
boolean hasEntry(
long nativeDomDistillerServiceAndroid, DomDistillerService caller, String entryId);
String getUrlForEntry(
long nativeDomDistillerServiceAndroid, DomDistillerService caller, String entryId);
long getDistilledPagePrefsPtr(long nativeDomDistillerServiceAndroid); long getDistilledPagePrefsPtr(long nativeDomDistillerServiceAndroid);
} }
} }
...@@ -30,20 +30,6 @@ DomDistillerServiceAndroid::DomDistillerServiceAndroid( ...@@ -30,20 +30,6 @@ DomDistillerServiceAndroid::DomDistillerServiceAndroid(
DomDistillerServiceAndroid::~DomDistillerServiceAndroid() {} DomDistillerServiceAndroid::~DomDistillerServiceAndroid() {}
bool DomDistillerServiceAndroid::HasEntry(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
const JavaParamRef<jstring>& j_entry_id) {
return false;
}
ScopedJavaLocalRef<jstring> DomDistillerServiceAndroid::GetUrlForEntry(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
const JavaParamRef<jstring>& j_entry_id) {
return ConvertUTF8ToJavaString(env, std::string());
}
jlong DomDistillerServiceAndroid::GetDistilledPagePrefsPtr(JNIEnv* env) { jlong DomDistillerServiceAndroid::GetDistilledPagePrefsPtr(JNIEnv* env) {
return reinterpret_cast<intptr_t>(service_->GetDistilledPagePrefs()); return reinterpret_cast<intptr_t>(service_->GetDistilledPagePrefs());
} }
......
...@@ -24,15 +24,6 @@ class DomDistillerServiceAndroid { ...@@ -24,15 +24,6 @@ class DomDistillerServiceAndroid {
// Returns native pointer to native DistilledPagePrefs registered with // Returns native pointer to native DistilledPagePrefs registered with
// DomDistillerService. // DomDistillerService.
jlong GetDistilledPagePrefsPtr(JNIEnv* env); jlong GetDistilledPagePrefsPtr(JNIEnv* env);
// TODO(crbug.com/1007942): Remove HasEntry and GetUrlForEntry, they always
// return false / empty string.
bool HasEntry(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jstring>& entry_id);
base::android::ScopedJavaLocalRef<jstring> GetUrlForEntry(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jstring>& entry_id);
private: private:
// Friend class so that DomDistillerServiceFactoryAndroid has access to // Friend class so that DomDistillerServiceFactoryAndroid has access to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment