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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 10908285: Add WebContents accessor in ContentViewCore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 4e8d88fdfdfa8f5fc41359bc5a1f187cfadba4ee..0f57ec7123150788e271cc34ab08c3527eebeb93 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -258,16 +258,20 @@ void ContentViewCoreImpl::LoadUrl(
ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL(
JNIEnv* env, jobject) const {
- return ConvertUTF8ToJavaString(env, web_contents()->GetURL().spec());
+ return ConvertUTF8ToJavaString(env, GetWebContents()->GetURL().spec());
}
ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetTitle(
JNIEnv* env, jobject obj) const {
- return ConvertUTF16ToJavaString(env, web_contents()->GetTitle());
+ return ConvertUTF16ToJavaString(env, GetWebContents()->GetTitle());
}
jboolean ContentViewCoreImpl::IsIncognito(JNIEnv* env, jobject obj) {
- return web_contents()->GetBrowserContext()->IsOffTheRecord();
+ return GetWebContents()->GetBrowserContext()->IsOffTheRecord();
+}
+
+WebContents* ContentViewCoreImpl::GetWebContents() const {
+ return web_contents_;
}
jboolean ContentViewCoreImpl::TouchEvent(JNIEnv* env,
@@ -538,7 +542,7 @@ int ContentViewCoreImpl::GetNativeImeAdapter(JNIEnv* env, jobject obj) {
void ContentViewCoreImpl::LoadUrl(
NavigationController::LoadURLParams& params) {
- web_contents()->GetController().LoadURLWithParams(params);
+ GetWebContents()->GetController().LoadURLWithParams(params);
tab_crashed_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698