Chromium Code Reviews| Index: chrome/browser/metrics/variations/variations_service.h |
| diff --git a/chrome/browser/metrics/variations/variations_service.h b/chrome/browser/metrics/variations/variations_service.h |
| index 3f341212ecf699343c3fa375ef22928e77eae42e..b6ce0816a02f0680164c0f244f98ce9f71d14bd5 100644 |
| --- a/chrome/browser/metrics/variations/variations_service.h |
| +++ b/chrome/browser/metrics/variations/variations_service.h |
| @@ -15,6 +15,7 @@ |
| #include "base/timer.h" |
| #include "chrome/browser/metrics/proto/study.pb.h" |
| #include "chrome/browser/metrics/proto/trials_seed.pb.h" |
| +#include "chrome/browser/resource_request_allowed_notifier.h" |
| #include "chrome/common/chrome_version_info.h" |
| #include "googleurl/src/gurl.h" |
| #include "net/base/network_change_notifier.h" |
| @@ -28,7 +29,7 @@ namespace chrome_variations { |
| // new seed data from the variations server. |
| class VariationsService |
| : public net::URLFetcherDelegate, |
| - public net::NetworkChangeNotifier::ConnectionTypeObserver{ |
| + public ResourceRequestAllowedNotifier::Observer { |
| public: |
| VariationsService(); |
| virtual ~VariationsService(); |
| @@ -52,6 +53,12 @@ class VariationsService |
| // Exposed for testing. |
| void SetWasOfflineDuringLastRequestAttemptForTesting(bool offline); |
| + // ResourceRequestAllowedNotifier::Observer implementation: |
| + virtual void OnNetworkChangedToActiveConnection() OVERRIDE; |
| +#if defined(OS_CHROMEOS) |
| + virtual void OnEulaAccepted() OVERRIDE; |
|
Alexei Svitkine (slow)
2012/09/11 18:35:38
I was suggesting that ResourceRequestAllowedNotifi
SteveT
2012/09/11 18:46:14
Hm, okay. That could work, but will take some addi
|
| +#endif |
| + |
| // Register Variations related prefs in Local State. |
| static void RegisterPrefs(PrefService* prefs); |
| @@ -73,10 +80,6 @@ class VariationsService |
| // net::URLFetcherDelegate implementation: |
| virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| - // net::NetworkChangeNotifier::ConnectionTypeObserver implementation. |
| - virtual void OnConnectionTypeChanged( |
| - net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; |
| - |
| // Store the given seed data to the given local prefs. Note that |seed_data| |
| // is assumed to be the raw serialized protobuf data stored in a string. It |
| // will be Base64Encoded for storage. If the string is invalid or the encoding |
| @@ -146,6 +149,12 @@ class VariationsService |
| // it gets called prior to |StartRepeatedVariationsSeedFetch|. |
| bool create_trials_from_seed_called_; |
| +#if defined(OS_CHROMEOS) |
| + // Tracks whether or not the service is waiting for the user to accept the |
| + // EULA before performing the next request. |
| + bool waiting_for_user_to_accept_eula_; |
| +#endif |
| + |
| // Tracks whether or not the last seed request attempt failed due to being |
| // offline. |
| bool was_offline_during_last_request_attempt_; |
| @@ -154,6 +163,10 @@ class VariationsService |
| // member so if VariationsService goes out of scope, the timer is |
| // automatically canceled. |
| base::RepeatingTimer<VariationsService> timer_; |
| + |
| + // Helper class used to tell this service if it's allowed to make network |
| + // resource requests. |
| + ResourceRequestAllowedNotifier resource_request_allowed_notifier_; |
| }; |
| } // namespace chrome_variations |