Chromium Code Reviews| Index: components/arc/test/fake_intent_helper_instance.h |
| diff --git a/components/arc/test/fake_intent_helper_instance.h b/components/arc/test/fake_intent_helper_instance.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..284b4bcee1c0b96abda90f1cdd068f4f73450ec8 |
| --- /dev/null |
| +++ b/components/arc/test/fake_intent_helper_instance.h |
| @@ -0,0 +1,71 @@ |
| +// 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. |
| + |
| +#ifndef COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_INSTANCE_H_ |
| +#define COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_INSTANCE_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/callback.h" |
| +#include "components/arc/common/intent_helper.mojom.h" |
| +#include "components/arc/test/fake_arc_bridge_instance.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| + |
| +namespace arc { |
| + |
| +class FakeIntentHelperInstance : public mojom::IntentHelperInstance { |
| + public: |
| + typedef base::Callback<void(const std::string&, const std::string&)> |
| + BroadcastCallback; |
| + |
| + FakeIntentHelperInstance(); |
| + |
| + // mojom::HelpIntentInstance: |
| + ~FakeIntentHelperInstance() override; |
| + |
| + void AddPreferredPackage(const mojo::String& package_name) override; |
| + |
| + void HandleUrl(const mojo::String& url, |
| + const mojo::String& package_name) override; |
| + |
| + void HandleUrlList(mojo::Array<mojom::UrlWithMimeTypePtr> urls, |
| + mojom::ActivityNamePtr activity, |
| + mojom::ActionType action) override; |
| + |
| + void HandleUrlListDeprecated(mojo::Array<mojom::UrlWithMimeTypePtr> urls, |
| + const mojo::String& package_name, |
| + mojom::ActionType action) override; |
| + |
| + void Init(mojom::IntentHelperHostPtr host_ptr) override; |
| + |
| + void RequestActivityIcons( |
| + mojo::Array<mojom::ActivityNamePtr> activities, |
| + ::arc::mojom::ScaleFactor scale_factor, |
| + const RequestActivityIconsCallback& callback) override; |
| + |
| + void RequestUrlHandlerList( |
| + const mojo::String& url, |
| + const RequestUrlHandlerListCallback& callback) override; |
| + |
| + void RequestUrlListHandlerList( |
| + mojo::Array<mojom::UrlWithMimeTypePtr> urls, |
| + const RequestUrlListHandlerListCallback& callback) override; |
| + |
| + void SendBroadcast(const mojo::String& action, |
| + const mojo::String& package_name, |
| + const mojo::String& cls, |
| + const mojo::String& extras) override; |
| + |
| + void SetCallback(const BroadcastCallback& callback) { |
|
Luis Héctor Chávez
2016/09/02 15:58:48
Is it possible to instead have a normal std::vecto
Polina Bondarenko
2016/09/05 20:08:45
Done.
|
| + callback_ = callback; |
| + } |
| + private: |
| + BroadcastCallback callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FakeIntentHelperInstance); |
| +}; |
| + |
| +} // namespace arc |
| + |
| +#endif // COMPONENTS_ARC_TEST_FAKE_POLICY_INSTANCE_H_ |