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

Side by Side Diff: content/browser/nfc/nfc_host.h

Issue 2865653002: [Device Service] Decouple NFC implementation from //content (Closed)
Patch Set: Response to review + fix for tests that don't actually run on bots Created 3 years, 7 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 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 #ifndef CONTENT_BROWSER_NFC_NFC_HOST_H_
6 #define CONTENT_BROWSER_NFC_NFC_HOST_H_
7
8 #include "content/public/browser/web_contents.h"
9 #include "device/nfc/nfc_provider.mojom.h"
10
11 #if defined(OS_ANDROID)
12 #include "base/android/jni_android.h"
13 #endif
14 namespace content {
15
16 // On Android, NFC requires the Activity associated with the context in order to
17 // access the NFC system APIs. NFCHost provides this functionality by mapping
18 // NFC context IDs to the WebContents associated with those IDs.
19 class NFCHost {
20 public:
21 explicit NFCHost(WebContents* web_contents);
22 ~NFCHost();
23
24 void GetNFC(device::nfc::mojom::NFCRequest request);
25
26 private:
27 // This instance's ID (passed to the NFC implementation via |nfc_provider_|
28 // and used from the implementation to map back to this object).
29 int id_;
30
31 // The WebContents that owns this instance.
32 WebContents* web_contents_;
33
34 device::nfc::mojom::NFCProviderPtr nfc_provider_;
35
36 #if defined(OS_ANDROID)
37 base::android::ScopedJavaGlobalRef<jobject> java_nfc_host_;
38 #endif
39
40 DISALLOW_COPY_AND_ASSIGN(NFCHost);
41 };
42
43 } // namespace content
44
45 #endif // CONTENT_BROWSER_NFC_NFC_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698