OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 package org.chromium.content.browser.androidoverlay; | |
6 | |
7 import android.content.Context; | |
8 | |
9 import org.chromium.media.mojom.AndroidOverlayClient; | |
10 import org.chromium.media.mojom.AndroidOverlayConfig; | |
11 import org.chromium.media.mojom.AndroidOverlayProvider; | |
12 import org.chromium.mojo.system.MojoException; | |
13 import org.chromium.services.service_manager.InterfaceFactory; | |
14 | |
15 /** | |
16 * Default impl of AndroidOverlayProvider. Creates AndroidOverlayImpls. | |
17 */ | |
18 public class AndroidOverlayProviderImpl implements AndroidOverlayProvider { | |
19 private static final String TAG = "AndroidOverlayProvider"; | |
20 | |
21 /** | |
22 * Create an overlay matching |config| and send it to |client|. Remember th at potentially many | |
23 * providers are created. | |
24 */ | |
25 public void createOverlay(AndroidOverlayClient client, AndroidOverlayConfig config) { | |
dcheng
2017/02/28 05:22:03
Normally, it's best to implement the interface in
liberato (no reviews please)
2017/03/06 07:51:04
i'll pick option 2. :)
the reason is that this i
| |
26 // We could also call |client.onInitialized| to succeed for example: | |
27 // AndroidOverlayImpl overlay = new AndroidOverlayImpl(client, config); | |
28 // client.onInitialized(overlay); | |
29 client.onDestroyed(); | |
30 } | |
31 | |
32 @Override | |
33 public void close() {} | |
34 | |
35 @Override | |
36 public void onConnectionError(MojoException e) {} | |
37 | |
38 /** | |
39 * Mojo factory. | |
40 */ | |
41 public static class Factory implements InterfaceFactory<AndroidOverlayProvid er> { | |
42 public Factory(Context context) {} | |
43 | |
44 @Override | |
45 public AndroidOverlayProvider createImpl() { | |
46 return new AndroidOverlayProviderImpl(); | |
47 } | |
48 } | |
49 } | |
OLD | NEW |