Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 MEDIA_BASE_ANDROID_DIALOG_SURFACE_MANAGER_H_ | |
| 6 #define MEDIA_BASE_ANDROID_DIALOG_SURFACE_MANAGER_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 #include <stddef.h> | |
| 10 #include <stdint.h> | |
| 11 | |
| 12 #include <set> | |
| 13 #include <string> | |
| 14 | |
| 15 #include "base/android/scoped_java_ref.h" | |
| 16 #include "base/lazy_instance.h" | |
| 17 #include "base/macros.h" | |
| 18 #include "base/process/process_handle.h" | |
| 19 #include "base/time/time.h" | |
| 20 #include "media/base/android/dialog_surface.h" | |
| 21 #include "media/base/media_export.h" | |
| 22 #include "ui/gfx/geometry/point.h" | |
| 23 #include "ui/gfx/geometry/size.h" | |
| 24 | |
| 25 namespace media { | |
| 26 | |
| 27 /** | |
|
DaleCurtis
2016/07/27 18:14:20
Prefer //
liberato (no reviews please)
2016/07/28 15:33:30
Done.
| |
| 28 * This class implements the C++ wrapper around the java DialogSurfaceManager. | |
| 29 * Typical usage is: | |
| 30 * | |
| 31 * callback = something that is a DialogSurface::Callback; | |
| 32 * surface = DialogSurfaceManager::GetPointer()->CreateSurface(callback); | |
| 33 * (wait for callback) | |
| 34 * surface->GetSurface() | |
| 35 * if (i_want_to_change_the_layout_) | |
| 36 * surface->ScheduleLayout(new_position_and_size); | |
| 37 * | |
| 38 */ | |
| 39 class MEDIA_EXPORT DialogSurfaceManager { | |
| 40 public: | |
| 41 static DialogSurfaceManager* GetPointer(); | |
|
DaleCurtis
2016/07/27 18:14:20
Generally GetInstance or just Get().
liberato (no reviews please)
2016/07/28 15:33:30
LazyInstance uses Pointer() for T*, Get for T&. D
| |
| 42 | |
| 43 using Config = DialogSurface::Config; | |
| 44 | |
| 45 /** | |
|
DaleCurtis
2016/07/27 18:14:20
Ditto. @param I don't think is used either in Chro
liberato (no reviews please)
2016/07/28 15:33:30
Done.
| |
| 46 * @param pid pid of the renderer that this DialogSurface goes with | |
| 47 * @param frame_id render_frame_id of the render frame that this goes with. | |
| 48 */ | |
| 49 std::unique_ptr<DialogSurface> CreateSurface(base::ProcessHandle pid, | |
|
DaleCurtis
2016/07/27 18:14:20
Chromium doesn't typically elide parameter names,
liberato (no reviews please)
2016/07/28 15:33:30
Done.
| |
| 50 int frame_id, | |
| 51 const Config&, | |
| 52 const DialogSurface::Callback&); | |
| 53 | |
| 54 static bool RegisterDialogSurfaceManager(JNIEnv* env); | |
| 55 | |
| 56 protected: | |
| 57 DialogSurfaceManager(); | |
| 58 ~DialogSurfaceManager(); | |
| 59 | |
| 60 private: | |
| 61 friend struct base::DefaultLazyInstanceTraits<DialogSurfaceManager>; | |
| 62 | |
| 63 // Java DialogSurfaceManagerWrapper instance. | |
| 64 base::android::ScopedJavaGlobalRef<jobject> j_wrapped_manager_; | |
| 65 | |
| 66 DISALLOW_COPY_AND_ASSIGN(DialogSurfaceManager); | |
| 67 }; | |
| 68 | |
| 69 } // namespace media | |
| 70 | |
| 71 #endif // MEDIA_BASE_ANDROID_DIALOG_SURFACE_MANAGER_H_ | |
| OLD | NEW |