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

Side by Side Diff: chromeos/components/tether/initializer.h

Issue 2801353002: [CrOS Tether] Fill out the Initializer class. Tether will now initialize fully once the flag is ena… (Closed)
Patch Set: hansberry@ comments. Created 3 years, 8 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 CHROMEOS_COMPONENTS_TETHER_INITIALIZER_H_ 5 #ifndef CHROMEOS_COMPONENTS_TETHER_INITIALIZER_H_
6 #define CHROMEOS_COMPONENTS_TETHER_INITIALIZER_H_ 6 #define CHROMEOS_COMPONENTS_TETHER_INITIALIZER_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h"
13 #include "components/signin/core/browser/profile_oauth2_token_service.h"
14 #include "device/bluetooth/bluetooth_adapter.h"
15 #include "device/bluetooth/bluetooth_advertisement.h"
16
17 class PrefService;
9 18
10 namespace cryptauth { 19 namespace cryptauth {
11 class CryptAuthService; 20 class CryptAuthService;
21 class RemoteBeaconSeedFetcher;
12 } 22 }
13 23
14 namespace chromeos { 24 namespace chromeos {
15 25
16 namespace tether { 26 namespace tether {
17 27
28 class ActiveHost;
29 class ActiveHostNetworkStateUpdater;
30 class BleConnectionManager;
31 class DeviceIdTetherNetworkGuidMap;
32 class HostScanner;
33 class HostScanDevicePrioritizer;
34 class LocalDeviceDataProvider;
35 class NotificationPresenter;
36 class TetherConnector;
37 class TetherHostFetcher;
38 class WifiHotspotConnector;
39
18 // Initializes the Tether Chrome OS component. 40 // Initializes the Tether Chrome OS component.
19 // TODO(khorimoto): Implement. 41 class Initializer : public OAuth2TokenService::Observer {
20 class Initializer {
21 public: 42 public:
22 static void Initialize(cryptauth::CryptAuthService* cryptauth_service); 43 static void Initialize(
44 cryptauth::CryptAuthService* cryptauth_service,
45 std::unique_ptr<NotificationPresenter> notification_presenter,
46 PrefService* pref_service,
47 ProfileOAuth2TokenService* token_service);
stevenjb 2017/04/10 20:26:59 As mentioned before, it is important to pass NHS a
Kyle Horimoto 2017/04/11 01:40:40 Done.
23 48
24 private: 49 private:
25 static Initializer* instance_; 50 static Initializer* instance_;
26 51
27 explicit Initializer(cryptauth::CryptAuthService* cryptauth_service); 52 Initializer(cryptauth::CryptAuthService* cryptauth_service,
28 ~Initializer(); 53 std::unique_ptr<NotificationPresenter> notification_presenter,
54 PrefService* pref_service,
55 ProfileOAuth2TokenService* token_service);
56 ~Initializer() override;
57
58 // OAuth2TokenService::Observer:
59 void OnRefreshTokensLoaded() override;
60
61 void OnBluetoothAdapterFetched(
62 scoped_refptr<device::BluetoothAdapter> adapter);
63
64 void IntervalSuccessCallback();
65 void IntervalErrorCallback(device::BluetoothAdvertisement::ErrorCode status);
29 66
30 cryptauth::CryptAuthService* cryptauth_service_; 67 cryptauth::CryptAuthService* cryptauth_service_;
68 std::unique_ptr<NotificationPresenter> notification_presenter_;
69 PrefService* pref_service_;
70 ProfileOAuth2TokenService* token_service_;
71
72 std::unique_ptr<TetherHostFetcher> tether_host_fetcher_;
73 std::unique_ptr<LocalDeviceDataProvider> local_device_data_provider_;
74 std::unique_ptr<cryptauth::RemoteBeaconSeedFetcher>
75 remote_beacon_seed_fetcher_;
76 std::unique_ptr<BleConnectionManager> ble_connection_manager_;
77 std::unique_ptr<HostScanDevicePrioritizer> host_scan_device_prioritizer_;
78 std::unique_ptr<WifiHotspotConnector> wifi_hotspot_connector_;
79 std::unique_ptr<ActiveHost> active_host_;
80 std::unique_ptr<ActiveHostNetworkStateUpdater>
81 active_host_network_state_updater_;
82 std::unique_ptr<DeviceIdTetherNetworkGuidMap>
83 device_id_tether_network_guid_map_;
84 std::unique_ptr<TetherConnector> tether_connector_;
85 std::unique_ptr<HostScanner> host_scanner_;
86
87 base::WeakPtrFactory<Initializer> weak_ptr_factory_;
31 88
32 DISALLOW_COPY_AND_ASSIGN(Initializer); 89 DISALLOW_COPY_AND_ASSIGN(Initializer);
33 }; 90 };
34 91
35 } // namespace tether 92 } // namespace tether
36 93
37 } // namespace chromeos 94 } // namespace chromeos
38 95
39 #endif // CHROMEOS_COMPONENTS_TETHER_INITIALIZER_H_ 96 #endif // CHROMEOS_COMPONENTS_TETHER_INITIALIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698