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

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

Issue 14018004: [Android] Refactor NativeView to be able to use it for AutofillDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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 3aff87e3169ff02c913f7b14a17f49d677555fad..4cd74b8691271fe35190fd5587e7d90238553ca4 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -45,6 +45,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/android/WebInputEventFactory.h"
+#include "ui/android/view_android.h"
#include "ui/android/window_android.h"
#include "ui/gfx/android/java_bitmap.h"
#include "ui/gfx/screen.h"
@@ -152,12 +153,14 @@ ContentViewCoreImpl::ContentViewCoreImpl(JNIEnv* env, jobject obj,
bool hardware_accelerated,
bool input_events_delivered_at_vsync,
WebContents* web_contents,
+ ui::ViewAndroid* view_android,
ui::WindowAndroid* window_android)
: java_ref_(env, obj),
web_contents_(static_cast<WebContentsImpl*>(web_contents)),
root_layer_(cc::Layer::Create()),
tab_crashed_(false),
input_events_delivered_at_vsync_(input_events_delivered_at_vsync),
+ view_android_(view_android),
window_android_(window_android) {
CHECK(web_contents) <<
"A ContentViewCoreImpl should be created with a valid WebContents.";
@@ -309,14 +312,6 @@ ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetJavaObject() {
return java_ref_.get(env);
}
-ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContainerViewDelegate() {
- JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
- if (obj.is_null())
- return ScopedJavaLocalRef<jobject>();
- return Java_ContentViewCore_getContainerViewDelegate(env, obj.obj());
-}
-
void ContentViewCoreImpl::OnWebPreferencesUpdated() {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
@@ -710,6 +705,12 @@ void ContentViewCoreImpl::SetVSyncNotificationEnabled(bool enabled) {
env, obj.obj(), static_cast<jboolean>(enabled));
}
+ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const {
+ // view_android_ should never be null for Chrome.
+ DCHECK(view_android_);
+ return view_android_;
+}
+
ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const {
// This should never be NULL for Chrome, but will be NULL for WebView.
DCHECK(window_android_);
@@ -1519,11 +1520,13 @@ jint Init(JNIEnv* env, jobject obj,
jboolean input_events_delivered_at_vsync,
jboolean hardware_accelerated,
jint native_web_contents,
- jint native_window) {
+ jint view_android,
+ jint window_android) {
ContentViewCoreImpl* view = new ContentViewCoreImpl(
env, obj, input_events_delivered_at_vsync, hardware_accelerated,
reinterpret_cast<WebContents*>(native_web_contents),
- reinterpret_cast<ui::WindowAndroid*>(native_window));
+ reinterpret_cast<ui::ViewAndroid*>(view_android),
+ reinterpret_cast<ui::WindowAndroid*>(window_android));
return reinterpret_cast<jint>(view);
}
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698