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

Side by Side 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 unified diff | Download patch
OLDNEW
(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/time/time.h"
19 #include "media/base/android/dialog_surface_controller.h"
20 #include "media/base/media_export.h"
21 #include "ui/gfx/geometry/point.h"
22 #include "ui/gfx/geometry/size.h"
23
24 namespace media {
25
26 /**
27 * This class implements the C++ wrapper around the java DialogSurfaceManager.
28 * Typical usage is:
29 *
30 * callback = something that is a DialogSurfaceController::Callback;
31 * controller = DialogSurfaceManager::GetPointer()->CreateSurface(callback);
32 * (wait for callback)
33 * controller->GetSurface()
34 * if (i_want_to_change_the_layout_)
35 * controller->ScheduleLayout(new_position_and_size);
36 *
37 */
38 class MEDIA_EXPORT DialogSurfaceManager {
39 public:
40 static DialogSurfaceManager* GetPointer();
41
42 using Config = DialogSurfaceController::Config;
43
44 std::unique_ptr<DialogSurfaceController> CreateSurface(
45 const Config&,
46 const DialogSurfaceController::Callback&);
47
48 static bool RegisterDialogSurfaceManager(JNIEnv* env);
49
50 protected:
51 DialogSurfaceManager();
52 ~DialogSurfaceManager();
53
54 private:
55 friend struct base::DefaultLazyInstanceTraits<DialogSurfaceManager>;
56
57 // Java DialogSurfaceManagerWrapper instance.
58 base::android::ScopedJavaGlobalRef<jobject> j_wrapped_manager_;
59
60 DISALLOW_COPY_AND_ASSIGN(DialogSurfaceManager);
61 };
62
63 } // namespace media
64
65 #endif // MEDIA_BASE_ANDROID_DIALOG_SURFACE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698