Chromium Code Reviews| Index: chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc |
| diff --git a/chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc b/chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..903e384321857bab3e391d3952747ef4718a9050 |
| --- /dev/null |
| +++ b/chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc |
| @@ -0,0 +1,48 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.h" |
| + |
| +TestRequestAllowedNotifier::TestRequestAllowedNotifier() |
| + : requests_allowed_(true), |
| +#if defined(OS_CHROMEOS) |
| + eula_accepted_(false), |
| +#endif |
| + override_requests_allowed_(true) { |
| +} |
| + |
| +TestRequestAllowedNotifier::~TestRequestAllowedNotifier() { |
| +} |
| + |
| +#if defined(OS_CHROMEOS) |
| +void TestRequestAllowedNotifier::SetEulaAccepted(bool accepted) { |
| + eula_accepted_ = accepted; |
| +} |
| +#endif |
| + |
| +void TestRequestAllowedNotifier::SetRequestsAllowed(bool allowed) { |
| + requests_allowed_ = allowed; |
| +} |
| + |
| +void TestRequestAllowedNotifier::OverrideRequestsAllowed(bool override) { |
| + override_requests_allowed_ = override; |
| +} |
| + |
| +void TestRequestAllowedNotifier::NotifyObservers() { |
| + requests_allowed_ = true; |
| + MaybeNotifyObservers(); |
| +} |
| + |
| +#if defined(OS_CHROMEOS) |
| +bool TestRequestAllowedNotifier::IsEulaAccepted() { |
| + return eula_accepted_; |
| +} |
| +#endif |
| + |
| +bool TestRequestAllowedNotifier::ResourceRequestsAllowed() { |
| + if (override_requests_allowed_) |
| + return requests_allowed_; |
| + else |
|
Alexei Svitkine (slow)
2012/09/20 21:39:03
Nit: remove the else and unindent the next line.
SteveT
2012/09/21 15:16:17
Done.
|
| + return ResourceRequestAllowedNotifier::ResourceRequestsAllowed(); |
| +} |