Chromium Code Reviews| 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 22527a4a85ea2ecc3931bd7d032896fd0922a78e..07f0a8bc304dd17f06f09b86628e4c3fcac67a4e 100644 |
| --- a/content/browser/android/content_view_core_impl.cc |
| +++ b/content/browser/android/content_view_core_impl.cc |
| @@ -70,6 +70,12 @@ ContentViewCore* ContentViewCore::Create(JNIEnv* env, jobject obj, |
| return new ContentViewCoreImpl(env, obj, web_contents); |
| } |
| +// static |
| +ContentViewCore* ContentViewCore::FromWebContents(WebContents* web_contents) { |
| + return web_contents->GetContentNativeView(); |
| +} |
| + |
| +// static |
| ContentViewCore* ContentViewCore::GetNativeContentViewCore(JNIEnv* env, |
| jobject obj) { |
| return reinterpret_cast<ContentViewCore*>( |
| @@ -147,6 +153,21 @@ RenderWidgetHostViewAndroid* |
| return static_cast<RenderWidgetHostViewAndroid*>(rwhv); |
| } |
| +bool ContentViewCoreImpl::ShouldUseNativeJsModalDialog( |
| + JavaScriptMessageType type, |
| + bool is_before_unload_dialog, |
| + const string16& message, |
| + const string16& default_text, |
| + jobject js_result) { |
| + if (!content_view_client_.get()) |
| + return true; |
| + return !content_view_client_->OnJsModalDialog(type, |
|
joth
2012/08/15 06:11:25
this is another example of adding an awkward API o
|
| + is_before_unload_dialog, |
| + web_contents_->GetURL(), |
| + message, |
| + default_text, |
| + js_result); |
| +} |
| // ---------------------------------------------------------------------------- |
| // Methods called from Java via JNI |
| // ---------------------------------------------------------------------------- |
| @@ -564,6 +585,11 @@ void ContentViewCoreImpl::DidSetNeedTouchEvents(bool need_touch_events) { |
| need_touch_events); |
| } |
| +ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetJavaObject() { |
| + JNIEnv* env = AttachCurrentThread(); |
| + return java_ref_.get(env); |
| +} |
| + |
| bool ContentViewCoreImpl::HasFocus() { |
| NOTIMPLEMENTED() << "not upstreamed yet"; |
| return false; |