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

Unified Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java

Issue 481803004: Removing ContentViewCore dependencies from few functions which acts as direct wrapper to WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review comments and rebased the patch. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java
diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java
index 195d56ae199062ae2697ba58165b0005e5ba287b..f6ff41e4e59bcf56bcff80cd8af0edcf5642f0ea 100644
--- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java
+++ b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java
@@ -13,9 +13,10 @@ import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator;
import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator;
import org.chromium.chrome.browser.infobar.AutoLoginProcessor;
import org.chromium.content.browser.ContentViewClient;
-import org.chromium.content.browser.ContentViewCore;
import org.chromium.content_public.Referrer;
import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.content_public.browser.NavigationController;
+import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.base.WindowAndroid;
/**
@@ -62,14 +63,15 @@ public class ChromeShellTab extends Tab {
// Invalid URLs will just return empty.
if (TextUtils.isEmpty(url)) return;
- ContentViewCore contentViewCore = getContentViewCore();
- if (TextUtils.equals(url, contentViewCore.getUrl())) {
- contentViewCore.reload(true);
+ WebContents webContents = getWebContents();
+ NavigationController navigationController = webContents.getNavigationController();
+ if (TextUtils.equals(url, webContents.getUrl())) {
+ navigationController.reload(true);
} else {
if (postData == null) {
- contentViewCore.loadUrl(new LoadUrlParams(url));
+ navigationController.loadUrl(new LoadUrlParams(url));
} else {
- contentViewCore.loadUrl(LoadUrlParams.createLoadHttpPostParams(url, postData));
+ navigationController.loadUrl(LoadUrlParams.createLoadHttpPostParams(url, postData));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698