| Index: content/browser/android/dialog_overlay_operations_impl.h
|
| diff --git a/content/browser/android/dialog_overlay_operations_impl.h b/content/browser/android/dialog_overlay_operations_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a8a7b4789923e38a6a48d52d0cf787ace7f0db8a
|
| --- /dev/null
|
| +++ b/content/browser/android/dialog_overlay_operations_impl.h
|
| @@ -0,0 +1,55 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CONTENT_BROWSER_ANDROID_DIALOG_OVERLAY_OPERATIONS_IMPL_H_
|
| +#define CONTENT_BROWSER_ANDROID_DIALOG_OVERLAY_OPERATIONS_IMPL_H_
|
| +
|
| +#include "base/android/jni_android.h"
|
| +#include "base/android/scoped_java_ref.h"
|
| +#include "base/unguessable_token.h"
|
| +#include "content/browser/android/content_view_core_impl.h"
|
| +#include "content/browser/android/content_view_core_impl_observer.h"
|
| +
|
| +namespace content {
|
| +
|
| +// Native counterpart to DialogOverlayOperationsImpl java class. This is
|
| +// created by the java class. When the ContentViewCore for the provided token
|
| +// is attached to or detached from a WindowAndroid, we get the Android window
|
| +// token and notify the java class.
|
| +class DialogOverlayOperationsImpl : public ContentViewCoreImplObserver {
|
| + public:
|
| + // Registers the JNI methods for DialogOverlayOperationsImpl.
|
| + static bool RegisterDialogOverlayOperationsImpl(JNIEnv* env);
|
| +
|
| + DialogOverlayOperationsImpl(
|
| + const base::android::JavaParamRef<jobject>& receiver,
|
| + const base::UnguessableToken& token);
|
| +
|
| + ~DialogOverlayOperationsImpl() override;
|
| +
|
| + // ContentViewCoreImplObserver
|
| + void OnContentViewCoreDestroyed() override;
|
| + void OnAttachedToWindow() override;
|
| + void OnDetachedFromWindow() override;
|
| +
|
| + // Unregister for tokens if we're registered, and clear |cvc_|.
|
| + void UnregisterForTokensIfNeeded();
|
| +
|
| + private:
|
| + // Look up the ContentViewCore for |renderer_pid_| and |render_frame_id_|.
|
| + ContentViewCoreImpl* GetContentViewCore();
|
| +
|
| + private:
|
| + // Java object that owns us.
|
| + base::android::ScopedJavaGlobalRef<jobject> receiver_;
|
| +
|
| + base::UnguessableToken token_;
|
| +
|
| + // ContentViewCoreImpl instance that we're registered with as an observer.
|
| + ContentViewCoreImpl* cvc_;
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_ANDROID_DIALOG_OVERLAY_OPERATIONS_IMPL_H_
|
|
|