Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/metrics/variations/resource_request_allowed_notifier_test_util.cc

Issue 10917120: Activate the VariationsService for ChromeOS and ensure that it does not ping the server until the E… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: nonchromeos fixes Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_(false) {
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::SetRequestsAllowedOverride(bool allowed) {
25 override_requests_allowed_ = true;
26 requests_allowed_ = allowed;
27 }
28
29 void TestRequestAllowedNotifier::NotifyObservers() {
30 // Force the allowed state to true. This forces MaybeNotifyObserver to always
31 // notify observers.
Alexei Svitkine (slow) 2012/09/24 15:59:36 Nit: Expand comment to say that MaybeNotifyObserve
SteveT 2012/09/24 18:04:27 Done.
32 override_requests_allowed_ = true;
33 requests_allowed_ = true;
34 MaybeNotifyObserver();
35 }
36
37 #if defined(OS_CHROMEOS)
38 bool TestRequestAllowedNotifier::IsEulaAccepted() {
39 return eula_accepted_;
40 }
41 #endif
42
43 bool TestRequestAllowedNotifier::ResourceRequestsAllowed() {
44 SetObserverRequestedPermissionForTesting(true);
45 if (override_requests_allowed_)
46 return requests_allowed_;
47 return ResourceRequestAllowedNotifier::ResourceRequestsAllowed();
48 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698