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

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 Round 2 Created 8 years, 1 month 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
14 namespace base {
15 class Value;
16 }
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
17
18 namespace chromeos {
19
20 // Base class for states managed by NetworkStateManger which are associated
21 // 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.
22 class ManagedState {
23 public:
24 enum ManagedType {
25 MANAGED_TYPE_NETWORK,
26 MANAGED_TYPE_DEVICE
27 };
28
29 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.
30
31 virtual ~ManagedState();
32
33 // This will construct and return a new instance of the approprate class
34 // based on |type|.
35 static ManagedState* Create(ManagedType type, const std::string& path);
36
37 // Called by NetworkStateHandler when a property changes.
38 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.
39 const base::Value& value) = 0;
40
41 const ManagedType managed_type() const { return managed_type_; }
42 const std::string& path() const { return path_; }
43
44 private:
45 ManagedType managed_type_;
46 std::string path_;
47
48 DISALLOW_COPY_AND_ASSIGN(ManagedState);
49 };
50
51 } // namespace chromeos
52
53 #endif // CHROMEOS_NETWORK_MANAGED_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698