Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / ui / base / win / accessibility_misc_utils.h
blobbb5befce2b3ddbdb35fa41dfb9dac28619eee0c7
1 // Copyright (c) 2012 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 #ifndef UI_BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_
5 #define UI_BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_
7 #include <atlbase.h>
8 #include <atlcom.h>
9 #include <UIAutomationCore.h>
11 #include "base/compiler_specific.h"
12 #include "base/strings/string16.h"
13 #include "ui/base/ui_base_export.h"
15 namespace base {
16 namespace win {
18 // UIA Text provider implementation for edit controls.
19 class UI_BASE_EXPORT UIATextProvider
20 : public NON_EXPORTED_BASE(CComObjectRootEx<CComMultiThreadModel>),
21 public IValueProvider,
22 public ITextProvider {
23 public:
24 BEGIN_COM_MAP(UIATextProvider)
25 COM_INTERFACE_ENTRY2(IUnknown, ITextProvider)
26 COM_INTERFACE_ENTRY(IValueProvider)
27 COM_INTERFACE_ENTRY(ITextProvider)
28 END_COM_MAP()
30 UIATextProvider();
31 ~UIATextProvider();
33 // Creates an instance of the UIATextProvider class.
34 // Returns true on success
35 static bool CreateTextProvider(const string16& value,
36 bool editable,
37 IUnknown** provider);
39 void set_editable(bool editable) {
40 editable_ = editable;
43 void set_value(const string16& value) { value_ = value; }
46 // IValueProvider methods.
48 STDMETHOD(get_IsReadOnly)(BOOL* read_only) override;
51 // IValueProvider methods.
53 STDMETHOD(SetValue)(const wchar_t* val) override;
55 STDMETHOD(get_Value)(BSTR* value) override;
58 // ITextProvider methods.
60 STDMETHOD(GetSelection)(SAFEARRAY** ret) override;
62 STDMETHOD(GetVisibleRanges)(SAFEARRAY** ret) override;
64 STDMETHOD(RangeFromChild)(IRawElementProviderSimple* child,
65 ITextRangeProvider** ret) override;
67 STDMETHOD(RangeFromPoint)(struct UiaPoint point,
68 ITextRangeProvider** ret) override;
70 STDMETHOD(get_DocumentRange)(ITextRangeProvider** ret) override;
72 STDMETHOD(get_SupportedTextSelection)(
73 enum SupportedTextSelection* ret) override;
75 private:
76 bool editable_;
77 string16 value_;
80 } // win
81 } // base
83 #endif // UI_BASE_WIN_ACCESSIBILITY_MISC_UTILS_H_