| Index: chrome/browser/net/nqe/ui_network_quality_estimator_service.cc
|
| diff --git a/chrome/browser/net/nqe/ui_network_quality_estimator_service.cc b/chrome/browser/net/nqe/ui_network_quality_estimator_service.cc
|
| index 6e00352acd3e916b9f5fc6170364fc3b2866164e..3208ce46583b2147c8b4177df054151774bdc4da 100644
|
| --- a/chrome/browser/net/nqe/ui_network_quality_estimator_service.cc
|
| +++ b/chrome/browser/net/nqe/ui_network_quality_estimator_service.cc
|
| @@ -200,26 +200,40 @@ void UINetworkQualityEstimatorService::Shutdown() {
|
| DCHECK(deleted);
|
| // Silence unused variable warning in release builds.
|
| (void)deleted;
|
| }
|
| }
|
|
|
| void UINetworkQualityEstimatorService::EffectiveConnectionTypeChanged(
|
| net::EffectiveConnectionType type) {
|
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| type_ = type;
|
| + for (auto& observer : effective_connection_type_observer_list_)
|
| + observer.OnEffectiveConnectionTypeChanged(type);
|
| +}
|
| +
|
| +void UINetworkQualityEstimatorService::AddEffectiveConnectionTypeObserver(
|
| + net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer) {
|
| + DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| + effective_connection_type_observer_list_.AddObserver(observer);
|
| +}
|
| +
|
| +void UINetworkQualityEstimatorService::RemoveEffectiveConnectionTypeObserver(
|
| + net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer) {
|
| + DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| + effective_connection_type_observer_list_.RemoveObserver(observer);
|
| }
|
|
|
| void UINetworkQualityEstimatorService::SetEffectiveConnectionTypeForTesting(
|
| net::EffectiveConnectionType type) {
|
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| - type_ = type;
|
| + EffectiveConnectionTypeChanged(type);
|
| }
|
|
|
| net::EffectiveConnectionType
|
| UINetworkQualityEstimatorService::GetEffectiveConnectionType() const {
|
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| return type_;
|
| }
|
|
|
| // static
|
| void UINetworkQualityEstimatorService::RegisterProfilePrefs(
|
|
|