| Index: services/shape_detection/shape_detection_service.cc
|
| diff --git a/services/shape_detection/shape_detection_service.cc b/services/shape_detection/shape_detection_service.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b24ddf4b41bd55f01a2ee8f90da93096ab6e2cf0
|
| --- /dev/null
|
| +++ b/services/shape_detection/shape_detection_service.cc
|
| @@ -0,0 +1,40 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "services/shape_detection/shape_detection_service.h"
|
| +
|
| +#include "base/macros.h"
|
| +#include "mojo/public/cpp/bindings/strong_binding.h"
|
| +#include "services/service_manager/public/cpp/interface_registry.h"
|
| +#include "services/service_manager/public/cpp/service_context.h"
|
| +#include "services/shape_detection/face_detection_impl.h"
|
| +
|
| +namespace shape_detection {
|
| +
|
| +std::unique_ptr<service_manager::Service> CreateShapeDetectionService() {
|
| + return base::MakeUnique<ShapeDetectionService>();
|
| +}
|
| +
|
| +ShapeDetectionService::ShapeDetectionService() = default;
|
| +
|
| +ShapeDetectionService::~ShapeDetectionService() = default;
|
| +
|
| +void ShapeDetectionService::OnStart() {
|
| + ref_factory_.reset(new service_manager::ServiceContextRefFactory(
|
| + base::Bind(&service_manager::ServiceContext::RequestQuit,
|
| + base::Unretained(context()))));
|
| +}
|
| +
|
| +bool ShapeDetectionService::OnConnect(
|
| + const service_manager::ServiceInfo& remote_info,
|
| + service_manager::InterfaceRegistry* registry) {
|
| + registry->AddInterface(base::Bind(&FaceDetectionImpl::Create));
|
| + return true;
|
| +}
|
| +
|
| +bool ShapeDetectionService::OnStop() {
|
| + return true;
|
| +}
|
| +
|
| +} // namespace shape_detection
|
|
|