Chromium Code Reviews| Index: content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc |
| diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc b/content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0da37f6f77917de8304f7cec87c2a974e3538b0d |
| --- /dev/null |
| +++ b/content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc |
| @@ -0,0 +1,39 @@ |
| +// 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 "content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.h" |
| + |
| +#include "content/public/test/layouttest_support.h" |
| +#include "content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h" |
| + |
| +namespace content { |
| + |
| +// static |
| +void LayoutTestBluetoothFakeAdapterSetterImpl::Create( |
| + int render_process_id, |
| + mojom::LayoutTestBluetoothFakeAdapterSetterRequest request) { |
| + new LayoutTestBluetoothFakeAdapterSetterImpl(render_process_id, |
| + std::move(request)); |
| +} |
| + |
| +LayoutTestBluetoothFakeAdapterSetterImpl:: |
| + LayoutTestBluetoothFakeAdapterSetterImpl( |
| + int render_process_id, |
| + mojom::LayoutTestBluetoothFakeAdapterSetterRequest request) |
| + : render_process_id_(render_process_id), |
| + binding_(this, std::move(request)) {} |
| + |
| +LayoutTestBluetoothFakeAdapterSetterImpl:: |
| + ~LayoutTestBluetoothFakeAdapterSetterImpl() {} |
| + |
| +void LayoutTestBluetoothFakeAdapterSetterImpl::Set( |
| + const mojo::String& adapter_name, |
| + const SetCallback& callback) { |
| + SetBluetoothAdapter(render_process_id_, |
| + LayoutTestBluetoothAdapterProvider::GetBluetoothAdapter( |
| + adapter_name.To<std::string>())); |
|
Jeffrey Yasskin
2016/03/24 23:47:54
It looks like you can use .get() to return a const
ortuno
2016/03/28 23:26:44
Hmm. I might have run into an edge case in another
|
| + callback.Run(); |
| +} |
| + |
| +} // namespace content |