Chromium Code Reviews| Index: components/arc/intent_helper/arc_intent_helper_bridge.cc |
| diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.cc b/components/arc/intent_helper/arc_intent_helper_bridge.cc |
| index 5c962df9734bfe8824862a562475f1c7fde77aea..c94b3713cf47d65992e0ea876fc30452d43fa31c 100644 |
| --- a/components/arc/intent_helper/arc_intent_helper_bridge.cc |
| +++ b/components/arc/intent_helper/arc_intent_helper_bridge.cc |
| @@ -6,6 +6,7 @@ |
| #include "ash/shell.h" |
| #include "ash/shell_delegate.h" |
| +#include "components/arc/intent_helper/link_handler_model_impl.h" |
| #include "url/gurl.h" |
| namespace arc { |
| @@ -20,13 +21,27 @@ ArcIntentHelperBridge::~ArcIntentHelperBridge() { |
| } |
| void ArcIntentHelperBridge::OnIntentHelperInstanceReady() { |
| + ash::Shell::GetInstance()->open_with_menu_controller()->SetDelegate(this); |
| arc_bridge_service()->intent_helper_instance()->Init( |
| binding_.CreateInterfacePtrAndBind()); |
| } |
| +void ArcIntentHelperBridge::OnIntentHelperInstanceClosed() { |
| + ash::Shell::GetInstance()->open_with_menu_controller()->SetDelegate(nullptr); |
|
hidehiko
2016/04/20 18:10:18
Could you verify this is always called before this
Yusuke Sato
2016/04/22 05:27:48
Done. Copied line 30 to the destructor following a
|
| +} |
| + |
| void ArcIntentHelperBridge::OnOpenUrl(const mojo::String& url) { |
| GURL gurl(url.get()); |
| ash::Shell::GetInstance()->delegate()->OpenUrl(gurl); |
| } |
| +std::unique_ptr<ash::LinkHandlerModel> ArcIntentHelperBridge::CreateModel( |
| + const GURL& url) { |
| + std::unique_ptr<LinkHandlerModelImpl> impl( |
| + new LinkHandlerModelImpl(arc_bridge_service())); |
| + if (!impl->Init(url)) |
| + return nullptr; |
| + return std::move(impl); |
| +} |
| + |
| } // namespace arc |