1 // Copyright (c) 2013 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.
5 #ifndef CHROMEOS_NETWORK_NETWORK_CONFIGURATION_OBSERVER_H_
6 #define CHROMEOS_NETWORK_NETWORK_CONFIGURATION_OBSERVER_H_
10 #include "base/macros.h"
13 class DictionaryValue
;
18 struct NetworkConfiguration
;
20 // Observer class for network configuration events.
21 class NetworkConfigurationObserver
{
23 // Indicates whether a configuration change is triggered by a user action,
24 // by an extension or by policy.
26 // Triggered by a user action.
28 // Triggered by an extension to install a configuration.
29 SOURCE_EXTENSION_INSTALL
,
30 // Triggered by a policy.
34 // Called whenever a network configuration is created, or an existing
35 // configuration is replaced (see comment for CreateConfiguration).
36 // |service_path| provides the Shill current identifier for the network.
37 // Use properties[GUID] to get the global unique identifier. |profile_path|
38 // can be used to determine whether or not the network is shared.
39 // |properties| contains the Shill properties that were passed to
40 // NetworkConfigurationHandler::CreateConfiguration.
41 virtual void OnConfigurationCreated(
42 const std::string
& service_path
,
43 const std::string
& profile_path
,
44 const base::DictionaryValue
& properties
,
47 // Called whenever a network configuration is removed. |service_path|
48 // provides the Shill current identifier for the network. |guid| will be set
49 // to the corresponding GUID for the network if known at the time of removal,
50 // otherwise it will be empty.
51 virtual void OnConfigurationRemoved(const std::string
& service_path
,
52 const std::string
& guid
,
55 // Called whenever network properties are set. |service_path| provides the
56 // Shill current identifier for the network. |guid| will be set to the
57 // corresponding GUID for the network. |set_properties| contains the Shill
58 // properties that were passed to NetworkConfigurationHandler::SetProperties.
59 virtual void OnPropertiesSet(const std::string
& service_path
,
60 const std::string
& guid
,
61 const base::DictionaryValue
& set_properties
,
64 // Called whenever the profile (e.g. shared or user) that a configuration is
65 // associated with changes (see comment for OnConfigurationCreated).
66 virtual void OnConfigurationProfileChanged(
67 const std::string
& service_path
,
68 const std::string
& profile_path
,
72 virtual ~NetworkConfigurationObserver() {}
75 DISALLOW_ASSIGN(NetworkConfigurationObserver
);
78 } // namespace chromeos
80 #endif // CHROMEOS_NETWORK_NETWORK_CONFIGURATION_OBSERVER_H_