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 #include "components/arc/intent_helper/arc_intent_helper_bridge.h" |
| 6 |
| 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" |
| 9 #include "url/gurl.h" |
| 10 |
| 11 namespace arc { |
| 12 |
| 13 ArcIntentHelperBridge::ArcIntentHelperBridge(ArcBridgeService* bridge_service) |
| 14 : ArcService(bridge_service), binding_(this) { |
| 15 arc_bridge_service()->AddObserver(this); |
| 16 } |
| 17 |
| 18 ArcIntentHelperBridge::~ArcIntentHelperBridge() { |
| 19 arc_bridge_service()->RemoveObserver(this); |
| 20 } |
| 21 |
| 22 void ArcIntentHelperBridge::OnIntentHelperInstanceReady() { |
| 23 arc_bridge_service()->intent_helper_instance()->Init( |
| 24 binding_.CreateInterfacePtrAndBind()); |
| 25 } |
| 26 |
| 27 void ArcIntentHelperBridge::OnOpenUrl(const mojo::String& url) { |
| 28 GURL gurl(url.get()); |
| 29 ash::Shell::GetInstance()->delegate()->OpenUrl(gurl); |
| 30 } |
| 31 |
| 32 } // namespace arc |
OLD | NEW |