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

Unified Diff: chromeos/network/shill_service_observer.h

Issue 11192024: Add chromeos::NetworkStateManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to feedback Round 2 Created 8 years, 2 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: chromeos/network/shill_service_observer.h
diff --git a/chromeos/network/shill_service_observer.h b/chromeos/network/shill_service_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..f1e43357d00da9510e10b3202018a3265a09c35b
--- /dev/null
+++ b/chromeos/network/shill_service_observer.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 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 CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_
+#define CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "chromeos/dbus/shill_property_changed_observer.h"
+
+namespace chromeos {
+
+// Class to manage Shill service property changed observers. Observers are
+// added on construction and removed on destruction. Runs the handler when
gauravsh 2012/10/25 23:41:05 I'd move the 2nd sentence as a comment into the cl
stevenjb 2012/10/26 21:36:39 Since this has no public facing API, it seemed bet
+// OnPropertyChanged is called.
+class ShillServiceObserver : public ShillPropertyChangedObserver {
+ public:
+ typedef base::Callback<void(const std::string& service,
+ const std::string& name,
+ const base::Value& value)> Handler;
+
+ ShillServiceObserver(const std::string& service_path,
+ const Handler& handler);
+
+ virtual ~ShillServiceObserver();
+
+ // ShillPropertyChangedObserver overrides.
+ virtual void OnPropertyChanged(const std::string& key,
+ const base::Value& value);
gauravsh 2012/10/25 23:41:05 OVERRIDE
stevenjb 2012/10/26 21:36:39 Done.
+
+ private:
+ std::string service_path_;
+ Handler handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShillServiceObserver);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_NETWORK_SHILL_SERVICE_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698