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

Side by Side Diff: components/metrics/test_enabled_state_provider.h

Issue 1958003003: Splitting the concept of UMA consent, and should UMA report. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 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 #ifndef COMPONENTS_METRICS_TEST_ENABLED_STATE_PROVIDER_H_
6 #define COMPONENTS_METRICS_TEST_ENABLED_STATE_PROVIDER_H_
7
8 #include "base/macros.h"
9 #include "components/metrics/enabled_state_provider.h"
10
11 namespace metrics {
12
13 // A simple concrete implementation of the EnabledStateProvider interface, for
14 // use in tests.
15 class TestEnabledStateProvider : public EnabledStateProvider {
16 public:
17 TestEnabledStateProvider(bool consent, bool enabled)
18 : consent_(consent), enabled_(enabled) {}
19 ~TestEnabledStateProvider() override {}
20
21 // EnabledStateProvider
22 bool IsConsentGiven() override;
23 bool IsReportingEnabled() override;
24
25 void set_consent(bool consent) { consent_ = consent; }
26 void set_enabled(bool enabled) { enabled_ = enabled; }
27
28 private:
29 bool consent_;
30 bool enabled_;
31
32 DISALLOW_COPY_AND_ASSIGN(TestEnabledStateProvider);
33 };
34
35 } // namespace metrics
36
37 #endif // COMPONENTS_METRICS_TEST_ENABLED_STATE_PROVIDER_H_
OLDNEW
« no previous file with comments | « components/metrics/metrics_state_manager_unittest.cc ('k') | components/metrics/test_enabled_state_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698