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

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

Issue 1967553002: DO NOT COMMIT - DialogSurface initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added check for gpu process for dialog surface manager. Created 4 years, 6 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/dialog_surface_manager.h
diff --git a/media/base/android/dialog_surface_manager.h b/media/base/android/dialog_surface_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..cbcc4395143d5a8cdd04c11c9e883f5a752af84e
--- /dev/null
+++ b/media/base/android/dialog_surface_manager.h
@@ -0,0 +1,65 @@
+// 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_DIALOG_SURFACE_MANAGER_H_
+#define MEDIA_BASE_ANDROID_DIALOG_SURFACE_MANAGER_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/time/time.h"
+#include "media/base/android/dialog_surface_controller.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 DialogSurfaceManager.
+ * Typical usage is:
+ *
+ * callback = something that is a DialogSurfaceController::Callback;
+ * controller = DialogSurfaceManager::GetPointer()->CreateSurface(callback);
+ * (wait for callback)
+ * controller->GetSurface()
+ * if (i_want_to_change_the_layout_)
+ * controller->ScheduleLayout(new_position_and_size);
+ *
+ */
+class MEDIA_EXPORT DialogSurfaceManager {
+ public:
+ static DialogSurfaceManager* GetPointer();
+
+ using Config = DialogSurfaceController::Config;
+
+ std::unique_ptr<DialogSurfaceController> CreateSurface(
+ const Config&,
+ const DialogSurfaceController::Callback&);
+
+ static bool RegisterDialogSurfaceManager(JNIEnv* env);
+
+ protected:
+ DialogSurfaceManager();
+ ~DialogSurfaceManager();
+
+ private:
+ friend struct base::DefaultLazyInstanceTraits<DialogSurfaceManager>;
+
+ // Java DialogSurfaceManagerWrapper instance.
+ base::android::ScopedJavaGlobalRef<jobject> j_wrapped_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(DialogSurfaceManager);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_ANDROID_DIALOG_SURFACE_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698