@@ -64,7 +64,6 @@ std::unique_ptr<Initializer> InitializerImpl::Factory::NewInstance(
64
64
cryptauth::CryptAuthService* cryptauth_service,
65
65
NotificationPresenter* notification_presenter,
66
66
PrefService* pref_service,
67
- ProfileOAuth2TokenService* token_service,
68
67
NetworkStateHandler* network_state_handler,
69
68
ManagedNetworkConfigurationHandler* managed_network_configuration_handler,
70
69
NetworkConnect* network_connect,
@@ -74,7 +73,7 @@ std::unique_ptr<Initializer> InitializerImpl::Factory::NewInstance(
74
73
factory_instance_ = new Factory ();
75
74
}
76
75
return factory_instance_->BuildInstance (
77
- cryptauth_service, notification_presenter, pref_service, token_service,
76
+ cryptauth_service, notification_presenter, pref_service,
78
77
network_state_handler, managed_network_configuration_handler,
79
78
network_connect, network_connection_handler, adapter);
80
79
}
@@ -96,14 +95,13 @@ std::unique_ptr<Initializer> InitializerImpl::Factory::BuildInstance(
96
95
cryptauth::CryptAuthService* cryptauth_service,
97
96
NotificationPresenter* notification_presenter,
98
97
PrefService* pref_service,
99
- ProfileOAuth2TokenService* token_service,
100
98
NetworkStateHandler* network_state_handler,
101
99
ManagedNetworkConfigurationHandler* managed_network_configuration_handler,
102
100
NetworkConnect* network_connect,
103
101
NetworkConnectionHandler* network_connection_handler,
104
102
scoped_refptr<device::BluetoothAdapter> adapter) {
105
103
return base::WrapUnique (new InitializerImpl (
106
- cryptauth_service, notification_presenter, pref_service, token_service,
104
+ cryptauth_service, notification_presenter, pref_service,
107
105
network_state_handler, managed_network_configuration_handler,
108
106
network_connect, network_connection_handler, adapter));
109
107
}
@@ -112,7 +110,6 @@ InitializerImpl::InitializerImpl(
112
110
cryptauth::CryptAuthService* cryptauth_service,
113
111
NotificationPresenter* notification_presenter,
114
112
PrefService* pref_service,
115
- ProfileOAuth2TokenService* token_service,
116
113
NetworkStateHandler* network_state_handler,
117
114
ManagedNetworkConfigurationHandler* managed_network_configuration_handler,
118
115
NetworkConnect* network_connect,
@@ -121,28 +118,17 @@ InitializerImpl::InitializerImpl(
121
118
: cryptauth_service_(cryptauth_service),
122
119
notification_presenter_ (notification_presenter),
123
120
pref_service_(pref_service),
124
- token_service_(token_service),
125
121
network_state_handler_(network_state_handler),
126
122
managed_network_configuration_handler_(
127
123
managed_network_configuration_handler),
128
124
network_connect_(network_connect),
129
125
network_connection_handler_(network_connection_handler),
130
126
adapter_(adapter),
131
127
weak_ptr_factory_(this ) {
132
- if (!token_service_->RefreshTokenIsAvailable (
133
- cryptauth_service_->GetAccountId ())) {
134
- PA_LOG (INFO) << " Refresh token not yet available; "
135
- << " waiting for valid token to initializing tether feature." ;
136
- token_service_->AddObserver (this );
137
- return ;
138
- }
139
-
140
- PA_LOG (INFO) << " Refresh token is available; initializing tether feature." ;
141
128
CreateComponent ();
142
129
}
143
130
144
131
InitializerImpl::~InitializerImpl () {
145
- token_service_->RemoveObserver (this );
146
132
network_state_handler_->set_tether_sort_delegate (nullptr );
147
133
148
134
if (disconnect_tethering_request_sender_)
@@ -187,20 +173,6 @@ void InitializerImpl::RequestShutdown() {
187
173
StartAsynchronousShutdown ();
188
174
}
189
175
190
- void InitializerImpl::OnRefreshTokensLoaded () {
191
- if (!token_service_->RefreshTokenIsAvailable (
192
- cryptauth_service_->GetAccountId ())) {
193
- // If a token for the active account is still not available, continue
194
- // waiting for a new token.
195
- return ;
196
- }
197
-
198
- PA_LOG (INFO) << " Refresh token has loaded; initializing tether feature." ;
199
-
200
- token_service_->RemoveObserver (this );
201
- CreateComponent ();
202
- }
203
-
204
176
void InitializerImpl::OnPendingDisconnectRequestsComplete () {
205
177
DCHECK (status () == Initializer::Status::SHUTTING_DOWN);
206
178
disconnect_tethering_request_sender_->RemoveObserver (this );
@@ -217,9 +189,6 @@ void InitializerImpl::OnPendingDisconnectRequestsComplete() {
217
189
}
218
190
219
191
void InitializerImpl::CreateComponent () {
220
- PA_LOG (INFO) << " Successfully set Bluetooth advertisement interval. "
221
- << " Initializing tether feature." ;
222
-
223
192
network_list_sorter_ = base::MakeUnique<NetworkListSorter>();
224
193
network_state_handler_->set_tether_sort_delegate (network_list_sorter_.get ());
225
194
tether_host_fetcher_ =
0 commit comments