OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_ANDROID_DIALOG_OVERLAY_OPERATIONS_IMPL_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_DIALOG_OVERLAY_OPERATIONS_IMPL_H_ |
| 7 |
| 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/unguessable_token.h" |
| 11 #include "content/browser/android/content_view_core_impl.h" |
| 12 #include "content/browser/android/content_view_core_impl_observer.h" |
| 13 |
| 14 namespace content { |
| 15 |
| 16 // Native counterpart to DialogOverlayOperationsImpl java class. This is |
| 17 // created by the java class. When the ContentViewCore for the provided token |
| 18 // is attached to or detached from a WindowAndroid, we get the Android window |
| 19 // token and notify the java class. |
| 20 class DialogOverlayOperationsImpl : public ContentViewCoreImplObserver { |
| 21 public: |
| 22 // Registers the JNI methods for ContentViewRender. |
| 23 static bool RegisterDialogOverlayOperationsImpl(JNIEnv* env); |
| 24 |
| 25 DialogOverlayOperationsImpl( |
| 26 const base::android::JavaParamRef<jobject>& receiver, |
| 27 const base::UnguessableToken& token); |
| 28 |
| 29 ~DialogOverlayOperationsImpl() override; |
| 30 |
| 31 // ContentViewCoreImplObserver |
| 32 void OnContentViewCoreDestroyed() override; |
| 33 void OnAttachedToWindow() override; |
| 34 void OnDetachedFromWindow() override; |
| 35 |
| 36 private: |
| 37 // Look up the ContentViewCore for |renderer_pid_| and |render_frame_id_|. |
| 38 ContentViewCoreImpl* GetContentViewCore(); |
| 39 |
| 40 private: |
| 41 // Java object that owns us. |
| 42 base::android::ScopedJavaGlobalRef<jobject> receiver_; |
| 43 |
| 44 base::UnguessableToken token_; |
| 45 ContentViewCoreImpl* cvc_; |
| 46 }; |
| 47 |
| 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_BROWSER_ANDROID_DIALOG_OVERLAY_OPERATIONS_IMPL_H_ |
OLD | NEW |