OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/offline_pages/background/network_quality_provider_stub.h" | |
6 | |
7 namespace offline_pages { | |
8 | |
9 const char kOfflineNQPKey[] = "OfflineNQP"; | |
10 | |
11 NetworkQualityProviderStub::NetworkQualityProviderStub() | |
12 : connection_type_( | |
13 net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G) {} | |
14 | |
15 NetworkQualityProviderStub::~NetworkQualityProviderStub() {} | |
16 | |
17 // static | |
18 NetworkQualityProviderStub* NetworkQualityProviderStub::GetUserData( | |
19 base::SupportsUserData* supports_user_data) { | |
20 return static_cast<NetworkQualityProviderStub*>( | |
21 supports_user_data->GetUserData(&kOfflineNQPKey)); | |
22 } | |
23 | |
24 // static | |
25 void NetworkQualityProviderStub::SetUserData( | |
26 base::SupportsUserData* supports_user_data, | |
27 NetworkQualityProviderStub* stub) { | |
28 DCHECK(supports_user_data); | |
29 DCHECK(stub); | |
30 supports_user_data->SetUserData(&kOfflineNQPKey, stub); | |
31 } | |
32 | |
33 void NetworkQualityProviderStub::AddEffectiveConnectionTypeObserver( | |
34 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer) {} | |
35 | |
36 void NetworkQualityProviderStub::RemoveEffectiveConnectionTypeObserver( | |
37 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer) {} | |
38 | |
39 net::EffectiveConnectionType | |
40 NetworkQualityProviderStub::GetEffectiveConnectionType() const { | |
41 return connection_type_; | |
42 } | |
43 } // namespace offline_pages | |
OLD | NEW |