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

Unified Diff: media/base/android/android_overlay_provider_proxy.h

Issue 2178973004: DialogSurfaceManager implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 3 years, 10 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: media/base/android/android_overlay_provider_proxy.h
diff --git a/media/base/android/android_overlay_provider_proxy.h b/media/base/android/android_overlay_provider_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..2103537dfcbd84aa87c7db1d952b4a5a4fdec272
--- /dev/null
+++ b/media/base/android/android_overlay_provider_proxy.h
@@ -0,0 +1,67 @@
+// Copyright 2016 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 MEDIA_BASE_ANDROID_ANDROID_OVERLAY_PROVIDER_PROXY_H_
+#define MEDIA_BASE_ANDROID_ANDROID_OVERLAY_PROVIDER_PROXY_H_
+
+#include <jni.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <set>
+#include <string>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/lazy_instance.h"
+#include "base/macros.h"
+#include "base/process/process_handle.h"
+#include "base/time/time.h"
+#include "media/base/android/android_overlay_proxy.h"
+#include "media/base/media_export.h"
+#include "ui/gfx/geometry/point.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace media {
+
+// This class implements the C++ wrapper around the java
+// AndroidOverlayProviderProxy.
+// Typical usage is:
+//
+// callback = something that is a AndroidOverlayProvider::Callback;
+// unique_ptr<AndroidOverlay> surface =
+// AndroidOverlayProviderProxy::GetPointer()->CreateSurface(callback);
+// (wait for callback)
+// surface->GetSurface()
+// if (i_want_to_change_the_layout_)
+// surface->ScheduleLayout(new_position_and_size);
+class MEDIA_EXPORT AndroidOverlayProviderProxy {
+ public:
+ // Return singleton manager instance.
+ static AndroidOverlayProviderProxy* Get();
+
+ using Config = AndroidOverlayProxy::Config;
+
+ // Create an overlay for renderer frame owned by renderer |pid|, and id
+ // |render_frame_id|. May return null.
+ std::unique_ptr<AndroidOverlayProxy> CreateOverlay(
+ base::ProcessHandle pid,
+ int render_frame_id,
+ const Config& config,
+ const AndroidOverlayProxy::Callback& cb);
+
+ private:
+ AndroidOverlayProviderProxy();
+ ~AndroidOverlayProviderProxy();
+
+ friend struct base::DefaultLazyInstanceTraits<AndroidOverlayProviderProxy>;
+
+ // Java AndroidOverlayProviderProxy instance.
+ base::android::ScopedJavaGlobalRef<jobject> j_wrapped_provider_;
+
+ DISALLOW_COPY_AND_ASSIGN(AndroidOverlayProviderProxy);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_ANDROID_ANDROID_OVERLAY_PROVIDER_PROXY_H_

Powered by Google App Engine
This is Rietveld 408576698