summaryrefslogtreecommitdiff
path: root/chromium/services/device/geolocation/win/fake_position_changed_event_args_winrt.h
blob: 61692ca96c4081c0e7b143666d4fdfea54a54c36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2019 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 SERVICES_DEVICE_GEOLOCATION_WIN_FAKE_POSITION_CHANGED_EVENT_ARGS_WINRT_H_
#define SERVICES_DEVICE_GEOLOCATION_WIN_FAKE_POSITION_CHANGED_EVENT_ARGS_WINRT_H_

#include <windows.devices.geolocation.h>
#include <windows.foundation.h>
#include <wrl/client.h>
#include <wrl/implements.h>
#include <memory>

#include "base/macros.h"

namespace device {

struct FakeGeocoordinateData;

class FakePositionChangedEventArgs
    : public Microsoft::WRL::RuntimeClass<
          Microsoft::WRL::RuntimeClassFlags<
              Microsoft::WRL::WinRt | Microsoft::WRL::InhibitRoOriginateError>,
          ABI::Windows::Devices::Geolocation::IPositionChangedEventArgs> {
 public:
  explicit FakePositionChangedEventArgs(
      std::unique_ptr<FakeGeocoordinateData> position_data);

  FakePositionChangedEventArgs(const FakePositionChangedEventArgs&) = delete;
  FakePositionChangedEventArgs& operator=(const FakePositionChangedEventArgs&) =
      delete;

  ~FakePositionChangedEventArgs() override;
  IFACEMETHODIMP get_Position(
      ABI::Windows::Devices::Geolocation::IGeoposition** value) override;

 private:
  std::unique_ptr<FakeGeocoordinateData> position_data_;
};

}  // namespace device

#endif  // SERVICES_DEVICE_GEOLOCATION_WIN_FAKE_POSITION_CHANGED_EVENT_ARGS_WINRT_H_