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

Side by Side Diff: chromeos/network/shill_service_observer.cc

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 #include "chromeos/network/shill_service_observer.h"
6
7 #include "chromeos/dbus/dbus_thread_manager.h"
8 #include "chromeos/dbus/shill_service_client.h"
9 #include "dbus/object_path.h"
10
11 namespace chromeos {
12
13 ShillServiceObserver::ShillServiceObserver(const std::string& service_path,
14 const Handler& handler)
15 : service_path_(service_path),
16 handler_(handler) {
17 DBusThreadManager::Get()->GetShillServiceClient()->
18 AddPropertyChangedObserver(dbus::ObjectPath(service_path), this);
19 }
20
21 ShillServiceObserver::~ShillServiceObserver() {
22 DBusThreadManager::Get()->GetShillServiceClient()->
23 RemovePropertyChangedObserver(dbus::ObjectPath(service_path_), this);
24 }
25
26 void ShillServiceObserver::OnPropertyChanged(const std::string& key,
27 const base::Value& value) {
28 handler_.Run(service_path_, key, value);
29 }
30
31 } // namespace chromeos
OLDNEW
« chromeos/network/shill_service_observer.h ('K') | « chromeos/network/shill_service_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698