summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--android_webview/buildbot/aosp_manifest.xml2
-rw-r--r--android_webview/java/src/org/chromium/android_webview/AwContents.java6
-rw-r--r--android_webview/java_library_common.mk2
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java2
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java2
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/LoadUrlTest.java2
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java4
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/SaveRestoreStateTest.java2
-rw-r--r--android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java2
-rw-r--r--build/android/findbugs_filter/findbugs_known_bugs.txt2
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/NavigationPopup.java4
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/Tab.java4
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java2
-rw-r--r--chrome/android/javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java6
-rw-r--r--chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellTab.java2
-rw-r--r--chrome/browser/android/tab_android.cc5
-rw-r--r--content/browser/android/content_view_core_impl.cc187
-rw-r--r--content/browser/android/content_view_core_impl.h30
-rw-r--r--content/browser/frame_host/navigation_controller_android.cc191
-rw-r--r--content/browser/frame_host/navigation_controller_android.h29
-rw-r--r--content/content.gyp4
-rw-r--r--content/content_jni.gypi2
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java145
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/NavigationClient.java2
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java110
-rw-r--r--content/public/android/java/src/org/chromium/content_public/browser/LoadUrlParams.java (renamed from content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java)31
-rw-r--r--content/public/android/java/src/org/chromium/content_public/browser/NavigationController.java55
-rw-r--r--content/public/android/java/src/org/chromium/content_public/browser/NavigationEntry.java (renamed from content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java)4
-rw-r--r--content/public/android/java/src/org/chromium/content_public/browser/NavigationHistory.java (renamed from content/public/android/java/src/org/chromium/content/browser/NavigationHistory.java)8
-rw-r--r--content/public/android/java/src/org/chromium/content_public/browser/PageTransitionTypes.template (renamed from content/public/android/java/src/org/chromium/content/browser/PageTransitionTypes.template)2
-rw-r--r--content/public/android/javatests/src/org/chromium/content/browser/ContentViewLocationTest.java1
-rw-r--r--content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java5
-rw-r--r--content/public/android/javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java5
-rw-r--r--content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeTestBase.java2
-rw-r--r--content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.java2
-rw-r--r--content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java1
-rw-r--r--content/public/android/javatests/src/org/chromium/content/browser/WebContentsObserverAndroidTest.java1
-rw-r--r--content/public/browser/android/content_view_core.h1
-rw-r--r--content/shell/android/java/src/org/chromium/content_shell/Shell.java2
-rw-r--r--content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java2
40 files changed, 515 insertions, 356 deletions
diff --git a/android_webview/buildbot/aosp_manifest.xml b/android_webview/buildbot/aosp_manifest.xml
index cf1e575..33f86eb 100644
--- a/android_webview/buildbot/aosp_manifest.xml
+++ b/android_webview/buildbot/aosp_manifest.xml
@@ -6,7 +6,7 @@
<default remote="aosp"
sync-j="6" />
- <project name="platform/frameworks/webview" path="frameworks/webview" revision="04cc2fafb1103e5d9d9947e899ce4bb285b00b52"/>
+ <project name="platform/frameworks/webview" path="frameworks/webview" revision="8dc9a9d1217f84a7f9b0554f22a826394eabc856"/>
<project groups="device,flo" name="device/asus/deb" revision="0ce3a783d549d023ddc553a04fed717ffb2ff533"/>
<project groups="device,flo" name="device/asus/flo" revision="55ea79b11f9f82b2aa03f44a3429112fc5c06d07"/>
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 9fe979f..0762cb39 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -49,14 +49,14 @@ import org.chromium.content.browser.ContentSettings;
import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.ContentViewStatics;
-import org.chromium.content.browser.LoadUrlParams;
-import org.chromium.content.browser.NavigationHistory;
-import org.chromium.content.browser.PageTransitionTypes;
import org.chromium.content.browser.WebContentsObserverAndroid;
import org.chromium.content.common.CleanupReference;
import org.chromium.content_public.Referrer;
import org.chromium.content_public.browser.GestureStateListener;
import org.chromium.content_public.browser.JavaScriptCallback;
+import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.content_public.browser.NavigationHistory;
+import org.chromium.content_public.browser.PageTransitionTypes;
import org.chromium.ui.base.ActivityWindowAndroid;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.ui.gfx.DeviceDisplayInfo;
diff --git a/android_webview/java_library_common.mk b/android_webview/java_library_common.mk
index 44baa4b..773e10d 100644
--- a/android_webview/java_library_common.mk
+++ b/android_webview/java_library_common.mk
@@ -42,7 +42,6 @@ LOCAL_GENERATED_SOURCES := \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/base/ApplicationState.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/base/MemoryPressureLevelList.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/browser/GestureEventType.java \
-$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/browser/PageTransitionTypes.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/browser/SpeechRecognitionError.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/browser/input/CanonicalAxisIndex.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/browser/input/CanonicalButtonIndex.java \
@@ -50,6 +49,7 @@ $(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/browser/
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/browser/input/SelectionEventType.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/common/ResultCodes.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/common/ScreenOrientationValues.java \
+$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content_public/browser/PageTransitionTypes.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/media/ImageFormat.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/net/CertificateMimeType.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/net/CertVerifyStatusAndroid.java \
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java
index 8656e42..25f8eac 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java
@@ -11,10 +11,10 @@ import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.android_webview.test.util.JSUtils;
import org.chromium.base.test.util.Feature;
-import org.chromium.content.browser.LoadUrlParams;
import org.chromium.content.browser.test.util.CallbackHelper;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPageStartedHelper;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnReceivedErrorHelper;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.net.test.util.TestWebServer;
import java.util.ArrayList;
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
index ac85439..db3dcd8 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
@@ -19,10 +19,10 @@ import org.chromium.android_webview.AwSettings;
import org.chromium.android_webview.test.util.JSUtils;
import org.chromium.base.test.util.InMemorySharedPreferences;
import org.chromium.content.browser.ContentSettings;
-import org.chromium.content.browser.LoadUrlParams;
import org.chromium.content.browser.test.util.CallbackHelper;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
+import org.chromium.content_public.browser.LoadUrlParams;
import java.util.Map;
import java.util.concurrent.Callable;
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/LoadUrlTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/LoadUrlTest.java
index 4a6bab5..fa9707d 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/LoadUrlTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/LoadUrlTest.java
@@ -14,9 +14,9 @@ import org.chromium.android_webview.AwSettings;
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.android_webview.test.util.JSUtils;
import org.chromium.base.test.util.Feature;
-import org.chromium.content.browser.LoadUrlParams;
import org.chromium.content.browser.test.util.CallbackHelper;
import org.chromium.content.browser.test.util.HistoryUtils;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.net.test.util.TestWebServer;
import java.util.ArrayList;
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
index b4307f10..f123585 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
@@ -10,10 +10,10 @@ import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.DisabledTest;
-import org.chromium.content.browser.NavigationEntry;
-import org.chromium.content.browser.NavigationHistory;
import org.chromium.content.browser.test.util.HistoryUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
+import org.chromium.content_public.browser.NavigationEntry;
+import org.chromium.content_public.browser.NavigationHistory;
import org.chromium.net.test.util.TestWebServer;
import java.util.concurrent.Callable;
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/SaveRestoreStateTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/SaveRestoreStateTest.java
index b20dd07..0502611 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/SaveRestoreStateTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/SaveRestoreStateTest.java
@@ -11,7 +11,7 @@ import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.base.test.util.Feature;
import org.chromium.content.browser.ContentViewCore;
-import org.chromium.content.browser.NavigationHistory;
+import org.chromium.content_public.browser.NavigationHistory;
import org.chromium.net.test.util.TestWebServer;
import java.util.concurrent.Callable;
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
index 69a1703..af31b56 100644
--- a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
+++ b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
@@ -36,7 +36,7 @@ import org.chromium.android_webview.AwDevToolsServer;
import org.chromium.android_webview.AwSettings;
import org.chromium.android_webview.test.AwTestContainerView;
import org.chromium.android_webview.test.NullContentsClient;
-import org.chromium.content.browser.LoadUrlParams;
+import org.chromium.content_public.browser.LoadUrlParams;
/**
* This is a lightweight activity for tests that only require WebView functionality.
diff --git a/build/android/findbugs_filter/findbugs_known_bugs.txt b/build/android/findbugs_filter/findbugs_known_bugs.txt
index 90b59f7..854db1e 100644
--- a/build/android/findbugs_filter/findbugs_known_bugs.txt
+++ b/build/android/findbugs_filter/findbugs_known_bugs.txt
@@ -17,10 +17,8 @@ M M UG: org.chromium.content.browser.JavaBridgeReturnValuesTest$TestObject.getBo
M M UG: org.chromium.content.browser.JavaBridgeReturnValuesTest$TestObject.getStringValue() is unsynchronized, org.chromium.content.browser.JavaBridgeReturnValuesTest$TestObject.setStringValue(String) is synchronized At JavaBridgeReturnValuesTest.java
M V EI2: org.chromium.chrome.browser.ChromeBrowserProvider$BookmarkNode.setFavicon(byte[]) may expose internal representation by storing an externally mutable object into ChromeBrowserProvider$BookmarkNode.mFavicon At ChromeBrowserProvider.java
M V EI2: org.chromium.chrome.browser.ChromeBrowserProvider$BookmarkNode.setThumbnail(byte[]) may expose internal representation by storing an externally mutable object into ChromeBrowserProvider$BookmarkNode.mThumbnail At ChromeBrowserProvider.java
-M V EI2: org.chromium.content.browser.LoadUrlParams.setPostData(byte[]) may expose internal representation by storing an externally mutable object into LoadUrlParams.mPostData At LoadUrlParams.java
M V EI: org.chromium.chrome.browser.ChromeBrowserProvider$BookmarkNode.favicon() may expose internal representation by returning ChromeBrowserProvider$BookmarkNode.mFavicon At ChromeBrowserProvider.java
M V EI: org.chromium.chrome.browser.ChromeBrowserProvider$BookmarkNode.thumbnail() may expose internal representation by returning ChromeBrowserProvider$BookmarkNode.mThumbnail At ChromeBrowserProvider.java
-M V EI: org.chromium.content.browser.LoadUrlParams.getPostData() may expose internal representation by returning LoadUrlParams.mPostData At LoadUrlParams.java
M M LI: Incorrect lazy initialization of static field org.chromium.chrome.browser.sync.ProfileSyncService.sSyncSetupManager in org.chromium.chrome.browser.sync.ProfileSyncService.get(Context) At ProfileSyncService.java
M V EI: org.chromium.android_webview.AwWebResourceResponse.getResponseHeaderNames() may expose internal representation by returning AwWebResourceResponse.mResponseHeaderNames At AwWebResourceResponse.java
M V EI: org.chromium.android_webview.AwWebResourceResponse.getResponseHeaderValues() may expose internal representation by returning AwWebResourceResponse.mResponseHeaderValues At AwWebResourceResponse.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/NavigationPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/NavigationPopup.java
index fe51d70..792a15f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/NavigationPopup.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/NavigationPopup.java
@@ -24,8 +24,8 @@ import android.widget.TextView;
import org.chromium.base.CalledByNative;
import org.chromium.base.ThreadUtils;
import org.chromium.content.browser.NavigationClient;
-import org.chromium.content.browser.NavigationEntry;
-import org.chromium.content.browser.NavigationHistory;
+import org.chromium.content_public.browser.NavigationEntry;
+import org.chromium.content_public.browser.NavigationHistory;
import org.chromium.ui.base.LocalizationUtils;
import java.util.HashSet;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
index 06c1504..f37975a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
@@ -30,10 +30,10 @@ import org.chromium.chrome.browser.ui.toolbar.ToolbarModelSecurityLevel;
import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
-import org.chromium.content.browser.LoadUrlParams;
import org.chromium.content.browser.NavigationClient;
-import org.chromium.content.browser.NavigationHistory;
import org.chromium.content.browser.WebContentsObserverAndroid;
+import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.content_public.browser.NavigationHistory;
import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.base.Clipboard;
import org.chromium.ui.base.WindowAndroid;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java
index 718489b..7cd45b4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java
@@ -7,7 +7,7 @@ package org.chromium.chrome.browser.tabmodel;
import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.browser.Tab;
import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
-import org.chromium.content.browser.LoadUrlParams;
+import org.chromium.content_public.browser.LoadUrlParams;
import java.util.List;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java
index e57d34f..fdbf7b8 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/NavigationPopupTest.java
@@ -14,10 +14,10 @@ import org.chromium.base.test.util.UrlUtils;
import org.chromium.chrome.shell.ChromeShellActivity;
import org.chromium.chrome.shell.ChromeShellTestBase;
import org.chromium.content.browser.NavigationClient;
-import org.chromium.content.browser.NavigationEntry;
-import org.chromium.content.browser.NavigationHistory;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
+import org.chromium.content_public.browser.NavigationEntry;
+import org.chromium.content_public.browser.NavigationHistory;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
@@ -41,7 +41,7 @@ public class NavigationPopupTest extends ChromeShellTestBase {
// Exists solely to expose protected methods to this test.
private static class TestNavigationHistory extends NavigationHistory {
@Override
- protected void addEntry(NavigationEntry entry) {
+ public void addEntry(NavigationEntry entry) {
super.addEntry(entry);
}
}
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 ba7e758..195d56a 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
@@ -14,8 +14,8 @@ 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.browser.LoadUrlParams;
import org.chromium.content_public.Referrer;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.ui.base.WindowAndroid;
/**
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index 6842beca7..c0fcd6e 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -470,8 +470,7 @@ TabAndroid::TabLoadStatus TabAndroid::LoadUrl(JNIEnv* env,
jstring j_referrer_url,
jint referrer_policy,
jboolean is_renderer_initiated) {
- content::ContentViewCore* content_view = GetContentViewCore();
- if (!content_view)
+ if (!web_contents())
return PAGE_LOAD_FAILED;
GURL gurl(base::android::ConvertJavaStringToUTF8(env, url));
@@ -564,7 +563,7 @@ TabAndroid::TabLoadStatus TabAndroid::LoadUrl(JNIEnv* env,
return DEFAULT_PAGE_LOAD;
}
load_params.is_renderer_initiated = is_renderer_initiated;
- content_view->LoadUrl(load_params);
+ web_contents()->GetController().LoadURLWithParams(load_params);
}
return DEFAULT_PAGE_LOAD;
}
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index cd4ef08..f8ca9a74 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -23,9 +23,6 @@
#include "content/browser/android/load_url_params.h"
#include "content/browser/android/popup_touch_handle_drawable.h"
#include "content/browser/frame_host/interstitial_page_impl.h"
-#include "content/browser/frame_host/navigation_controller_impl.h"
-#include "content/browser/frame_host/navigation_entry_impl.h"
-#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/geolocation/geolocation_dispatcher_host.h"
#include "content/browser/media/media_web_contents_observer.h"
#include "content/browser/renderer_host/compositor_impl_android.h"
@@ -794,11 +791,6 @@ void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& start,
web_contents_->SelectRange(start_point, end_point);
}
-void ContentViewCoreImpl::LoadUrl(
- NavigationController::LoadURLParams& params) {
- GetWebContents()->GetController().LoadURLWithParams(params);
-}
-
ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const {
return view_android_;
}
@@ -836,63 +828,6 @@ void ContentViewCoreImpl::SelectPopupMenuItems(JNIEnv* env,
rfhi->DidSelectPopupMenuItems(selected_indices);
}
-void ContentViewCoreImpl::LoadUrl(
- JNIEnv* env, jobject obj,
- jstring url,
- jint load_url_type,
- jint transition_type,
- jstring j_referrer_url,
- jint referrer_policy,
- jint ua_override_option,
- jstring extra_headers,
- jbyteArray post_data,
- jstring base_url_for_data_url,
- jstring virtual_url_for_data_url,
- jboolean can_load_local_resources,
- jboolean is_renderer_initiated) {
- DCHECK(url);
- NavigationController::LoadURLParams params(
- GURL(ConvertJavaStringToUTF8(env, url)));
-
- params.load_type = static_cast<NavigationController::LoadURLType>(
- load_url_type);
- params.transition_type = PageTransitionFromInt(transition_type);
- params.override_user_agent =
- static_cast<NavigationController::UserAgentOverrideOption>(
- ua_override_option);
-
- if (extra_headers)
- params.extra_headers = ConvertJavaStringToUTF8(env, extra_headers);
-
- if (post_data) {
- std::vector<uint8> http_body_vector;
- base::android::JavaByteArrayToByteVector(env, post_data, &http_body_vector);
- params.browser_initiated_post_data =
- base::RefCountedBytes::TakeVector(&http_body_vector);
- }
-
- if (base_url_for_data_url) {
- params.base_url_for_data_url =
- GURL(ConvertJavaStringToUTF8(env, base_url_for_data_url));
- }
-
- if (virtual_url_for_data_url) {
- params.virtual_url_for_data_url =
- GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url));
- }
-
- params.can_load_local_resources = can_load_local_resources;
- if (j_referrer_url) {
- params.referrer = content::Referrer(
- GURL(ConvertJavaStringToUTF8(env, j_referrer_url)),
- static_cast<blink::WebReferrerPolicy>(referrer_policy));
- }
-
- params.is_renderer_initiated = is_renderer_initiated;
-
- LoadUrl(params);
-}
-
WebContents* ContentViewCoreImpl::GetWebContents() const {
return web_contents_;
}
@@ -1181,12 +1116,6 @@ void ContentViewCoreImpl::SetMultiTouchZoomSupportEnabled(JNIEnv* env,
rwhv->SetMultiTouchZoomSupportEnabled(enabled);
}
-void ContentViewCoreImpl::ClearHistory(JNIEnv* env, jobject obj) {
- // TODO(creis): Do callers of this need to know if it fails?
- if (web_contents_->GetController().CanPruneAllButLastCommitted())
- web_contents_->GetController().PruneAllButLastCommitted();
-}
-
void ContentViewCoreImpl::SetAllowJavascriptInterfacesInspection(
JNIEnv* env,
jobject obj,
@@ -1228,79 +1157,6 @@ void ContentViewCoreImpl::WasResized(JNIEnv* env, jobject obj) {
}
}
-namespace {
-
-static void AddNavigationEntryToHistory(JNIEnv* env, jobject obj,
- jobject history,
- NavigationEntry* entry,
- int index) {
- // Get the details of the current entry
- ScopedJavaLocalRef<jstring> j_url(
- ConvertUTF8ToJavaString(env, entry->GetURL().spec()));
- ScopedJavaLocalRef<jstring> j_virtual_url(
- ConvertUTF8ToJavaString(env, entry->GetVirtualURL().spec()));
- ScopedJavaLocalRef<jstring> j_original_url(
- ConvertUTF8ToJavaString(env, entry->GetOriginalRequestURL().spec()));
- ScopedJavaLocalRef<jstring> j_title(
- ConvertUTF16ToJavaString(env, entry->GetTitle()));
- ScopedJavaLocalRef<jobject> j_bitmap;
- const FaviconStatus& status = entry->GetFavicon();
- if (status.valid && status.image.ToSkBitmap()->getSize() > 0)
- j_bitmap = gfx::ConvertToJavaBitmap(status.image.ToSkBitmap());
-
- // Add the item to the list
- Java_ContentViewCore_addToNavigationHistory(
- env, obj, history, index, j_url.obj(), j_virtual_url.obj(),
- j_original_url.obj(), j_title.obj(), j_bitmap.obj());
-}
-
-} // namespace
-
-int ContentViewCoreImpl::GetNavigationHistory(JNIEnv* env,
- jobject obj,
- jobject history) {
- // Iterate through navigation entries to populate the list
- const NavigationController& controller = web_contents_->GetController();
- int count = controller.GetEntryCount();
- for (int i = 0; i < count; ++i) {
- AddNavigationEntryToHistory(
- env, obj, history, controller.GetEntryAtIndex(i), i);
- }
-
- return controller.GetCurrentEntryIndex();
-}
-
-void ContentViewCoreImpl::GetDirectedNavigationHistory(JNIEnv* env,
- jobject obj,
- jobject history,
- jboolean is_forward,
- jint max_entries) {
- // Iterate through navigation entries to populate the list
- const NavigationController& controller = web_contents_->GetController();
- int count = controller.GetEntryCount();
- int num_added = 0;
- int increment_value = is_forward ? 1 : -1;
- for (int i = controller.GetCurrentEntryIndex() + increment_value;
- i >= 0 && i < count;
- i += increment_value) {
- if (num_added >= max_entries)
- break;
-
- AddNavigationEntryToHistory(
- env, obj, history, controller.GetEntryAtIndex(i), i);
- num_added++;
- }
-}
-
-ScopedJavaLocalRef<jstring>
-ContentViewCoreImpl::GetOriginalUrlForActiveNavigationEntry(JNIEnv* env,
- jobject obj) {
- NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry();
- if (entry == NULL)
- return ScopedJavaLocalRef<jstring>(env, NULL);
- return ConvertUTF8ToJavaString(env, entry->GetOriginalRequestURL().spec());
-}
-
long ContentViewCoreImpl::GetNativeImeAdapter(JNIEnv* env, jobject obj) {
RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid();
if (!rwhva)
@@ -1327,13 +1183,6 @@ void ContentViewCoreImpl::PostMessageToFrame(JNIEnv* env, jobject obj,
host->Send(new ViewMsg_PostMessageEvent(host->GetRoutingID(), params));
}
-
-bool ContentViewCoreImpl::GetUseDesktopUserAgent(
- JNIEnv* env, jobject obj) {
- NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry();
- return entry && entry->GetIsOverridingUserAgent();
-}
-
void ContentViewCoreImpl::UpdateImeAdapter(long native_ime_adapter,
int text_input_type,
int text_input_flags,
@@ -1364,42 +1213,6 @@ void ContentViewCoreImpl::UpdateImeAdapter(long native_ime_adapter,
is_non_ime_change);
}
-void ContentViewCoreImpl::ClearSslPreferences(JNIEnv* env, jobject obj) {
- content::SSLHostStateDelegate* delegate =
- web_contents_->
- GetController().
- GetBrowserContext()->
- GetSSLHostStateDelegate();
- if (delegate)
- delegate->Clear();
-}
-
-void ContentViewCoreImpl::SetUseDesktopUserAgent(
- JNIEnv* env,
- jobject obj,
- jboolean enabled,
- jboolean reload_on_state_change) {
- if (GetUseDesktopUserAgent(env, obj) == enabled)
- return;
-
- // Make sure the navigation entry actually exists.
- NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry();
- if (!entry)
- return;
-
- // Set the flag in the NavigationEntry.
- entry->SetIsOverridingUserAgent(enabled);
-
- // Send the override to the renderer.
- if (reload_on_state_change) {
- // Reloading the page will send the override down as part of the
- // navigation IPC message.
- NavigationControllerImpl& controller =
- static_cast<NavigationControllerImpl&>(web_contents_->GetController());
- controller.ReloadOriginalRequestURL(false);
- }
-}
-
void ContentViewCoreImpl::SetAccessibilityEnabled(JNIEnv* env, jobject obj,
bool enabled) {
SetAccessibilityEnabledInternal(enabled);
diff --git a/content/browser/android/content_view_core_impl.h b/content/browser/android/content_view_core_impl.h
index f986d54..3dbfba5 100644
--- a/content/browser/android/content_view_core_impl.h
+++ b/content/browser/android/content_view_core_impl.h
@@ -52,7 +52,6 @@ class ContentViewCoreImpl : public ContentViewCore,
virtual ui::ViewAndroid* GetViewAndroid() const OVERRIDE;
virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE;
virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE;
- virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE;
virtual void ShowPastePopup(int x, int y) OVERRIDE;
virtual void GetScaledContentBitmap(
float scale,
@@ -84,20 +83,6 @@ class ContentViewCoreImpl : public ContentViewCore,
jlong selectPopupSourceFrame,
jintArray indices);
- void LoadUrl(
- JNIEnv* env, jobject obj,
- jstring url,
- jint load_url_type,
- jint transition_type,
- jstring j_referrer_url,
- jint referrer_policy,
- jint ua_override_option,
- jstring extra_headers,
- jbyteArray post_data,
- jstring base_url_for_data_url,
- jstring virtual_url_for_data_url,
- jboolean can_load_local_resources,
- jboolean is_renderer_initiated);
void SendOrientationChangeEvent(JNIEnv* env, jobject obj, jint orientation);
jboolean OnTouchEvent(JNIEnv* env,
jobject obj,
@@ -166,7 +151,6 @@ class ContentViewCoreImpl : public ContentViewCore,
jobject obj,
jboolean enabled);
- void ClearHistory(JNIEnv* env, jobject obj);
void PostMessageToFrame(JNIEnv* env, jobject obj, jstring frame_id,
jstring message, jstring source_origin, jstring target_origin);
long GetNativeImeAdapter(JNIEnv* env, jobject obj);
@@ -174,12 +158,6 @@ class ContentViewCoreImpl : public ContentViewCore,
jint GetBackgroundColor(JNIEnv* env, jobject obj);
void SetBackgroundColor(JNIEnv* env, jobject obj, jint color);
- void ClearSslPreferences(JNIEnv* env, jobject /* obj */);
- void SetUseDesktopUserAgent(JNIEnv* env,
- jobject /* obj */,
- jboolean state,
- jboolean reload_on_state_change);
- bool GetUseDesktopUserAgent(JNIEnv* env, jobject /* obj */);
void SetAllowJavascriptInterfacesInspection(JNIEnv* env,
jobject obj,
jboolean allow);
@@ -189,14 +167,6 @@ class ContentViewCoreImpl : public ContentViewCore,
jstring name,
jclass safe_annotation_clazz);
void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name);
- int GetNavigationHistory(JNIEnv* env, jobject obj, jobject history);
- void GetDirectedNavigationHistory(JNIEnv* env,
- jobject obj,
- jobject history,
- jboolean is_forward,
- jint max_entries);
- base::android::ScopedJavaLocalRef<jstring>
- GetOriginalUrlForActiveNavigationEntry(JNIEnv* env, jobject obj);
void WasResized(JNIEnv* env, jobject obj);
void SetAccessibilityEnabled(JNIEnv* env, jobject obj, bool enabled);
diff --git a/content/browser/frame_host/navigation_controller_android.cc b/content/browser/frame_host/navigation_controller_android.cc
index 69f7bb1..4f3f45a 100644
--- a/content/browser/frame_host/navigation_controller_android.cc
+++ b/content/browser/frame_host/navigation_controller_android.cc
@@ -5,10 +5,56 @@
#include "content/browser/frame_host/navigation_controller_android.h"
#include "base/android/jni_android.h"
+#include "base/android/jni_array.h"
+#include "base/android/jni_string.h"
+#include "content/browser/frame_host/navigation_entry_impl.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_controller.h"
+#include "content/public/browser/ssl_host_state_delegate.h"
#include "jni/NavigationControllerImpl_jni.h"
+#include "ui/gfx/android/java_bitmap.h"
using base::android::AttachCurrentThread;
+using base::android::ConvertJavaStringToUTF16;
+using base::android::ConvertJavaStringToUTF8;
+using base::android::ConvertUTF16ToJavaString;
+using base::android::ConvertUTF8ToJavaString;
+namespace {
+
+// static
+static void AddNavigationEntryToHistory(JNIEnv* env,
+ jobject obj,
+ jobject history,
+ content::NavigationEntry* entry,
+ int index) {
+ // Get the details of the current entry
+ ScopedJavaLocalRef<jstring> j_url(
+ ConvertUTF8ToJavaString(env, entry->GetURL().spec()));
+ ScopedJavaLocalRef<jstring> j_virtual_url(
+ ConvertUTF8ToJavaString(env, entry->GetVirtualURL().spec()));
+ ScopedJavaLocalRef<jstring> j_original_url(
+ ConvertUTF8ToJavaString(env, entry->GetOriginalRequestURL().spec()));
+ ScopedJavaLocalRef<jstring> j_title(
+ ConvertUTF16ToJavaString(env, entry->GetTitle()));
+ ScopedJavaLocalRef<jobject> j_bitmap;
+ const content::FaviconStatus& status = entry->GetFavicon();
+ if (status.valid && status.image.ToSkBitmap()->getSize() > 0)
+ j_bitmap = gfx::ConvertToJavaBitmap(status.image.ToSkBitmap());
+
+ // Add the item to the list
+ content::Java_NavigationControllerImpl_addToNavigationHistory(
+ env,
+ obj,
+ history,
+ index,
+ j_url.obj(),
+ j_virtual_url.obj(),
+ j_original_url.obj(),
+ j_title.obj(),
+ j_bitmap.obj());
+}
+
+} // namespace
namespace content {
@@ -101,4 +147,149 @@ void NavigationControllerAndroid::GoToNavigationIndex(JNIEnv* env,
navigation_controller_->GoToIndex(index);
}
+void NavigationControllerAndroid::LoadUrl(JNIEnv* env,
+ jobject obj,
+ jstring url,
+ jint load_url_type,
+ jint transition_type,
+ jstring j_referrer_url,
+ jint referrer_policy,
+ jint ua_override_option,
+ jstring extra_headers,
+ jbyteArray post_data,
+ jstring base_url_for_data_url,
+ jstring virtual_url_for_data_url,
+ jboolean can_load_local_resources,
+ jboolean is_renderer_initiated) {
+ DCHECK(url);
+ NavigationController::LoadURLParams params(
+ GURL(ConvertJavaStringToUTF8(env, url)));
+
+ params.load_type =
+ static_cast<NavigationController::LoadURLType>(load_url_type);
+ params.transition_type = PageTransitionFromInt(transition_type);
+ params.override_user_agent =
+ static_cast<NavigationController::UserAgentOverrideOption>(
+ ua_override_option);
+ params.can_load_local_resources = can_load_local_resources;
+ params.is_renderer_initiated = is_renderer_initiated;
+
+ if (extra_headers)
+ params.extra_headers = ConvertJavaStringToUTF8(env, extra_headers);
+
+ if (post_data) {
+ std::vector<uint8> http_body_vector;
+ base::android::JavaByteArrayToByteVector(env, post_data, &http_body_vector);
+ params.browser_initiated_post_data =
+ base::RefCountedBytes::TakeVector(&http_body_vector);
+ }
+
+ if (base_url_for_data_url) {
+ params.base_url_for_data_url =
+ GURL(ConvertJavaStringToUTF8(env, base_url_for_data_url));
+ }
+
+ if (virtual_url_for_data_url) {
+ params.virtual_url_for_data_url =
+ GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url));
+ }
+
+ if (j_referrer_url) {
+ params.referrer = content::Referrer(
+ GURL(ConvertJavaStringToUTF8(env, j_referrer_url)),
+ static_cast<blink::WebReferrerPolicy>(referrer_policy));
+ }
+
+ navigation_controller_->LoadURLWithParams(params);
+}
+
+void NavigationControllerAndroid::ClearHistory(JNIEnv* env, jobject obj) {
+ // TODO(creis): Do callers of this need to know if it fails?
+ if (navigation_controller_->CanPruneAllButLastCommitted())
+ navigation_controller_->PruneAllButLastCommitted();
+}
+
+jint NavigationControllerAndroid::GetNavigationHistory(JNIEnv* env,
+ jobject obj,
+ jobject history) {
+ // Iterate through navigation entries to populate the list
+ int count = navigation_controller_->GetEntryCount();
+ for (int i = 0; i < count; ++i) {
+ AddNavigationEntryToHistory(
+ env, obj, history, navigation_controller_->GetEntryAtIndex(i), i);
+ }
+
+ return navigation_controller_->GetCurrentEntryIndex();
+}
+
+void NavigationControllerAndroid::GetDirectedNavigationHistory(
+ JNIEnv* env,
+ jobject obj,
+ jobject history,
+ jboolean is_forward,
+ jint max_entries) {
+ // Iterate through navigation entries to populate the list
+ int count = navigation_controller_->GetEntryCount();
+ int num_added = 0;
+ int increment_value = is_forward ? 1 : -1;
+ for (int i = navigation_controller_->GetCurrentEntryIndex() + increment_value;
+ i >= 0 && i < count;
+ i += increment_value) {
+ if (num_added >= max_entries)
+ break;
+
+ AddNavigationEntryToHistory(
+ env, obj, history, navigation_controller_->GetEntryAtIndex(i), i);
+ num_added++;
+ }
+}
+
+ScopedJavaLocalRef<jstring>
+NavigationControllerAndroid::GetOriginalUrlForVisibleNavigationEntry(
+ JNIEnv* env,
+ jobject obj) {
+ NavigationEntry* entry = navigation_controller_->GetVisibleEntry();
+ if (entry == NULL)
+ return ScopedJavaLocalRef<jstring>(env, NULL);
+ return ConvertUTF8ToJavaString(env, entry->GetOriginalRequestURL().spec());
+}
+
+void NavigationControllerAndroid::ClearSslPreferences(JNIEnv* env,
+ jobject obj) {
+ content::SSLHostStateDelegate* delegate =
+ navigation_controller_->GetBrowserContext()->GetSSLHostStateDelegate();
+ if (delegate)
+ delegate->Clear();
+}
+
+bool NavigationControllerAndroid::GetUseDesktopUserAgent(JNIEnv* env,
+ jobject obj) {
+ NavigationEntry* entry = navigation_controller_->GetVisibleEntry();
+ return entry && entry->GetIsOverridingUserAgent();
+}
+
+void NavigationControllerAndroid::SetUseDesktopUserAgent(
+ JNIEnv* env,
+ jobject obj,
+ jboolean enabled,
+ jboolean reload_on_state_change) {
+ if (GetUseDesktopUserAgent(env, obj) == enabled)
+ return;
+
+ // Make sure the navigation entry actually exists.
+ NavigationEntry* entry = navigation_controller_->GetVisibleEntry();
+ if (!entry)
+ return;
+
+ // Set the flag in the NavigationEntry.
+ entry->SetIsOverridingUserAgent(enabled);
+
+ // Send the override to the renderer.
+ if (reload_on_state_change) {
+ // Reloading the page will send the override down as part of the
+ // navigation IPC message.
+ navigation_controller_->ReloadOriginalRequestURL(false);
+ }
+}
+
} // namespace content
diff --git a/content/browser/frame_host/navigation_controller_android.h b/content/browser/frame_host/navigation_controller_android.h
index 5d31348..6206413 100644
--- a/content/browser/frame_host/navigation_controller_android.h
+++ b/content/browser/frame_host/navigation_controller_android.h
@@ -46,6 +46,35 @@ class CONTENT_EXPORT NavigationControllerAndroid {
void RequestRestoreLoad(JNIEnv* env, jobject obj);
void CancelPendingReload(JNIEnv* env, jobject obj);
void GoToNavigationIndex(JNIEnv* env, jobject obj, jint index);
+ void LoadUrl(JNIEnv* env,
+ jobject obj,
+ jstring url,
+ jint load_url_type,
+ jint transition_type,
+ jstring j_referrer_url,
+ jint referrer_policy,
+ jint ua_override_option,
+ jstring extra_headers,
+ jbyteArray post_data,
+ jstring base_url_for_data_url,
+ jstring virtual_url_for_data_url,
+ jboolean can_load_local_resources,
+ jboolean is_renderer_initiated);
+ void ClearSslPreferences(JNIEnv* env, jobject /* obj */);
+ bool GetUseDesktopUserAgent(JNIEnv* env, jobject /* obj */);
+ void SetUseDesktopUserAgent(JNIEnv* env,
+ jobject /* obj */,
+ jboolean state,
+ jboolean reload_on_state_change);
+ int GetNavigationHistory(JNIEnv* env, jobject obj, jobject history);
+ void GetDirectedNavigationHistory(JNIEnv* env,
+ jobject obj,
+ jobject history,
+ jboolean is_forward,
+ jint max_entries);
+ base::android::ScopedJavaLocalRef<jstring>
+ GetOriginalUrlForVisibleNavigationEntry(JNIEnv* env, jobject obj);
+ void ClearHistory(JNIEnv* env, jobject obj);
private:
NavigationController* navigation_controller_;
diff --git a/content/content.gyp b/content/content.gyp
index 56b3b37..5cf6b6f 100644
--- a/content/content.gyp
+++ b/content/content.gyp
@@ -481,10 +481,10 @@
'target_name': 'page_transition_types_java',
'type': 'none',
'sources': [
- 'public/android/java/src/org/chromium/content/browser/PageTransitionTypes.template',
+ 'public/android/java/src/org/chromium/content_public/browser/PageTransitionTypes.template',
],
'variables': {
- 'package_name': 'org/chromium/content/browser',
+ 'package_name': 'org/chromium/content_public/browser',
'template_deps': ['public/common/page_transition_types_list.h'],
},
'includes': [ '../build/android/java_cpp_template.gypi' ],
diff --git a/content/content_jni.gypi b/content/content_jni.gypi
index 3cf9a8a..8d7821f 100644
--- a/content/content_jni.gypi
+++ b/content/content_jni.gypi
@@ -28,7 +28,6 @@
'public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java',
'public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java',
'public/android/java/src/org/chromium/content/browser/InterstitialPageDelegateAndroid.java',
- 'public/android/java/src/org/chromium/content/browser/LoadUrlParams.java',
'public/android/java/src/org/chromium/content/browser/LocationProviderAdapter.java',
'public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java',
'public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java',
@@ -42,6 +41,7 @@
'public/android/java/src/org/chromium/content/browser/WebContentsObserverAndroid.java',
'public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java',
'public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java',
+ 'public/android/java/src/org/chromium/content_public/browser/LoadUrlParams.java',
],
'variables': {
'jni_gen_package': 'content',
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 34af155f..788fd21 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -76,6 +76,8 @@ import org.chromium.content.browser.input.SelectionEventType;
import org.chromium.content.common.ContentSwitches;
import org.chromium.content_public.browser.GestureStateListener;
import org.chromium.content_public.browser.JavaScriptCallback;
+import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.content_public.browser.NavigationHistory;
import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.base.DeviceFormFactor;
import org.chromium.ui.base.ViewAndroid;
@@ -855,21 +857,8 @@ public class ContentViewCore
* @param params Parameters for this load.
*/
public void loadUrl(LoadUrlParams params) {
- if (mNativeContentViewCore == 0) return;
-
- nativeLoadUrl(mNativeContentViewCore,
- params.mUrl,
- params.mLoadUrlType,
- params.mTransitionType,
- params.getReferrer() != null ? params.getReferrer().getUrl() : null,
- params.getReferrer() != null ? params.getReferrer().getPolicy() : 0,
- params.mUaOverrideOption,
- params.getExtraHeadersString(),
- params.mPostData,
- params.mBaseUrlForDataUrl,
- params.mVirtualUrlForDataUrl,
- params.mCanLoadLocalResources,
- params.mIsRendererInitiated);
+ assert mWebContents != null;
+ mWebContents.getNavigationController().loadUrl(params);
}
/**
@@ -977,14 +966,16 @@ public class ContentViewCore
* @return Whether the current WebContents has a previous navigation entry.
*/
public boolean canGoBack() {
- return mWebContents != null && mWebContents.getNavigationController().canGoBack();
+ assert mWebContents != null;
+ return mWebContents.getNavigationController().canGoBack();
}
/**
* @return Whether the current WebContents has a navigation entry after the current one.
*/
public boolean canGoForward() {
- return mWebContents != null && mWebContents.getNavigationController().canGoForward();
+ assert mWebContents != null;
+ return mWebContents.getNavigationController().canGoForward();
}
/**
@@ -992,8 +983,8 @@ public class ContentViewCore
* @return Whether we can move in history by given offset
*/
public boolean canGoToOffset(int offset) {
- return mWebContents != null &&
- mWebContents.getNavigationController().canGoToOffset(offset);
+ assert mWebContents != null;
+ return mWebContents.getNavigationController().canGoToOffset(offset);
}
/**
@@ -1003,58 +994,64 @@ public class ContentViewCore
*/
@VisibleForTesting
public void goToOffset(int offset) {
- if (mWebContents != null) mWebContents.getNavigationController().goToOffset(offset);
+ assert mWebContents != null;
+ mWebContents.getNavigationController().goToOffset(offset);
}
@Override
public void goToNavigationIndex(int index) {
- if (mWebContents != null) {
- mWebContents.getNavigationController().goToNavigationIndex(index);
- }
+ assert mWebContents != null;
+ mWebContents.getNavigationController().goToNavigationIndex(index);
}
/**
* Goes to the navigation entry before the current one.
*/
public void goBack() {
- if (mWebContents != null) mWebContents.getNavigationController().goBack();
+ assert mWebContents != null;
+ mWebContents.getNavigationController().goBack();
}
/**
* Goes to the navigation entry following the current one.
*/
public void goForward() {
- if (mWebContents != null) mWebContents.getNavigationController().goForward();
+ assert mWebContents != null;
+ mWebContents.getNavigationController().goForward();
}
/**
* Loads the current navigation if there is a pending lazy load (after tab restore).
*/
public void loadIfNecessary() {
- if (mWebContents != null) mWebContents.getNavigationController().loadIfNecessary();
+ assert mWebContents != null;
+ mWebContents.getNavigationController().loadIfNecessary();
}
/**
* Requests the current navigation to be loaded upon the next call to loadIfNecessary().
*/
public void requestRestoreLoad() {
- if (mWebContents != null) mWebContents.getNavigationController().requestRestoreLoad();
+ assert mWebContents != null;
+ mWebContents.getNavigationController().requestRestoreLoad();
}
/**
* Reload the current page.
*/
public void reload(boolean checkForRepost) {
+ assert mWebContents != null;
mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary();
- if (mWebContents != null) mWebContents.getNavigationController().reload(checkForRepost);
+ mWebContents.getNavigationController().reload(checkForRepost);
}
/**
* Reload the current page, ignoring the contents of the cache.
*/
public void reloadIgnoringCache(boolean checkForRepost) {
+ assert mWebContents != null;
mAccessibilityInjector.addOrRemoveAccessibilityApisIfNecessary();
- if (mWebContents != null) mWebContents.getNavigationController().reloadIgnoringCache(
+ mWebContents.getNavigationController().reloadIgnoringCache(
checkForRepost);
}
@@ -1062,14 +1059,16 @@ public class ContentViewCore
* Cancel the pending reload.
*/
public void cancelPendingReload() {
- if (mWebContents != null) mWebContents.getNavigationController().cancelPendingReload();
+ assert mWebContents != null;
+ mWebContents.getNavigationController().cancelPendingReload();
}
/**
* Continue the pending reload.
*/
public void continuePendingReload() {
- if (mWebContents != null) mWebContents.getNavigationController().continuePendingReload();
+ assert mWebContents != null;
+ mWebContents.getNavigationController().continuePendingReload();
}
/**
@@ -1077,7 +1076,8 @@ public class ContentViewCore
* forwards directions.
*/
public void clearHistory() {
- if (mNativeContentViewCore != 0) nativeClearHistory(mNativeContentViewCore);
+ assert mWebContents != null;
+ mWebContents.getNavigationController().clearHistory();
}
/**
@@ -2166,10 +2166,8 @@ public class ContentViewCore
}
public boolean getUseDesktopUserAgent() {
- if (mNativeContentViewCore != 0) {
- return nativeGetUseDesktopUserAgent(mNativeContentViewCore);
- }
- return false;
+ assert mWebContents != null;
+ return mWebContents.getNavigationController().getUseDesktopUserAgent();
}
/**
@@ -2178,13 +2176,14 @@ public class ContentViewCore
* @param reloadOnChange Reload the page if the UA has changed.
*/
public void setUseDesktopUserAgent(boolean override, boolean reloadOnChange) {
- if (mNativeContentViewCore != 0) {
- nativeSetUseDesktopUserAgent(mNativeContentViewCore, override, reloadOnChange);
- }
+ assert mWebContents != null;
+ mWebContents.getNavigationController().setUseDesktopUserAgent(override,
+ reloadOnChange);
}
public void clearSslPreferences() {
- if (mNativeContentViewCore != 0) nativeClearSslPreferences(mNativeContentViewCore);
+ assert mWebContents != null;
+ mWebContents.getNavigationController().clearSslPreferences();
}
private void hideTextHandles() {
@@ -2950,36 +2949,18 @@ public class ContentViewCore
}
/**
- * Callback factory method for nativeGetNavigationHistory().
- */
- @CalledByNative
- private void addToNavigationHistory(Object history, int index, String url, String virtualUrl,
- String originalUrl, String title, Bitmap favicon) {
- NavigationEntry entry = new NavigationEntry(
- index, url, virtualUrl, originalUrl, title, favicon);
- ((NavigationHistory) history).addEntry(entry);
- }
-
- /**
* Get a copy of the navigation history of the view.
*/
public NavigationHistory getNavigationHistory() {
- NavigationHistory history = new NavigationHistory();
- if (mNativeContentViewCore != 0) {
- int currentIndex = nativeGetNavigationHistory(mNativeContentViewCore, history);
- history.setCurrentEntryIndex(currentIndex);
- }
- return history;
+ assert mWebContents != null;
+ return mWebContents.getNavigationController().getNavigationHistory();
}
@Override
public NavigationHistory getDirectedNavigationHistory(boolean isForward, int itemLimit) {
- NavigationHistory history = new NavigationHistory();
- if (mNativeContentViewCore != 0) {
- nativeGetDirectedNavigationHistory(
- mNativeContentViewCore, history, isForward, itemLimit);
- }
- return history;
+ assert mWebContents != null;
+ return mWebContents.getNavigationController().getDirectedNavigationHistory(
+ isForward, itemLimit);
}
/**
@@ -2987,10 +2968,9 @@ public class ContentViewCore
* current entry.
*/
public String getOriginalUrlForActiveNavigationEntry() {
- if (mNativeContentViewCore != 0) {
- return nativeGetOriginalUrlForActiveNavigationEntry(mNativeContentViewCore);
- }
- return "";
+ assert mWebContents != null;
+ return mWebContents.getNavigationController().
+ getOriginalUrlForVisibleNavigationEntry();
}
/**
@@ -3120,21 +3100,6 @@ public class ContentViewCore
private native void nativeOnJavaContentViewCoreDestroyed(long nativeContentViewCoreImpl);
- private native void nativeLoadUrl(
- long nativeContentViewCoreImpl,
- String url,
- int loadUrlType,
- int transitionType,
- String referrerUrl,
- int referrerPolicy,
- int uaOverrideOption,
- String extraHeaders,
- byte[] postData,
- String baseUrlForDataUrl,
- String virtualUrlForDataUrl,
- boolean canLoadLocalResources,
- boolean isRendererInitiated);
-
private native void nativeSetFocus(long nativeContentViewCoreImpl, boolean focused);
private native void nativeSendOrientationChangeEvent(
@@ -3209,7 +3174,6 @@ public class ContentViewCore
private native void nativeSelectPopupMenuItems(long nativeContentViewCoreImpl,
long nativeSelectPopupSourceFrame, int[] indices);
- private native void nativeClearHistory(long nativeContentViewCoreImpl);
private native void nativePostMessageToFrame(long nativeContentViewCoreImpl, String frameId,
String message, String sourceOrigin, String targetOrigin);
@@ -3218,13 +3182,6 @@ public class ContentViewCore
private native int nativeGetCurrentRenderProcessId(long nativeContentViewCoreImpl);
- private native void nativeSetUseDesktopUserAgent(long nativeContentViewCoreImpl,
- boolean enabled, boolean reloadOnChange);
-
- private native boolean nativeGetUseDesktopUserAgent(long nativeContentViewCoreImpl);
-
- private native void nativeClearSslPreferences(long nativeContentViewCoreImpl);
-
private native void nativeSetAllowJavascriptInterfacesInspection(
long nativeContentViewCoreImpl, boolean allow);
@@ -3234,14 +3191,6 @@ public class ContentViewCore
private native void nativeRemoveJavascriptInterface(long nativeContentViewCoreImpl,
String name);
- private native int nativeGetNavigationHistory(long nativeContentViewCoreImpl, Object context);
-
- private native void nativeGetDirectedNavigationHistory(long nativeContentViewCoreImpl,
- Object context, boolean isForward, int maxEntries);
-
- private native String nativeGetOriginalUrlForActiveNavigationEntry(
- long nativeContentViewCoreImpl);
-
private native void nativeWasResized(long nativeContentViewCoreImpl);
private native void nativeSetAccessibilityEnabled(
diff --git a/content/public/android/java/src/org/chromium/content/browser/NavigationClient.java b/content/public/android/java/src/org/chromium/content/browser/NavigationClient.java
index 2605851c5..433ec0b 100644
--- a/content/public/android/java/src/org/chromium/content/browser/NavigationClient.java
+++ b/content/public/android/java/src/org/chromium/content/browser/NavigationClient.java
@@ -4,6 +4,8 @@
package org.chromium.content.browser;
+import org.chromium.content_public.browser.NavigationHistory;
+
/**
* Provides functionality needed to query and page history and the ability to access
* items in the history.
diff --git a/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java b/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java
index 44233f4..131da09 100644
--- a/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java
+++ b/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java
@@ -4,9 +4,14 @@
package org.chromium.content.browser.framehost;
+import android.graphics.Bitmap;
+
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.NavigationController;
+import org.chromium.content_public.browser.NavigationEntry;
+import org.chromium.content_public.browser.NavigationHistory;
/**
* The NavigationControllerImpl Java wrapper to allow communicating with the native
@@ -121,6 +126,86 @@ import org.chromium.content_public.browser.NavigationController;
}
}
+ @Override
+ public void loadUrl(LoadUrlParams params) {
+ if (mNativeNavigationControllerAndroid != 0) {
+ nativeLoadUrl(
+ mNativeNavigationControllerAndroid,
+ params.getUrl(),
+ params.getLoadUrlType(), params.getTransitionType(),
+ params.getReferrer() != null ? params.getReferrer().getUrl() : null,
+ params.getReferrer() != null ? params.getReferrer().getPolicy() : 0,
+ params.getUserAgentOverrideOption(),
+ params.getExtraHeadersString(),
+ params.getPostData(),
+ params.getBaseUrl(),
+ params.getVirtualUrlForDataUrl(),
+ params.getCanLoadLocalResources(),
+ params.getIsRendererInitiated());
+ }
+ }
+
+ @Override
+ public void clearHistory() {
+ if (mNativeNavigationControllerAndroid != 0) {
+ nativeClearHistory(mNativeNavigationControllerAndroid);
+ }
+ }
+
+ @Override
+ public NavigationHistory getNavigationHistory() {
+ if (mNativeNavigationControllerAndroid == 0) return null;
+ NavigationHistory history = new NavigationHistory();
+ int currentIndex = nativeGetNavigationHistory(
+ mNativeNavigationControllerAndroid, history);
+ history.setCurrentEntryIndex(currentIndex);
+ return history;
+ }
+
+ @Override
+ public NavigationHistory getDirectedNavigationHistory(boolean isForward, int itemLimit) {
+ if (mNativeNavigationControllerAndroid == 0) return null;
+ NavigationHistory history = new NavigationHistory();
+ nativeGetDirectedNavigationHistory(mNativeNavigationControllerAndroid,
+ history, isForward, itemLimit);
+ return history;
+ }
+
+ @Override
+ public String getOriginalUrlForVisibleNavigationEntry() {
+ if (mNativeNavigationControllerAndroid == 0) return null;
+ return nativeGetOriginalUrlForVisibleNavigationEntry(mNativeNavigationControllerAndroid);
+ }
+
+ @CalledByNative
+ private void addToNavigationHistory(Object history, int index, String url,
+ String virtualUrl,String originalUrl, String title, Bitmap favicon) {
+ NavigationEntry entry = new NavigationEntry(index, url, virtualUrl,
+ originalUrl, title, favicon);
+ ((NavigationHistory) history).addEntry(entry);
+ }
+
+ @Override
+ public void clearSslPreferences() {
+ if (mNativeNavigationControllerAndroid != 0) {
+ nativeClearSslPreferences(mNativeNavigationControllerAndroid);
+ }
+ }
+
+ @Override
+ public boolean getUseDesktopUserAgent() {
+ if (mNativeNavigationControllerAndroid == 0) return false;
+ return nativeGetUseDesktopUserAgent(mNativeNavigationControllerAndroid);
+ }
+
+ @Override
+ public void setUseDesktopUserAgent(boolean override, boolean reloadOnChange) {
+ if (mNativeNavigationControllerAndroid != 0) {
+ nativeSetUseDesktopUserAgent(mNativeNavigationControllerAndroid,
+ override, reloadOnChange);
+ }
+ }
+
private native boolean nativeCanGoBack(long nativeNavigationControllerAndroid);
private native boolean nativeCanGoForward(long nativeNavigationControllerAndroid);
private native void nativeLoadIfNecessary(long nativeNavigationControllerAndroid);
@@ -138,4 +223,29 @@ import org.chromium.content_public.browser.NavigationController;
boolean checkForRepost);
private native void nativeReloadIgnoringCache(long nativeNavigationControllerAndroid,
boolean checkForRepost);
+ private native void nativeLoadUrl(
+ long nativeNavigationControllerAndroid,
+ String url,
+ int loadUrlType,
+ int transitionType,
+ String referrerUrl,
+ int referrerPolicy,
+ int uaOverrideOption,
+ String extraHeaders,
+ byte[] postData,
+ String baseUrlForDataUrl,
+ String virtualUrlForDataUrl,
+ boolean canLoadLocalResources,
+ boolean isRendererInitiated);
+ private native void nativeClearHistory(long nativeNavigationControllerAndroid);
+ private native int nativeGetNavigationHistory(long nativeNavigationControllerAndroid,
+ Object history);
+ private native void nativeGetDirectedNavigationHistory(long nativeNavigationControllerAndroid,
+ NavigationHistory history, boolean isForward, int itemLimit);
+ private native String nativeGetOriginalUrlForVisibleNavigationEntry(
+ long nativeNavigationControllerAndroid);
+ private native void nativeClearSslPreferences(long nativeNavigationControllerAndroid);
+ private native boolean nativeGetUseDesktopUserAgent(long nativeNavigationControllerAndroid);
+ private native void nativeSetUseDesktopUserAgent(long nativeNavigationControllerAndroid,
+ boolean override, boolean reloadOnChange);
}
diff --git a/content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java b/content/public/android/java/src/org/chromium/content_public/browser/LoadUrlParams.java
index db48442..a8457bf 100644
--- a/content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java
+++ b/content/public/android/java/src/org/chromium/content_public/browser/LoadUrlParams.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.content.browser;
+package org.chromium.content_public.browser;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
@@ -12,7 +12,7 @@ import java.util.Locale;
import java.util.Map;
/**
- * Holds parameters for ContentViewCore.LoadUrl. Parameters should match
+ * Holds parameters for NavigationController.LoadUrl. Parameters should match
* counterparts in NavigationController::LoadURLParams, including default
* values.
*/
@@ -259,7 +259,7 @@ public class LoadUrlParams {
* exploded form through setExtraHeaders(). Embedders that work with extra headers in opaque
* collapsed form can use the setVerbatimHeaders() / getVerbatimHeaders() instead.
*/
- String getExtraHeadersString() {
+ public String getExtraHeadersString() {
return getExtraHeadersString("\n", false);
}
@@ -314,6 +314,14 @@ public class LoadUrlParams {
}
/**
+ * Get user agent override option of this load. Defaults to UA_OVERRIDE_INHERIT.
+ * @param uaOption One of UA_OVERRIDE static constants above.
+ */
+ public int getUserAgentOverrideOption() {
+ return mUaOverrideOption;
+ }
+
+ /**
* Set the post data of this load. This field is ignored unless load type is
* LOAD_TYPE_BROWSER_INITIATED_HTTP_POST.
* @param postData Post data for this http post load.
@@ -340,6 +348,15 @@ public class LoadUrlParams {
}
/**
+ * Get the virtual url for data load. It is the url displayed to the user.
+ * It is ignored unless load type is LOAD_TYPE_DATA.
+ * @return The virtual url for this data load.
+ */
+ public String getVirtualUrlForDataUrl() {
+ return mVirtualUrlForDataUrl;
+ }
+
+ /**
* Set the virtual url for data load. It is the url displayed to the user.
* It is ignored unless load type is LOAD_TYPE_DATA.
* @param virtualUrl The virtual url for this data load.
@@ -356,6 +373,14 @@ public class LoadUrlParams {
mCanLoadLocalResources = canLoad;
}
+ /**
+ * Get whether the load should be able to access local resources. This
+ * defaults to false.
+ */
+ public boolean getCanLoadLocalResources() {
+ return mCanLoadLocalResources;
+ }
+
public int getLoadUrlType() {
return mLoadUrlType;
}
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/NavigationController.java b/content/public/android/java/src/org/chromium/content_public/browser/NavigationController.java
index 28a72ca..f520d7a 100644
--- a/content/public/android/java/src/org/chromium/content_public/browser/NavigationController.java
+++ b/content/public/android/java/src/org/chromium/content_public/browser/NavigationController.java
@@ -77,4 +77,59 @@ public interface NavigationController {
* Continue the pending reload.
*/
public void continuePendingReload();
+
+ /**
+ * Load url without fixing up the url string. Consumers of NavigationController are
+ * responsible for ensuring the URL passed in is properly formatted (i.e. the
+ * scheme has been added if left off during user input).
+ * @param params Parameters for this load.
+ */
+ public void loadUrl(LoadUrlParams params);
+
+ /**
+ * Clears NavigationController's page history in both backwards and
+ * forwards directions.
+ */
+ public void clearHistory();
+
+ /**
+ * Get a copy of the navigation history of NavigationController.
+ * @return navigation history of NavigationController.
+ */
+ public NavigationHistory getNavigationHistory();
+
+ /**
+ * Get the navigation history of NavigationController from current navigation entry index
+ * with direction (forward/backward)
+ * @param isForward determines forward or backward from current index
+ * @param itemLimit maximum number of entries to be retrieved in specified
+ * diection.
+ * @return navigation history by keeping above constraints.
+ */
+ public NavigationHistory getDirectedNavigationHistory(boolean isForward, int itemLimit);
+
+ /**
+ * Get Original URL for current Navigation entry of NavigationController.
+ * @return The original request URL for the current navigation entry, or null if there is no
+ * current entry.
+ */
+ public String getOriginalUrlForVisibleNavigationEntry();
+
+ /**
+ * Clears SSL preferences for this NavigationController.
+ */
+ public void clearSslPreferences();
+
+ /**
+ * Get whether or not we're using a desktop user agent for the currently loaded page.
+ * @return true, if use a desktop user agent and false for a mobile one.
+ */
+ public boolean getUseDesktopUserAgent();
+
+ /**
+ * Set whether or not we're using a desktop user agent for the currently loaded page.
+ * @param override If true, use a desktop user agent. Use a mobile one otherwise.
+ * @param reloadOnChange Reload the page if the UA has changed.
+ */
+ public void setUseDesktopUserAgent(boolean override, boolean reloadOnChange);
}
diff --git a/content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java b/content/public/android/java/src/org/chromium/content_public/browser/NavigationEntry.java
index 605c011..b0295bf 100644
--- a/content/public/android/java/src/org/chromium/content/browser/NavigationEntry.java
+++ b/content/public/android/java/src/org/chromium/content_public/browser/NavigationEntry.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.content.browser;
+package org.chromium.content_public.browser;
import android.graphics.Bitmap;
@@ -21,7 +21,7 @@ public class NavigationEntry {
/**
* Default constructor.
*/
- protected NavigationEntry(int index, String url, String virtualUrl, String originalUrl,
+ public NavigationEntry(int index, String url, String virtualUrl, String originalUrl,
String title, Bitmap favicon) {
mIndex = index;
mUrl = url;
diff --git a/content/public/android/java/src/org/chromium/content/browser/NavigationHistory.java b/content/public/android/java/src/org/chromium/content_public/browser/NavigationHistory.java
index 6e4347b..6338738ac 100644
--- a/content/public/android/java/src/org/chromium/content/browser/NavigationHistory.java
+++ b/content/public/android/java/src/org/chromium/content_public/browser/NavigationHistory.java
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.content.browser;
+package org.chromium.content_public.browser;
+
+//import org.chromium.content_public.browser.NavigationEntry;
import java.util.ArrayList;
@@ -16,11 +18,11 @@ public class NavigationHistory {
private final ArrayList<NavigationEntry> mEntries = new ArrayList<NavigationEntry>();
private int mCurrentEntryIndex;
- protected void addEntry(NavigationEntry entry) {
+ public void addEntry(NavigationEntry entry) {
mEntries.add(entry);
}
- /* package */ void setCurrentEntryIndex(int currentEntryIndex) {
+ public void setCurrentEntryIndex(int currentEntryIndex) {
mCurrentEntryIndex = currentEntryIndex;
}
diff --git a/content/public/android/java/src/org/chromium/content/browser/PageTransitionTypes.template b/content/public/android/java/src/org/chromium/content_public/browser/PageTransitionTypes.template
index 97cfeab..513331a 100644
--- a/content/public/android/java/src/org/chromium/content/browser/PageTransitionTypes.template
+++ b/content/public/android/java/src/org/chromium/content_public/browser/PageTransitionTypes.template
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.content.browser;
+package org.chromium.content_public.browser;
public class PageTransitionTypes {
#define PAGE_TRANSITION(label, value) public static final int \
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewLocationTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewLocationTest.java
index 041a9a9..0ccd0b2 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewLocationTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewLocationTest.java
@@ -12,6 +12,7 @@ import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.MockLocationProvider;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_shell_apk.ContentShellTestBase;
/**
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java
index ec32f16..2313190 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java
@@ -8,9 +8,14 @@ import android.util.Log;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_shell_apk.ContentShellActivity;
import org.chromium.content_shell_apk.ContentShellTestBase;
+/**
+ * Provides test environment for ContentView Test Shell.
+ * This is a helper class for Content Shell tests.
+*/
public class ContentViewTestBase extends ContentShellTestBase {
protected TestCallbackHelperContainer mTestCallbackHelperContainer;
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java b/content/public/android/javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java
index 7e42be7..ed8ec23 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java
@@ -15,10 +15,15 @@ import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPageFinishedHelper;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_shell_apk.ContentShellTestBase;
import java.util.concurrent.TimeUnit;
+/**
+ * Provides test environment for Gesture Detector Reset for Content Shell.
+ * This is a helper class for Content Shell tests.
+*/
public class GestureDetectorResetTest extends ContentShellTestBase {
private static final long WAIT_TIMEOUT_SECONDS = scaleTimeout(2);
private static final String CLICK_TEST_URL = UrlUtils.encodeHtmlDataUri(
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeTestBase.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeTestBase.java
index 68f65eb..bcf40c2 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeTestBase.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeTestBase.java
@@ -6,6 +6,8 @@ package org.chromium.content.browser;
import junit.framework.Assert;
+import org.chromium.content_public.browser.LoadUrlParams;
+
/**
* Common functionality for testing the Java Bridge.
*/
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.java b/content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.java
index b0e2730..a2037b5 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/NavigationTest.java
@@ -10,6 +10,8 @@ import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper;
+import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.content_public.browser.NavigationHistory;
import org.chromium.content_shell_apk.ContentShellActivity;
import org.chromium.content_shell_apk.ContentShellTestBase;
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java
index a9035b7..086efd1 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java
@@ -10,6 +10,7 @@ import android.util.Pair;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.NavigationTransitionDelegate;
import org.chromium.content_shell_apk.ContentShellActivity;
import org.chromium.content_shell_apk.ContentShellTestBase;
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/WebContentsObserverAndroidTest.java b/content/public/android/javatests/src/org/chromium/content/browser/WebContentsObserverAndroidTest.java
index d691856..6eb7309 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/WebContentsObserverAndroidTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/WebContentsObserverAndroidTest.java
@@ -10,6 +10,7 @@ import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.CallbackHelper;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_shell_apk.ContentShellActivity;
import org.chromium.content_shell_apk.ContentShellTestBase;
diff --git a/content/public/browser/android/content_view_core.h b/content/public/browser/android/content_view_core.h
index 5507571..318de72 100644
--- a/content/public/browser/android/content_view_core.h
+++ b/content/public/browser/android/content_view_core.h
@@ -48,7 +48,6 @@ class CONTENT_EXPORT ContentViewCore {
virtual ui::ViewAndroid* GetViewAndroid() const = 0;
virtual ui::WindowAndroid* GetWindowAndroid() const = 0;
virtual scoped_refptr<cc::Layer> GetLayer() const = 0;
- virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0;
virtual void ShowPastePopup(int x, int y) = 0;
// Request a scaled content readback. The result is passed through the
diff --git a/content/shell/android/java/src/org/chromium/content_shell/Shell.java b/content/shell/android/java/src/org/chromium/content_shell/Shell.java
index 8c635f3..5223bfe 100644
--- a/content/shell/android/java/src/org/chromium/content_shell/Shell.java
+++ b/content/shell/android/java/src/org/chromium/content_shell/Shell.java
@@ -26,7 +26,7 @@ import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.ContentViewRenderView;
-import org.chromium.content.browser.LoadUrlParams;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.ui.base.WindowAndroid;
/**
diff --git a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java
index e57807b..4ba3cc9 100644
--- a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java
+++ b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java
@@ -17,11 +17,11 @@ import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.ContentViewCore;
-import org.chromium.content.browser.LoadUrlParams;
import org.chromium.content.browser.test.util.CallbackHelper;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
+import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_shell.Shell;
import java.lang.annotation.ElementType;