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

Side by Side Diff: chrome/browser/metrics/variations/eula_accepted_notifier.h

Issue 13620010: Refactor ResourceRequestAllowedNotifier EULA checking into a separate class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/eula_accepted_notifier.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 CHROME_BROWSER_METRICS_VARIATIONS_EULA_ACCEPTED_NOTIFIER_H_
6 #define CHROME_BROWSER_METRICS_VARIATIONS_EULA_ACCEPTED_NOTIFIER_H_
7
8 #include "base/basictypes.h"
9
10 // Interface for querying the EULA accepted state and receiving a notification
11 // when the EULA is accepted. This abstracts away the platform-specific logic
12 // for EULA notifications on different platforms.
13 class EulaAcceptedNotifier {
14 public:
15 // Observes EULA accepted state changes.
16 class Observer {
17 public:
18 virtual void OnEulaAccepted() = 0;
19 };
20
21 EulaAcceptedNotifier();
22 virtual ~EulaAcceptedNotifier();
23
24 // Initializes this class with the given |observer|. Must be called before
25 // the class is used.
26 void Init(Observer* observer);
27
28 // Returns true if the EULA has been accepted. If the EULA has not yet been
29 // accepted, begins monitoring the EULA state and will notify the observer
30 // once the EULA has been accepted.
31 virtual bool IsEulaAccepted() = 0;
32
33 // Factory method for this class.
34 static EulaAcceptedNotifier* Create();
35
36 protected:
37 // Notifies the observer that the EULA has been updated, to be called by
38 // platform-specific subclasses.
39 void NotifyObserver();
40
41 private:
42 // Observer of the EULA accepted notification.
43 Observer* observer_;
44
45 DISALLOW_COPY_AND_ASSIGN(EulaAcceptedNotifier);
46 };
47
48 #endif // CHROME_BROWSER_METRICS_VARIATIONS_EULA_ACCEPTED_NOTIFIER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/eula_accepted_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698