This source file includes following definitions.
- CreateTextProvider
- get_IsReadOnly
#include "ui/base/win/accessibility_misc_utils.h"
#include "base/logging.h"
#include "ui/base/win/atl_module.h"
namespace base {
namespace win {
UIATextProvider::UIATextProvider()
: editable_(false) {}
bool UIATextProvider::CreateTextProvider(bool editable, IUnknown** provider) {
ui::win::CreateATLModuleIfNeeded();
CComObject<UIATextProvider>* text_provider = NULL;
HRESULT hr = CComObject<UIATextProvider>::CreateInstance(&text_provider);
if (SUCCEEDED(hr)) {
DCHECK(text_provider);
text_provider->set_editable(editable);
text_provider->AddRef();
*provider = static_cast<ITextProvider*>(text_provider);
return true;
}
return false;
}
STDMETHODIMP UIATextProvider::get_IsReadOnly(BOOL* read_only) {
*read_only = !editable_;
return S_OK;
}
}
}