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

Side by Side Diff: ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.h

Issue 2231983002: Expose Physical Web data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address mattreynolds comments Created 4 years, 3 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
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 #ifndef IOS_CHROME_COMMON_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_ 5 #ifndef IOS_CHROME_COMMON_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_
6 #define IOS_CHROME_COMMON_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_ 6 #define IOS_CHROME_COMMON_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #import "base/mac/scoped_nsobject.h" 9 #import "base/mac/scoped_nsobject.h"
10 #include "components/physical_web/data_source/physical_web_data_source.h" 10 #include "components/physical_web/data_source/physical_web_data_source.h"
11 11
12 namespace base { 12 namespace base {
13 class ListValue; 13 class ListValue;
14 } 14 }
15 15
16 @class PhysicalWebScanner; 16 @class PhysicalWebScanner;
17 class PhysicalWebListener;
mattreynolds 2016/08/23 21:38:11 Let's move this up with the ListValue declaration
17 18
18 // iOS implementation of PhysicalWebDataSource 19 // iOS implementation of PhysicalWebDataSource
19 class IOSChromePhysicalWebDataSource : public PhysicalWebDataSource { 20 class IOSChromePhysicalWebDataSource : public PhysicalWebDataSource {
20 public: 21 public:
21 IOSChromePhysicalWebDataSource(); 22 IOSChromePhysicalWebDataSource();
22 ~IOSChromePhysicalWebDataSource() override; 23 ~IOSChromePhysicalWebDataSource() override;
23 24
24 // Starts scanning for Physical Web URLs. If |network_request_enabled| is 25 // Starts scanning for Physical Web URLs. If |network_request_enabled| is
25 // true, discovered URLs will be sent to a resolution service. 26 // true, discovered URLs will be sent to a resolution service.
26 void StartDiscovery(bool network_request_enabled) override; 27 void StartDiscovery(bool network_request_enabled) override;
27 28
28 // Stops scanning for Physical Web URLs and clears cached URL content. 29 // Stops scanning for Physical Web URLs and clears cached URL content.
29 void StopDiscovery() override; 30 void StopDiscovery() override;
30 31
31 // Returns a list of resolved URLs and associated page metadata. If network 32 // Returns a list of resolved URLs and associated page metadata. If network
32 // requests are disabled, the list will be empty. 33 // requests are disabled, the list will be empty.
33 std::unique_ptr<base::ListValue> GetMetadata() override; 34 std::unique_ptr<base::ListValue> GetMetadata() override;
34 35
35 // Returns boolean |true| if network requests are disabled and there are one 36 // Returns boolean |true| if network requests are disabled and there are one
36 // or more discovered URLs that have not been sent to the resolution service. 37 // or more discovered URLs that have not been sent to the resolution service.
37 bool HasUnresolvedDiscoveries() override; 38 bool HasUnresolvedDiscoveries() override;
38 39
40 // Register for changes to Physical Web URLs and associated page metadata.
41 void RegisterListener(PhysicalWebListener* physical_web_listener) override;
42
43 // Unregister for changes to Physical Web URLs and associated page metadata.
44 void UnregisterListener(PhysicalWebListener* physical_web_listener) override;
45
39 private: 46 private:
40 // Scanner for nearby Physical Web URL devices. 47 // Scanner for nearby Physical Web URL devices.
41 base::scoped_nsobject<PhysicalWebScanner> scanner_; 48 base::scoped_nsobject<PhysicalWebScanner> scanner_;
42 49
43 DISALLOW_COPY_AND_ASSIGN(IOSChromePhysicalWebDataSource); 50 DISALLOW_COPY_AND_ASSIGN(IOSChromePhysicalWebDataSource);
44 }; 51 };
45 52
46 #endif // IOS_CHROME_COMMON_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_ 53 #endif // IOS_CHROME_COMMON_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698