1 // Copyright 2019 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 "services/device/geolocation/win/fake_geoposition_winrt.h"
6 
7 #include "services/device/geolocation/win/fake_geocoordinate_winrt.h"
8 
9 namespace device {
10 namespace {
11 using ABI::Windows::Devices::Geolocation::ICivicAddress;
12 using ABI::Windows::Devices::Geolocation::IGeocoordinate;
13 using Microsoft::WRL::Make;
14 }  // namespace
15 
FakeGeoposition(std::unique_ptr<FakeGeocoordinateData> position_data)16 FakeGeoposition::FakeGeoposition(
17     std::unique_ptr<FakeGeocoordinateData> position_data)
18     : position_data_(std::move(position_data)) {}
19 
20 FakeGeoposition::~FakeGeoposition() = default;
21 
22 IFACEMETHODIMP
get_Coordinate(IGeocoordinate ** value)23 FakeGeoposition::get_Coordinate(IGeocoordinate** value) {
24   *value = Make<FakeGeocoordinate>(std::move(position_data_)).Detach();
25   return S_OK;
26 }
27 
get_CivicAddress(ICivicAddress ** value)28 IFACEMETHODIMP FakeGeoposition::get_CivicAddress(ICivicAddress** value) {
29   return E_NOTIMPL;
30 }
31 
32 }  // namespace device