| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 | 8 |
| 9 import org.chromium.content_public.browser.WebContents; | 9 import org.chromium.content_public.browser.WebContents; |
| 10 import org.chromium.device.nfc.NfcImpl; | 10 import org.chromium.device.nfc.NfcImpl; |
| 11 import org.chromium.device.nfc.mojom.Nfc; | 11 import org.chromium.device.nfc.mojom.Nfc; |
| 12 import org.chromium.services.shell.InterfaceFactory; | 12 import org.chromium.services.service_manager.InterfaceFactory; |
| 13 import org.chromium.ui.base.WindowAndroid; | 13 import org.chromium.ui.base.WindowAndroid; |
| 14 | 14 |
| 15 class NfcFactory implements InterfaceFactory<Nfc> { | 15 class NfcFactory implements InterfaceFactory<Nfc> { |
| 16 private final WebContents mContents; | 16 private final WebContents mContents; |
| 17 | 17 |
| 18 NfcFactory(WebContents contents) { | 18 NfcFactory(WebContents contents) { |
| 19 mContents = contents; | 19 mContents = contents; |
| 20 } | 20 } |
| 21 | 21 |
| 22 private static class ContextAwareNfcImpl | 22 private static class ContextAwareNfcImpl |
| (...skipping 29 matching lines...) Expand all Loading... |
| 52 | 52 |
| 53 @Override | 53 @Override |
| 54 public Nfc createImpl() { | 54 public Nfc createImpl() { |
| 55 ContentViewCore contentViewCore = ContentViewCore.fromWebContents(mConte
nts); | 55 ContentViewCore contentViewCore = ContentViewCore.fromWebContents(mConte
nts); |
| 56 if (contentViewCore == null) { | 56 if (contentViewCore == null) { |
| 57 return null; | 57 return null; |
| 58 } | 58 } |
| 59 return new ContextAwareNfcImpl(contentViewCore); | 59 return new ContextAwareNfcImpl(contentViewCore); |
| 60 } | 60 } |
| 61 } | 61 } |
| OLD | NEW |