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

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, DEPS change. 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/prefs/pref_registry_simple.h"
Ryan Hansberry 2017/04/08 00:10:14 Remove this.
Kyle Horimoto 2017/04/08 00:30:27 Done.
14 #include "components/signin/core/browser/profile_oauth2_token_service.h"
15 #include "device/bluetooth/bluetooth_adapter.h"
16 #include "device/bluetooth/bluetooth_advertisement.h"
17
18 class PrefService;
9 19
10 namespace cryptauth { 20 namespace cryptauth {
11 class CryptAuthService; 21 class CryptAuthService;
22 class RemoteBeaconSeedFetcher;
12 } 23 }
13 24
14 namespace chromeos { 25 namespace chromeos {
15 26
16 namespace tether { 27 namespace tether {
17 28
29 class ActiveHost;
30 class ActiveHostNetworkStateUpdater;
31 class BleConnectionManager;
32 class DeviceIdTetherNetworkGuidMap;
33 class HostScanner;
34 class HostScanDevicePrioritizer;
35 class LocalDeviceDataProvider;
36 class NotificationPresenter;
37 class TetherConnector;
38 class TetherHostFetcher;
39 class WifiHotspotConnector;
40
18 // Initializes the Tether Chrome OS component. 41 // Initializes the Tether Chrome OS component.
19 // TODO(khorimoto): Implement. 42 class Initializer : public OAuth2TokenService::Observer {
20 class Initializer {
21 public: 43 public:
22 static void Initialize(cryptauth::CryptAuthService* cryptauth_service); 44 static void Initialize(
45 cryptauth::CryptAuthService* cryptauth_service,
46 std::unique_ptr<NotificationPresenter> notification_presenter,
47 PrefService* pref_service,
48 ProfileOAuth2TokenService* token_service);
49
50 static void RegisterProfilePrefs(PrefRegistrySimple* registry);
Ryan Hansberry 2017/04/08 00:10:14 remove this.
Kyle Horimoto 2017/04/08 00:30:27 Done.
23 51
24 private: 52 private:
25 static Initializer* instance_; 53 static Initializer* instance_;
26 54
27 explicit Initializer(cryptauth::CryptAuthService* cryptauth_service); 55 Initializer(cryptauth::CryptAuthService* cryptauth_service,
28 ~Initializer(); 56 std::unique_ptr<NotificationPresenter> notification_presenter,
57 PrefService* pref_service,
58 ProfileOAuth2TokenService* token_service);
59 ~Initializer() override;
60
61 // OAuth2TokenService::Observer:
62 void OnRefreshTokensLoaded() override;
63
64 void OnBluetoothAdapterFetched(
65 scoped_refptr<device::BluetoothAdapter> adapter);
66
67 void IntervalSuccessCallback();
68 void IntervalErrorCallback(device::BluetoothAdvertisement::ErrorCode status);
29 69
30 cryptauth::CryptAuthService* cryptauth_service_; 70 cryptauth::CryptAuthService* cryptauth_service_;
71 std::unique_ptr<NotificationPresenter> notification_presenter_;
72 PrefService* pref_service_;
73 ProfileOAuth2TokenService* token_service_;
74
75 std::unique_ptr<TetherHostFetcher> tether_host_fetcher_;
76 std::unique_ptr<LocalDeviceDataProvider> local_device_data_provider_;
77 std::unique_ptr<cryptauth::RemoteBeaconSeedFetcher>
78 remote_beacon_seed_fetcher_;
79 std::unique_ptr<BleConnectionManager> ble_connection_manager_;
80 std::unique_ptr<HostScanDevicePrioritizer> host_scan_device_prioritizer_;
81 std::unique_ptr<WifiHotspotConnector> wifi_hotspot_connector_;
82 std::unique_ptr<ActiveHost> active_host_;
83 std::unique_ptr<ActiveHostNetworkStateUpdater>
84 active_host_network_state_updater_;
85 std::unique_ptr<DeviceIdTetherNetworkGuidMap>
86 device_id_tether_network_guid_map_;
87 std::unique_ptr<TetherConnector> tether_connector_;
88 std::unique_ptr<HostScanner> host_scanner_;
89
90 base::WeakPtrFactory<Initializer> weak_ptr_factory_;
31 91
32 DISALLOW_COPY_AND_ASSIGN(Initializer); 92 DISALLOW_COPY_AND_ASSIGN(Initializer);
33 }; 93 };
34 94
35 } // namespace tether 95 } // namespace tether
36 96
37 } // namespace chromeos 97 } // namespace chromeos
38 98
39 #endif // CHROMEOS_COMPONENTS_TETHER_INITIALIZER_H_ 99 #endif // CHROMEOS_COMPONENTS_TETHER_INITIALIZER_H_
OLDNEW
« no previous file with comments | « chromeos/components/tether/host_scanner_unittest.cc ('k') | chromeos/components/tether/initializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698