Chromium Code Reviews| 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 COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_INSTANCE_H_ | |
| 6 #define COMPONENTS_ARC_TEST_FAKE_INTENT_HELPER_INSTANCE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "components/arc/common/intent_helper.mojom.h" | |
| 12 #include "components/arc/test/fake_arc_bridge_instance.h" | |
| 13 #include "mojo/public/cpp/bindings/binding.h" | |
| 14 | |
| 15 namespace arc { | |
| 16 | |
| 17 class FakeIntentHelperInstance : public mojom::IntentHelperInstance { | |
| 18 public: | |
| 19 typedef base::Callback<void(const std::string&, const std::string&)> | |
| 20 BroadcastCallback; | |
| 21 | |
| 22 FakeIntentHelperInstance(); | |
| 23 | |
| 24 // mojom::HelpIntentInstance: | |
| 25 ~FakeIntentHelperInstance() override; | |
| 26 | |
| 27 void AddPreferredPackage(const mojo::String& package_name) override; | |
| 28 | |
| 29 void HandleUrl(const mojo::String& url, | |
| 30 const mojo::String& package_name) override; | |
| 31 | |
| 32 void HandleUrlList(mojo::Array<mojom::UrlWithMimeTypePtr> urls, | |
| 33 mojom::ActivityNamePtr activity, | |
| 34 mojom::ActionType action) override; | |
| 35 | |
| 36 void HandleUrlListDeprecated(mojo::Array<mojom::UrlWithMimeTypePtr> urls, | |
| 37 const mojo::String& package_name, | |
| 38 mojom::ActionType action) override; | |
| 39 | |
| 40 void Init(mojom::IntentHelperHostPtr host_ptr) override; | |
| 41 | |
| 42 void RequestActivityIcons( | |
| 43 mojo::Array<mojom::ActivityNamePtr> activities, | |
| 44 ::arc::mojom::ScaleFactor scale_factor, | |
| 45 const RequestActivityIconsCallback& callback) override; | |
| 46 | |
| 47 void RequestUrlHandlerList( | |
| 48 const mojo::String& url, | |
| 49 const RequestUrlHandlerListCallback& callback) override; | |
| 50 | |
| 51 void RequestUrlListHandlerList( | |
| 52 mojo::Array<mojom::UrlWithMimeTypePtr> urls, | |
| 53 const RequestUrlListHandlerListCallback& callback) override; | |
| 54 | |
| 55 void SendBroadcast(const mojo::String& action, | |
| 56 const mojo::String& package_name, | |
| 57 const mojo::String& cls, | |
| 58 const mojo::String& extras) override; | |
| 59 | |
| 60 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.
| |
| 61 callback_ = callback; | |
| 62 } | |
| 63 private: | |
| 64 BroadcastCallback callback_; | |
| 65 | |
| 66 DISALLOW_COPY_AND_ASSIGN(FakeIntentHelperInstance); | |
| 67 }; | |
| 68 | |
| 69 } // namespace arc | |
| 70 | |
| 71 #endif // COMPONENTS_ARC_TEST_FAKE_POLICY_INSTANCE_H_ | |
| OLD | NEW |