Flutter Engine
The Flutter Engine
uia_registrar_win.cc
Go to the documentation of this file.
1// Copyright 2020 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 "uia_registrar_win.h"
6#include <wrl/implements.h>
7
8namespace ui {
9
11 // Create the registrar object and get the IUIAutomationRegistrar
12 // interface pointer.
13 Microsoft::WRL::ComPtr<IUIAutomationRegistrar> registrar;
14 if (FAILED(CoCreateInstance(CLSID_CUIAutomationRegistrar, nullptr,
15 CLSCTX_INPROC_SERVER, IID_IUIAutomationRegistrar,
16 &registrar)))
17 return;
18
19 // Register the custom UIA property that represents the unique id of an UIA
20 // element which also matches its corresponding IA2 element's unique id.
21 UIAutomationPropertyInfo unique_id_property_info = {
22 kUiaPropertyUniqueIdGuid, L"UniqueId", UIAutomationType_String};
23 registrar->RegisterProperty(&unique_id_property_info,
24 &uia_unique_id_property_id_);
25
26 // Register the custom UIA event that represents the test end event for the
27 // UIA test suite.
28 UIAutomationEventInfo test_complete_event_info = {
29 kUiaEventTestCompleteSentinelGuid, L"kUiaTestCompleteSentinel"};
30 registrar->RegisterEvent(&test_complete_event_info,
31 &uia_test_complete_event_id_);
32}
33
35
37 return uia_unique_id_property_id_;
38}
39
41 return uia_test_complete_event_id_;
42}
43
46 return *instance;
47}
48
49} // namespace ui
PROPERTYID GetUiaUniqueIdPropertyId() const
EVENTID GetUiaTestCompleteEventId() const
static const UiaRegistrarWin & GetInstance()
VkInstance instance
Definition: main.cc:48
static const GUID kUiaEventTestCompleteSentinelGuid
static const GUID kUiaPropertyUniqueIdGuid
#define FAILED(hr)