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

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

Issue 2458613004: Record the initial state of the Physical Web at startup (Closed)
Patch Set: fix retain loop Created 3 years, 11 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_BROWSER_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_ 5 #ifndef IOS_CHROME_BROWSER_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_
6 #define IOS_CHROME_BROWSER_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H_ 6 #define IOS_CHROME_BROWSER_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_impl.h" 10 #include "components/physical_web/data_source/physical_web_data_source_impl.h"
11 11
12 namespace base { 12 namespace base {
13 class ListValue; 13 class ListValue;
14 } 14 }
15 class PrefService;
15 16
16 @class PhysicalWebScanner; 17 @class PhysicalWebScanner;
18 @class PhysicalWebInitialStateRecorder;
17 19
18 // iOS implementation of PhysicalWebDataSource 20 // iOS implementation of PhysicalWebDataSource
19 class IOSChromePhysicalWebDataSource 21 class IOSChromePhysicalWebDataSource
20 : public physical_web::PhysicalWebDataSourceImpl { 22 : public physical_web::PhysicalWebDataSourceImpl {
21 public: 23 public:
22 IOSChromePhysicalWebDataSource(); 24 IOSChromePhysicalWebDataSource(PrefService* pref_service);
23 ~IOSChromePhysicalWebDataSource() override; 25 ~IOSChromePhysicalWebDataSource() override;
24 26
25 // Starts scanning for Physical Web URLs. If |network_request_enabled| is 27 // Starts scanning for Physical Web URLs. If |network_request_enabled| is
26 // true, discovered URLs will be sent to a resolution service. 28 // true, discovered URLs will be sent to a resolution service.
27 void StartDiscovery(bool network_request_enabled) override; 29 void StartDiscovery(bool network_request_enabled) override;
28 30
29 // Stops scanning for Physical Web URLs and clears cached URL content. 31 // Stops scanning for Physical Web URLs and clears cached URL content.
30 void StopDiscovery() override; 32 void StopDiscovery() override;
31 33
32 // Returns a list of resolved URLs and associated page metadata. If network 34 // Returns a list of resolved URLs and associated page metadata. If network
33 // requests are disabled, the list will be empty. 35 // requests are disabled, the list will be empty.
34 std::unique_ptr<base::ListValue> GetMetadata() override; 36 std::unique_ptr<base::ListValue> GetMetadata() override;
35 37
36 // Returns boolean |true| if network requests are disabled and there are one 38 // Returns boolean |true| if network requests are disabled and there are one
37 // or more discovered URLs that have not been sent to the resolution service. 39 // or more discovered URLs that have not been sent to the resolution service.
38 bool HasUnresolvedDiscoveries() override; 40 bool HasUnresolvedDiscoveries() override;
39 41
40 private: 42 private:
41 // Scanner for nearby Physical Web URL devices. 43 // Scanner for nearby Physical Web URL devices.
42 base::scoped_nsobject<PhysicalWebScanner> scanner_; 44 base::scoped_nsobject<PhysicalWebScanner> scanner_;
43 45
46 // Utility for fetching initial application state for logging purposes.
47 base::scoped_nsobject<PhysicalWebInitialStateRecorder> initialStateRecorder_;
48
44 DISALLOW_COPY_AND_ASSIGN(IOSChromePhysicalWebDataSource); 49 DISALLOW_COPY_AND_ASSIGN(IOSChromePhysicalWebDataSource);
45 }; 50 };
46 51
47 #endif // IOS_CHROME_BROWSER_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H _ 52 #endif // IOS_CHROME_BROWSER_PHYSICAL_WEB_IOS_CHROME_PHYSICAL_WEB_DATA_SOURCE_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698