Index: chromeos/network/managed_state.h |
diff --git a/chromeos/network/managed_state.h b/chromeos/network/managed_state.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d7a2052a01dc7c0fd14c9ea6118384876ff8cd1a |
--- /dev/null |
+++ b/chromeos/network/managed_state.h |
@@ -0,0 +1,53 @@ |
+// 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_MANAGED_STATE_H_ |
+#define CHROMEOS_NETWORK_MANAGED_STATE_H_ |
+ |
+#include <string> |
+ |
+#include "base/basictypes.h" |
+#include "base/compiler_specific.h" |
+#include "chromeos/chromeos_export.h" |
+ |
+namespace base { |
+class Value; |
+} |
gauravsh
2012/10/25 23:41:05
NIT: // namespace base
pneubeck (no reviews)
2012/10/26 08:17:46
I think there was agreement that this closing comm
|
+ |
+namespace chromeos { |
+ |
+// Base class for states managed by NetworkStateManger which are associated |
+// with a path. |
gauravsh
2012/10/25 23:41:05
Can you add more context for what this path is in
stevenjb
2012/10/26 21:36:39
Done.
|
+class ManagedState { |
+ public: |
+ enum ManagedType { |
+ MANAGED_TYPE_NETWORK, |
+ MANAGED_TYPE_DEVICE |
+ }; |
+ |
+ ManagedState(ManagedType type, const std::string& path); |
gauravsh
2012/10/25 23:41:05
I am assuming this constructor is never meant to b
stevenjb
2012/10/26 21:36:39
Protected. Done.
|
+ |
+ virtual ~ManagedState(); |
+ |
+ // This will construct and return a new instance of the approprate class |
+ // based on |type|. |
+ static ManagedState* Create(ManagedType type, const std::string& path); |
+ |
+ // Called by NetworkStateHandler when a property changes. |
+ virtual bool PropertyChanged(const std::string& key, |
gauravsh
2012/10/25 23:41:05
What does the return value signal?
stevenjb
2012/10/26 21:36:39
Done.
|
+ const base::Value& value) = 0; |
+ |
+ const ManagedType managed_type() const { return managed_type_; } |
+ const std::string& path() const { return path_; } |
+ |
+ private: |
+ ManagedType managed_type_; |
+ std::string path_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ManagedState); |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROMEOS_NETWORK_MANAGED_STATE_H_ |