Chromium Code Reviews| 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..6b792a539ec5a65e1a473e09f932d5171d7d4e30 |
| --- /dev/null |
| +++ b/media/base/android/dialog_surface_manager.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_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/process/process_handle.h" |
| +#include "base/time/time.h" |
| +#include "media/base/android/dialog_surface.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 DialogSurface::Callback; |
| + * controller = DialogSurfaceManager::GetPointer()->CreateSurface(callback); |
|
watk
2016/07/26 21:34:30
controller?
liberato (no reviews please)
2016/07/26 22:49:16
Done.
|
| + * (wait for callback) |
| + * controller->GetSurface() |
| + * if (i_want_to_change_the_layout_) |
| + * controller->ScheduleLayout(new_position_and_size); |
|
watk
2016/07/26 21:34:30
ScheduleLayout doesn't exist?
liberato (no reviews please)
2016/07/26 22:49:16
only because i removed it for this cl. it'll be b
|
| + * |
| + */ |
| +class MEDIA_EXPORT DialogSurfaceManager { |
| + public: |
| + static DialogSurfaceManager* GetPointer(); |
| + |
| + using Config = DialogSurface::Config; |
| + |
| + std::unique_ptr<DialogSurface> CreateSurface(base::ProcessHandle pid, |
|
watk
2016/07/26 21:34:30
I think we needc docs on pid and frame_id
liberato (no reviews please)
2016/07/26 22:49:16
Done.
|
| + int frame_id, |
| + const Config&, |
| + const DialogSurface::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_ |