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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
// Copyright (c) 2010 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.
#include "chrome/browser/accessibility/browser_accessibility_manager_win.h"
#include "chrome/browser/accessibility/browser_accessibility_win.h"
#include "chrome/common/render_messages_params.h"
using webkit_glue::WebAccessibility;
// static
BrowserAccessibilityManager* BrowserAccessibilityManager::Create(
gfx::NativeView parent_view,
const WebAccessibility& src,
BrowserAccessibilityDelegate* delegate,
BrowserAccessibilityFactory* factory) {
return new BrowserAccessibilityManagerWin(
parent_view,
src,
delegate,
factory);
}
// Defining this here instead of in the base implementation file to address link
// errors on the linux shared library build. (linux shlib)
BrowserAccessibility* BrowserAccessibilityFactory::Create() {
return BrowserAccessibility::Create();
}
BrowserAccessibilityManagerWin*
BrowserAccessibilityManager::toBrowserAccessibilityManagerWin() {
return static_cast<BrowserAccessibilityManagerWin*>(this);
}
BrowserAccessibilityManagerWin::BrowserAccessibilityManagerWin(
HWND parent_view,
const WebAccessibility& src,
BrowserAccessibilityDelegate* delegate,
BrowserAccessibilityFactory* factory)
: BrowserAccessibilityManager(parent_view, src, delegate, factory) {
HRESULT hr = ::CreateStdAccessibleObject(
parent_view, OBJID_WINDOW, IID_IAccessible,
reinterpret_cast<void **>(&window_iaccessible_));
DCHECK(SUCCEEDED(hr));
}
BrowserAccessibilityManagerWin::~BrowserAccessibilityManagerWin() {
}
IAccessible* BrowserAccessibilityManagerWin::GetParentWindowIAccessible() {
return window_iaccessible_;
}
void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent(
int type,
BrowserAccessibility* node) {
LONG event_id;
switch (type) {
case ViewHostMsg_AccessibilityNotification_Params::
NOTIFICATION_TYPE_CHECK_STATE_CHANGED:
event_id = EVENT_OBJECT_STATECHANGE;
break;
case ViewHostMsg_AccessibilityNotification_Params::
NOTIFICATION_TYPE_CHILDREN_CHANGED:
event_id = EVENT_OBJECT_REORDER;
break;
case ViewHostMsg_AccessibilityNotification_Params::
NOTIFICATION_TYPE_FOCUS_CHANGED:
event_id = EVENT_OBJECT_FOCUS;
break;
case ViewHostMsg_AccessibilityNotification_Params::
NOTIFICATION_TYPE_LOAD_COMPLETE:
event_id = IA2_EVENT_DOCUMENT_LOAD_COMPLETE;
break;
case ViewHostMsg_AccessibilityNotification_Params::
NOTIFICATION_TYPE_VALUE_CHANGED:
event_id = EVENT_OBJECT_VALUECHANGE;
break;
case ViewHostMsg_AccessibilityNotification_Params::
NOTIFICATION_TYPE_SELECTED_TEXT_CHANGED:
event_id = IA2_EVENT_TEXT_CARET_MOVED;
}
NotifyWinEvent(event_id, GetParentView(), OBJID_CLIENT, node->child_id());
}
|