forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmojo_test_interface_factory.cc
43 lines (34 loc) · 1.38 KB
/
mojo_test_interface_factory.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2017 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 "ash/mojo_test_interface_factory.h"
#include <utility>
#include "ash/public/interfaces/shelf_test_api.mojom.h"
#include "ash/public/interfaces/system_tray_test_api.mojom.h"
#include "ash/shelf/shelf_test_api.h"
#include "ash/system/tray/system_tray_test_api.h"
#include "base/bind.h"
#include "base/single_thread_task_runner.h"
namespace ash {
namespace mojo_test_interface_factory {
namespace {
// These functions aren't strictly necessary, but exist to make threading and
// arguments clearer.
void BindShelfTestApiOnMainThread(mojom::ShelfTestApiRequest request) {
ShelfTestApi::BindRequest(std::move(request));
}
void BindSystemTrayTestApiOnMainThread(
mojom::SystemTrayTestApiRequest request) {
SystemTrayTestApi::BindRequest(std::move(request));
}
} // namespace
void RegisterInterfaces(
service_manager::BinderRegistry* registry,
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) {
registry->AddInterface(base::Bind(&BindShelfTestApiOnMainThread),
main_thread_task_runner);
registry->AddInterface(base::Bind(&BindSystemTrayTestApiOnMainThread),
main_thread_task_runner);
}
} // namespace mojo_test_interface_factory
} // namespace ash