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

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

Issue 2865653002: [Device Service] Decouple NFC implementation from //content (Closed)
Patch Set: Response to reviews 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_
Ted C 2017/05/10 14:37:40 In the same vein as the ifdef comments, should thi
blundell 2017/05/11 15:13:51 Moved to //content/browser/android. Didn't put in
6 #define CONTENT_BROWSER_NFC_NFC_HOST_H_
7
8 #include "base/android/jni_android.h"
9 #include "content/public/browser/web_contents.h"
10 #include "device/nfc/nfc_provider.mojom.h"
11
12 namespace content {
13
14 // On Android, NFC requires the Activity associated with the context in order to
15 // access the NFC system APIs. NFCHost provides this functionality by mapping
16 // NFC context IDs to the WebContents associated with those IDs.
17 class NFCHost {
18 public:
19 explicit NFCHost(WebContents* web_contents);
20 ~NFCHost();
21
22 void GetNFC(device::nfc::mojom::NFCRequest request);
23
24 private:
25 // This instance's ID (passed to the NFC implementation via |nfc_provider_|
26 // and used from the implementation to map back to this object).
27 int id_;
28
29 // The WebContents that owns this instance.
30 WebContents* web_contents_;
31
32 device::nfc::mojom::NFCProviderPtr nfc_provider_;
33
34 base::android::ScopedJavaGlobalRef<jobject> java_nfc_host_;
35
36 DISALLOW_COPY_AND_ASSIGN(NFCHost);
37 };
38
39 } // namespace content
40
41 #endif // CONTENT_BROWSER_NFC_NFC_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698