| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 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 "chrome/browser/metrics/variations/resource_request_allowed_notifier_te
st_util.h" |
| 6 |
| 7 TestRequestAllowedNotifier::TestRequestAllowedNotifier() |
| 8 : requests_allowed_(true), |
| 9 #if defined(OS_CHROMEOS) |
| 10 eula_accepted_(false), |
| 11 #endif |
| 12 override_requests_allowed_(true) { |
| 13 } |
| 14 |
| 15 TestRequestAllowedNotifier::~TestRequestAllowedNotifier() { |
| 16 } |
| 17 |
| 18 #if defined(OS_CHROMEOS) |
| 19 void TestRequestAllowedNotifier::SetEulaAccepted(bool accepted) { |
| 20 eula_accepted_ = accepted; |
| 21 } |
| 22 #endif |
| 23 |
| 24 void TestRequestAllowedNotifier::SetRequestsAllowed(bool allowed) { |
| 25 requests_allowed_ = allowed; |
| 26 } |
| 27 |
| 28 void TestRequestAllowedNotifier::OverrideRequestsAllowed(bool override) { |
| 29 override_requests_allowed_ = override; |
| 30 } |
| 31 |
| 32 void TestRequestAllowedNotifier::NotifyObservers() { |
| 33 requests_allowed_ = true; |
| 34 MaybeNotifyObservers(); |
| 35 } |
| 36 |
| 37 #if defined(OS_CHROMEOS) |
| 38 bool TestRequestAllowedNotifier::IsEulaAccepted() { |
| 39 return eula_accepted_; |
| 40 } |
| 41 #endif |
| 42 |
| 43 bool TestRequestAllowedNotifier::ResourceRequestsAllowed() { |
| 44 if (override_requests_allowed_) |
| 45 return requests_allowed_; |
| 46 return ResourceRequestAllowedNotifier::ResourceRequestsAllowed(); |
| 47 } |
| OLD | NEW |