Always send enabled state in extension update checks
[chromium-blink-merge.git] / chromeos / dbus / services / liveness_service_provider.cc
blob1648793539b0df43e52126c3febacf3cd5d875cc
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.
5 #include "chromeos/dbus/services/liveness_service_provider.h"
7 #include "base/bind.h"
8 #include "dbus/bus.h"
9 #include "dbus/message.h"
10 #include "third_party/cros_system_api/dbus/service_constants.h"
12 namespace chromeos {
14 LivenessServiceProvider::LivenessServiceProvider() : weak_ptr_factory_(this) {}
16 LivenessServiceProvider::~LivenessServiceProvider() {}
18 void LivenessServiceProvider::Start(
19 scoped_refptr<dbus::ExportedObject> exported_object) {
20 exported_object->ExportMethod(
21 kLibCrosServiceInterface,
22 kCheckLiveness,
23 base::Bind(&LivenessServiceProvider::CheckLiveness,
24 weak_ptr_factory_.GetWeakPtr()),
25 base::Bind(&LivenessServiceProvider::OnExported,
26 weak_ptr_factory_.GetWeakPtr()));
29 void LivenessServiceProvider::OnExported(const std::string& interface_name,
30 const std::string& method_name,
31 bool success) {
32 if (!success) {
33 LOG(ERROR) << "Failed to export " << interface_name << "."
34 << method_name;
38 void LivenessServiceProvider::CheckLiveness(
39 dbus::MethodCall* method_call,
40 dbus::ExportedObject::ResponseSender response_sender) {
41 response_sender.Run(dbus::Response::FromMethodCall(method_call));
44 } // namespace chromeos