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

Side by Side Diff: chromeos/network/managed_state.h

Issue 11192024: Add chromeos::NetworkStateManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to feedback 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 CHROMEOS_NETWORK_MANAGED_STATE_H_
6 #define CHROMEOS_NETWORK_MANAGED_STATE_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "chromeos/chromeos_export.h"
13 #include "third_party/cros_system_api/dbus/service_constants.h"
pneubeck (no reviews) 2012/10/25 14:42:17 unused?
stevenjb 2012/10/25 22:05:22 PropertyChanged keys are defined here. I separated
14
15 namespace base {
16 class Value;
17 }
18
19 namespace chromeos {
20
21 // Base class for states managed by NetworkStateManger which are associated
22 // with a path.
23 class ManagedState {
24 public:
25 enum ManagedType {
26 MANAGED_TYPE_NETWORK,
27 MANAGED_TYPE_DEVICE
28 };
29
30 ManagedState(ManagedType type, const std::string& path)
31 : managed_type_(type),
32 path_(path) {
33 }
pneubeck (no reviews) 2012/10/25 14:42:17 virtual destructor
stevenjb 2012/10/25 22:05:22 Done.
34
35 // This will construct and return a new instance of the approprate class
36 // based on |type|.
37 static ManagedState* Create(ManagedType type, const std::string& path);
38
39 // Called by NetworkStateHandler when a property changes.
40 virtual bool PropertyChanged(const std::string& key,
41 const base::Value& value) = 0;
42
43 const ManagedType managed_type() const { return managed_type_; }
44 const std::string& path() const { return path_; }
45
46 private:
47 ManagedType managed_type_;
48 std::string path_;
pneubeck (no reviews) 2012/10/25 14:42:17 disallow copy/assign
stevenjb 2012/10/25 22:05:22 Done.
49 };
50
51 } // namespace chromeos
52
53 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698