| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 #ifndef CONTENT_PUBLIC_TEST_FAKE_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_ |
| 6 #define CONTENT_PUBLIC_TEST_FAKE_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_ |
| 7 |
| 8 #include "content/public/common/associated_interface_provider.h" |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "content/public/test/foo_interface.mojom.h" |
| 13 #include "mojo/public/cpp/bindings/associated_group_controller.h" |
| 14 |
| 15 namespace content { |
| 16 |
| 17 class FakeAssociatedInterfaceProviderImpl : public AssociatedInterfaceProvider { |
| 18 public: |
| 19 FakeAssociatedInterfaceProviderImpl(); |
| 20 ~FakeAssociatedInterfaceProviderImpl() override; |
| 21 |
| 22 // AssociatedInterfaceProvider: |
| 23 void GetInterface(const std::string& name, |
| 24 mojo::ScopedInterfaceEndpointHandle handle) override; |
| 25 mojo::AssociatedGroup* GetAssociatedGroup() override; |
| 26 void OverrideBinderForTesting( |
| 27 const std::string& name, |
| 28 const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder) |
| 29 override; |
| 30 |
| 31 private: |
| 32 mojom::FooInterfaceAssociatedPtr foo_ptr_; |
| 33 scoped_refptr<mojo::AssociatedGroupController> remote_controller_; |
| 34 |
| 35 using BinderMap = |
| 36 std::map<std::string, |
| 37 base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>>; |
| 38 BinderMap binders_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(FakeAssociatedInterfaceProviderImpl); |
| 41 }; |
| 42 |
| 43 } // namespace content |
| 44 |
| 45 #endif // CONTENT_PUBLIC_TEST_FAKE_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_ |
| OLD | NEW |