Chromium Code Reviews| Index: components/arc/net/arc_net_host_impl.h |
| diff --git a/components/arc/net/arc_net_host_impl.h b/components/arc/net/arc_net_host_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b29ad794b89b583e9f453637646c69f57478b464 |
| --- /dev/null |
| +++ b/components/arc/net/arc_net_host_impl.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2015 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_NET_ARC_NET_BRIDGE_IMPL_H_ |
| +#define COMPONENTS_ARC_NET_ARC_NET_BRIDGE_IMPL_H_ |
| + |
| +#include <stdint.h> |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/files/scoped_file.h" |
| +#include "base/macros.h" |
| +#include "components/arc/arc_bridge_service.h" |
| +#include "components/arc/common/net.mojom.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| + |
| +namespace arc { |
| + |
| +class ArcBridgeService; |
| + |
| +// Private implementation of ArcNetHost |
| +class ArcNetHostImpl : public NetHost, |
| + public ArcBridgeService::Observer { |
| + public: |
| + // The constructor will register an Observer with ArcBridgeService. |
| + explicit ArcNetHostImpl(ArcBridgeService* arc_bridge_service); |
| + ~ArcNetHostImpl() override; |
| + |
| + // Calls Chrome API to get network properties. |
| + void GetNetworksFromChrome(bool configured_only, |
|
stevenjb
2016/01/12 22:14:04
Unused?
abhishekbh
2016/01/12 22:42:26
There is another Android API that will ask for con
stevenjb
2016/01/12 22:50:47
I mean the entire function does not exist in the C
Kevin Cernekee
2016/01/12 23:53:27
Yes, left over from a previous iteration. Fixed.
|
| + bool visible_only, |
| + std::vector<std::string> *networks); |
| + |
| + // Called when a GetNetworks call is sent from ARC. |
| + void OnGetNetworks(int request_id, |
| + bool configured_only, |
| + bool visible_only) override; |
| + |
| + // Request to send networks in response to get networks call from ARC. |
| + bool SendNetworks(int request_id, |
| + NetworkDataPtr data); |
| + |
| + // Overridden from ArcBridgeService::Observer: |
| + void OnNetInstanceReady() override; |
| + |
| + private: |
| + // Owned by ArcServiceManager which makes sure ArcBridgeService is destroyed |
| + // after ArcNetHost. |
| + ArcBridgeService* arc_bridge_service_; |
| + |
| + scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; |
| + mojo::Binding<arc::NetHost> binding_; |
| + |
| + // WeakPtrFactory to use for callbacks. |
| + base::WeakPtrFactory<ArcNetHostImpl> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ArcNetHostImpl); |
| +}; |
| + |
| +} // namespace arc |
| + |
| +#endif // COMPONENTS_ARC_NET_ARC_NET_BRIDGE_IMPL_H_ |