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 #include <vector> |
| 10 |
| 11 #include "base/callback.h" |
| 12 #include "components/arc/common/intent_helper.mojom.h" |
| 13 #include "components/arc/test/fake_arc_bridge_instance.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 |
| 16 namespace arc { |
| 17 |
| 18 class FakeIntentHelperInstance : public mojom::IntentHelperInstance { |
| 19 public: |
| 20 FakeIntentHelperInstance(); |
| 21 |
| 22 class Broadcast { |
| 23 public: |
| 24 Broadcast(const mojo::String& action, |
| 25 const mojo::String& package_name, |
| 26 const mojo::String& cls, |
| 27 const mojo::String& extras); |
| 28 |
| 29 ~Broadcast(); |
| 30 |
| 31 Broadcast(const Broadcast& broadcast); |
| 32 |
| 33 std::string action; |
| 34 std::string package_name; |
| 35 std::string cls; |
| 36 std::string extras; |
| 37 }; |
| 38 |
| 39 void clear_broadcasts() { broadcasts_.clear(); } |
| 40 |
| 41 const std::vector<Broadcast>& broadcasts() const { return broadcasts_; } |
| 42 |
| 43 // mojom::HelpIntentInstance: |
| 44 ~FakeIntentHelperInstance() override; |
| 45 |
| 46 void AddPreferredPackage(const mojo::String& package_name) override; |
| 47 |
| 48 void HandleUrl(const mojo::String& url, |
| 49 const mojo::String& package_name) override; |
| 50 |
| 51 void HandleUrlList(mojo::Array<mojom::UrlWithMimeTypePtr> urls, |
| 52 mojom::ActivityNamePtr activity, |
| 53 mojom::ActionType action) override; |
| 54 |
| 55 void HandleUrlListDeprecated(mojo::Array<mojom::UrlWithMimeTypePtr> urls, |
| 56 const mojo::String& package_name, |
| 57 mojom::ActionType action) override; |
| 58 |
| 59 void Init(mojom::IntentHelperHostPtr host_ptr) override; |
| 60 |
| 61 void RequestActivityIcons( |
| 62 mojo::Array<mojom::ActivityNamePtr> activities, |
| 63 ::arc::mojom::ScaleFactor scale_factor, |
| 64 const RequestActivityIconsCallback& callback) override; |
| 65 |
| 66 void RequestUrlHandlerList( |
| 67 const mojo::String& url, |
| 68 const RequestUrlHandlerListCallback& callback) override; |
| 69 |
| 70 void RequestUrlListHandlerList( |
| 71 mojo::Array<mojom::UrlWithMimeTypePtr> urls, |
| 72 const RequestUrlListHandlerListCallback& callback) override; |
| 73 |
| 74 void SendBroadcast(const mojo::String& action, |
| 75 const mojo::String& package_name, |
| 76 const mojo::String& cls, |
| 77 const mojo::String& extras) override; |
| 78 |
| 79 private: |
| 80 std::vector<Broadcast> broadcasts_; |
| 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(FakeIntentHelperInstance); |
| 83 }; |
| 84 |
| 85 } // namespace arc |
| 86 |
| 87 #endif // COMPONENTS_ARC_TEST_FAKE_POLICY_INSTANCE_H_ |
OLD | NEW |