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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/metrics/variations/eula_accepted_notifier.h
===================================================================
--- chrome/browser/metrics/variations/eula_accepted_notifier.h (revision 0)
+++ chrome/browser/metrics/variations/eula_accepted_notifier.h (revision 0)
@@ -0,0 +1,48 @@
+// Copyright (c) 2013 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.
+
+#ifndef CHROME_BROWSER_METRICS_VARIATIONS_EULA_ACCEPTED_NOTIFIER_H_
+#define CHROME_BROWSER_METRICS_VARIATIONS_EULA_ACCEPTED_NOTIFIER_H_
+
+#include "base/basictypes.h"
+
+// Interface for querying the EULA accepted state and receiving a notification
+// when the EULA is accepted. This abstract away the platform-specific logic
SteveT 2013/04/05 22:16:41 abstract -> abstracts
Alexei Svitkine (slow) 2013/04/08 14:48:41 Done.
+// for EULA notifications on different platforms.
+class EulaAcceptedNotifier {
+ public:
+ // Observes EULA accepted state changes.
+ class Observer {
+ public:
+ virtual void OnEulaAccepted() = 0;
+ };
+
+ EulaAcceptedNotifier();
+ virtual ~EulaAcceptedNotifier();
+
+ // Initializes this class with the given |observer|. Must be called before
+ // the class is used.
+ void Init(Observer* observer);
+
+ // Returns true if the EULA has been accepted. If the EULA has not yet been
+ // accepted, begins monitoring the EULA state and will notify the observer
+ // once the EULA has been accepted.
+ virtual bool IsEulaAccepted() = 0;
+
+ // Factory method for this class.
+ static EulaAcceptedNotifier* Create();
+
+ protected:
+ // Notifies the observer that the EULA has been updated, to be called by
+ // platform-specific subclasses.
+ void NotifyObserver();
+
+ private:
+ // Observer of the EULA accepted notification.
+ Observer* observer_;
+
+ DISALLOW_COPY_AND_ASSIGN(EulaAcceptedNotifier);
+};
+
+#endif // CHROME_BROWSER_METRICS_VARIATIONS_EULA_ACCEPTED_NOTIFIER_H_

Powered by Google App Engine
This is Rietveld 408576698