summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 23:28:04 +0000
committerctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 23:28:04 +0000
commitc5c2a674dc1d102b2c1c89ef95e9a95b7fc299c4 (patch)
treede1fd47dafee134c33b4526c75efd93bd6c7824c
parent81219f7b519ebd87f8d3e97d23ebf197acfa50da (diff)
downloadchromium_src-c5c2a674dc1d102b2c1c89ef95e9a95b7fc299c4.zip
chromium_src-c5c2a674dc1d102b2c1c89ef95e9a95b7fc299c4.tar.gz
chromium_src-c5c2a674dc1d102b2c1c89ef95e9a95b7fc299c4.tar.bz2
Make BrowserAccessibilityManager cross platform. Step 1.
1. Move windows browser accessibility source and headers into chrome\browser\accessibility 2. Rename BrowserAccessibilityManager to BrowserAccessibilityManagerWin and BrowserAccessibility to BrowserAccessibilityWin 3. Add base classes that will eventually contain common browser accessibility code. BUG=55264 TEST=interactive_ui_tests:AccessibilityWinBrowserTest.* TEST=unit_tests:BrowserAccessibilityTest.* Review URL: http://codereview.chromium.org/3591003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61253 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/accessibility/accessibility_win_browsertest.cc (renamed from chrome/browser/accessibility_win_browsertest.cc)0
-rw-r--r--chrome/browser/accessibility/browser_accessibility.cc11
-rw-r--r--chrome/browser/accessibility/browser_accessibility.h36
-rw-r--r--chrome/browser/accessibility/browser_accessibility_manager.cc59
-rw-r--r--chrome/browser/accessibility/browser_accessibility_manager.h78
-rw-r--r--chrome/browser/accessibility/browser_accessibility_manager_win.cc (renamed from chrome/browser/browser_accessibility_manager_win.cc)194
-rw-r--r--chrome/browser/accessibility/browser_accessibility_manager_win.h (renamed from chrome/browser/browser_accessibility_manager_win.h)112
-rw-r--r--chrome/browser/accessibility/browser_accessibility_win.cc (renamed from chrome/browser/browser_accessibility_win.cc)207
-rw-r--r--chrome/browser/accessibility/browser_accessibility_win.h (renamed from chrome/browser/browser_accessibility_win.h)107
-rw-r--r--chrome/browser/accessibility/browser_accessibility_win_unittest.cc (renamed from chrome/browser/browser_accessibility_win_unittest.cc)79
-rw-r--r--chrome/browser/accessibility/browser_views_accessibility_browsertest.cc (renamed from chrome/browser/views/browser_views_accessibility_browsertest.cc)0
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc17
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.h2
-rw-r--r--chrome/chrome_browser.gypi18
-rw-r--r--chrome/chrome_tests.gypi8
15 files changed, 544 insertions, 384 deletions
diff --git a/chrome/browser/accessibility_win_browsertest.cc b/chrome/browser/accessibility/accessibility_win_browsertest.cc
index 8b7559e..8b7559e 100644
--- a/chrome/browser/accessibility_win_browsertest.cc
+++ b/chrome/browser/accessibility/accessibility_win_browsertest.cc
diff --git a/chrome/browser/accessibility/browser_accessibility.cc b/chrome/browser/accessibility/browser_accessibility.cc
new file mode 100644
index 0000000..fa87e09
--- /dev/null
+++ b/chrome/browser/accessibility/browser_accessibility.cc
@@ -0,0 +1,11 @@
+// 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.h"
+
+BrowserAccessibility::BrowserAccessibility() {
+}
+
+BrowserAccessibility::~BrowserAccessibility() {
+}
diff --git a/chrome/browser/accessibility/browser_accessibility.h b/chrome/browser/accessibility/browser_accessibility.h
new file mode 100644
index 0000000..a7d9719
--- /dev/null
+++ b/chrome/browser/accessibility/browser_accessibility.h
@@ -0,0 +1,36 @@
+// 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.
+
+#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_
+#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_
+#pragma once
+
+#include "base/basictypes.h"
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// BrowserAccessibility
+//
+// Class implementing the cross platform interface for the Browser-Renderer
+// communication of accessibility information, providing accessibility
+// to be used by screen readers and other assistive technology (AT).
+//
+// An implementation for each platform handles platform specific accessibility
+// APIs.
+//
+////////////////////////////////////////////////////////////////////////////////
+class BrowserAccessibility {
+ public:
+ // Creates the platform specific BrowserAccessibility. Ownership passes to the
+ // caller.
+ virtual ~BrowserAccessibility();
+
+ protected:
+ BrowserAccessibility();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility);
+};
+
+#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_
diff --git a/chrome/browser/accessibility/browser_accessibility_manager.cc b/chrome/browser/accessibility/browser_accessibility_manager.cc
new file mode 100644
index 0000000..256c62c
--- /dev/null
+++ b/chrome/browser/accessibility/browser_accessibility_manager.cc
@@ -0,0 +1,59 @@
+// 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.h"
+
+#include "chrome/common/render_messages_params.h"
+
+using webkit_glue::WebAccessibility;
+
+
+BrowserAccessibilityManager::BrowserAccessibilityManager(
+ gfx::NativeWindow parent_window)
+ : parent_window_(parent_window) {
+}
+
+BrowserAccessibilityManager::~BrowserAccessibilityManager() {
+}
+
+void BrowserAccessibilityManager::OnAccessibilityNotifications(
+ const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) {
+ for (uint32 index = 0; index < params.size(); index++) {
+ const ViewHostMsg_AccessibilityNotification_Params& param = params[index];
+
+ switch (param.notification_type) {
+ case ViewHostMsg_AccessibilityNotification_Params::
+ NOTIFICATION_TYPE_CHECK_STATE_CHANGED:
+ OnAccessibilityObjectStateChange(param.acc_obj);
+ break;
+ case ViewHostMsg_AccessibilityNotification_Params::
+ NOTIFICATION_TYPE_CHILDREN_CHANGED:
+ OnAccessibilityObjectChildrenChange(param.acc_obj);
+ break;
+ case ViewHostMsg_AccessibilityNotification_Params::
+ NOTIFICATION_TYPE_FOCUS_CHANGED:
+ OnAccessibilityObjectFocusChange(param.acc_obj);
+ break;
+ case ViewHostMsg_AccessibilityNotification_Params::
+ NOTIFICATION_TYPE_LOAD_COMPLETE:
+ OnAccessibilityObjectLoadComplete(param.acc_obj);
+ break;
+ case ViewHostMsg_AccessibilityNotification_Params::
+ NOTIFICATION_TYPE_VALUE_CHANGED:
+ OnAccessibilityObjectValueChange(param.acc_obj);
+ break;
+ case ViewHostMsg_AccessibilityNotification_Params::
+ NOTIFICATION_TYPE_SELECTED_TEXT_CHANGED:
+ OnAccessibilityObjectTextChange(param.acc_obj);
+ break;
+ default:
+ DCHECK(0);
+ break;
+ }
+ }
+}
+
+gfx::NativeWindow BrowserAccessibilityManager::GetParentWindow() {
+ return parent_window_;
+}
diff --git a/chrome/browser/accessibility/browser_accessibility_manager.h b/chrome/browser/accessibility/browser_accessibility_manager.h
new file mode 100644
index 0000000..984623e5
--- /dev/null
+++ b/chrome/browser/accessibility/browser_accessibility_manager.h
@@ -0,0 +1,78 @@
+// 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.
+
+#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
+#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
+#pragma once
+
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
+#include <oleacc.h>
+#endif
+
+#include <vector>
+
+#include "gfx/native_widget_types.h"
+#include "webkit/glue/webaccessibility.h"
+
+struct ViewHostMsg_AccessibilityNotification_Params;
+
+using webkit_glue::WebAccessibility;
+
+// Class that can perform actions on behalf of the BrowserAccessibilityManager.
+class BrowserAccessibilityDelegate {
+ public:
+ virtual ~BrowserAccessibilityDelegate() {}
+ virtual void SetAccessibilityFocus(int acc_obj_id) = 0;
+ virtual void AccessibilityDoDefaultAction(int acc_obj_id) = 0;
+};
+
+// Manages a tree of BrowserAccessibility objects.
+class BrowserAccessibilityManager {
+ public:
+ // Creates the platform specific BrowserAccessibilityManager. Ownership passes
+ // to the caller.
+ static BrowserAccessibilityManager* Create(
+ gfx::NativeWindow parent_window,
+ const webkit_glue::WebAccessibility& src,
+ BrowserAccessibilityDelegate* delegate);
+
+ virtual ~BrowserAccessibilityManager();
+
+ // Called when the renderer process has notified us of about tree changes.
+ // Send a notification to MSAA clients of the change.
+ void OnAccessibilityNotifications(
+ const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params);
+
+ gfx::NativeWindow GetParentWindow();
+
+#if defined(OS_WIN)
+ virtual IAccessible* GetRootAccessible() = 0;
+#endif
+
+ protected:
+ explicit BrowserAccessibilityManager(gfx::NativeWindow parent_window);
+
+ virtual void OnAccessibilityObjectStateChange(
+ const webkit_glue::WebAccessibility& acc_obj) = 0;
+ virtual void OnAccessibilityObjectChildrenChange(
+ const webkit_glue::WebAccessibility& acc_obj) = 0;
+ virtual void OnAccessibilityObjectFocusChange(
+ const webkit_glue::WebAccessibility& acc_obj) = 0;
+ virtual void OnAccessibilityObjectLoadComplete(
+ const webkit_glue::WebAccessibility& acc_obj) = 0;
+ virtual void OnAccessibilityObjectValueChange(
+ const webkit_glue::WebAccessibility& acc_obj) = 0;
+ virtual void OnAccessibilityObjectTextChange(
+ const webkit_glue::WebAccessibility& acc_obj) = 0;
+
+ private:
+ // The parent window.
+ gfx::NativeWindow parent_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager);
+};
+
+#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_
diff --git a/chrome/browser/browser_accessibility_manager_win.cc b/chrome/browser/accessibility/browser_accessibility_manager_win.cc
index 653ac20..e470f24 100644
--- a/chrome/browser/browser_accessibility_manager_win.cc
+++ b/chrome/browser/accessibility/browser_accessibility_manager_win.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/browser_accessibility_manager_win.h"
+#include "chrome/browser/accessibility/browser_accessibility_manager_win.h"
-#include "chrome/browser/browser_accessibility_win.h"
+#include "chrome/browser/accessibility/browser_accessibility_win.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/common/render_messages.h"
@@ -12,10 +12,19 @@
using webkit_glue::WebAccessibility;
+// static
+BrowserAccessibilityManager* BrowserAccessibilityManager::Create(
+ gfx::NativeWindow parent_window,
+ const webkit_glue::WebAccessibility& src,
+ BrowserAccessibilityDelegate* delegate) {
+ return new BrowserAccessibilityManagerWin(
+ parent_window, src, delegate, new BrowserAccessibilityWinFactory());
+}
+
// Factory method to create an instance of BrowserAccessibility
-BrowserAccessibility* BrowserAccessibilityFactory::Create() {
- CComObject<BrowserAccessibility>* instance;
- HRESULT hr = CComObject<BrowserAccessibility>::CreateInstance(&instance);
+BrowserAccessibilityWin* BrowserAccessibilityWinFactory::Create() {
+ CComObject<BrowserAccessibilityWin>* instance;
+ HRESULT hr = CComObject<BrowserAccessibilityWin>::CreateInstance(&instance);
DCHECK(SUCCEEDED(hr));
return instance->NewReference();
}
@@ -25,19 +34,19 @@ BrowserAccessibility* BrowserAccessibilityFactory::Create() {
// child IDs of 1, 2, 3, ... to access the children of an object by
// index, so we use negative IDs to clearly distinguish between indices
// and unique IDs.
-LONG BrowserAccessibilityManager::next_child_id_ = -1;
+LONG BrowserAccessibilityManagerWin::next_child_id_ = -1;
-BrowserAccessibilityManager::BrowserAccessibilityManager(
- HWND parent_hwnd,
+BrowserAccessibilityManagerWin::BrowserAccessibilityManagerWin(
+ HWND parent_window,
const webkit_glue::WebAccessibility& src,
BrowserAccessibilityDelegate* delegate,
- BrowserAccessibilityFactory* factory)
- : parent_hwnd_(parent_hwnd),
+ BrowserAccessibilityWinFactory* factory)
+ : BrowserAccessibilityManager(parent_window),
delegate_(delegate),
factory_(factory),
focus_(NULL) {
HRESULT hr = ::CreateStdAccessibleObject(
- parent_hwnd_, OBJID_WINDOW, IID_IAccessible,
+ parent_window, OBJID_WINDOW, IID_IAccessible,
reinterpret_cast<void **>(&window_iaccessible_));
DCHECK(SUCCEEDED(hr));
root_ = CreateAccessibilityTree(NULL, GetNextChildID(), src, 0);
@@ -45,7 +54,7 @@ BrowserAccessibilityManager::BrowserAccessibilityManager(
focus_ = root_;
}
-BrowserAccessibilityManager::~BrowserAccessibilityManager() {
+BrowserAccessibilityManagerWin::~BrowserAccessibilityManagerWin() {
// Clients could still hold references to some nodes of the tree, so
// calling Inactivate will make sure that as many nodes as possible are
// released now, and remaining nodes are marked as inactive so that
@@ -54,17 +63,17 @@ BrowserAccessibilityManager::~BrowserAccessibilityManager() {
root_->Release();
}
-BrowserAccessibility* BrowserAccessibilityManager::GetRoot() {
+BrowserAccessibilityWin* BrowserAccessibilityManagerWin::GetRoot() {
return root_;
}
-void BrowserAccessibilityManager::Remove(LONG child_id) {
+void BrowserAccessibilityManagerWin::Remove(LONG child_id) {
child_id_map_.erase(child_id);
}
-BrowserAccessibility* BrowserAccessibilityManager::GetFromChildID(
+BrowserAccessibilityWin* BrowserAccessibilityManagerWin::GetFromChildID(
LONG child_id) {
- base::hash_map<LONG, BrowserAccessibility*>::iterator iter =
+ base::hash_map<LONG, BrowserAccessibilityWin*>::iterator iter =
child_id_map_.find(child_id);
if (iter != child_id_map_.end()) {
return iter->second;
@@ -73,72 +82,32 @@ BrowserAccessibility* BrowserAccessibilityManager::GetFromChildID(
}
}
-IAccessible* BrowserAccessibilityManager::GetParentWindowIAccessible() {
+IAccessible* BrowserAccessibilityManagerWin::GetParentWindowIAccessible() {
return window_iaccessible_;
}
-HWND BrowserAccessibilityManager::GetParentHWND() {
- return parent_hwnd_;
-}
-
-BrowserAccessibility* BrowserAccessibilityManager::GetFocus(
- BrowserAccessibility* root) {
+BrowserAccessibilityWin* BrowserAccessibilityManagerWin::GetFocus(
+ BrowserAccessibilityWin* root) {
if (focus_ && (!root || focus_->IsDescendantOf(root)))
return focus_;
return NULL;
}
-void BrowserAccessibilityManager::SetFocus(const BrowserAccessibility& node) {
+void BrowserAccessibilityManagerWin::SetFocus(
+ const BrowserAccessibilityWin& node) {
if (delegate_)
delegate_->SetAccessibilityFocus(node.renderer_id());
}
-void BrowserAccessibilityManager::DoDefaultAction(
- const BrowserAccessibility& node) {
+void BrowserAccessibilityManagerWin::DoDefaultAction(
+ const BrowserAccessibilityWin& node) {
if (delegate_)
delegate_->AccessibilityDoDefaultAction(node.renderer_id());
}
-void BrowserAccessibilityManager::OnAccessibilityNotifications(
- const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) {
- for (uint32 index = 0; index < params.size(); index++) {
- const ViewHostMsg_AccessibilityNotification_Params& param = params[index];
-
- switch (param.notification_type) {
- case ViewHostMsg_AccessibilityNotification_Params::
- NOTIFICATION_TYPE_CHECK_STATE_CHANGED:
- OnAccessibilityObjectStateChange(param.acc_obj);
- break;
- case ViewHostMsg_AccessibilityNotification_Params::
- NOTIFICATION_TYPE_CHILDREN_CHANGED:
- OnAccessibilityObjectChildrenChange(param.acc_obj);
- break;
- case ViewHostMsg_AccessibilityNotification_Params::
- NOTIFICATION_TYPE_FOCUS_CHANGED:
- OnAccessibilityObjectFocusChange(param.acc_obj);
- break;
- case ViewHostMsg_AccessibilityNotification_Params::
- NOTIFICATION_TYPE_LOAD_COMPLETE:
- OnAccessibilityObjectLoadComplete(param.acc_obj);
- break;
- case ViewHostMsg_AccessibilityNotification_Params::
- NOTIFICATION_TYPE_VALUE_CHANGED:
- OnAccessibilityObjectValueChange(param.acc_obj);
- break;
- case ViewHostMsg_AccessibilityNotification_Params::
- NOTIFICATION_TYPE_SELECTED_TEXT_CHANGED:
- OnAccessibilityObjectTextChange(param.acc_obj);
- break;
- default:
- DCHECK(0);
- break;
- }
- }
-}
-
-bool BrowserAccessibilityManager::CanModifyTreeInPlace(
- BrowserAccessibility* current_root,
+bool BrowserAccessibilityManagerWin::CanModifyTreeInPlace(
+ BrowserAccessibilityWin* current_root,
const webkit_glue::WebAccessibility& new_root) {
if (current_root->renderer_id() != new_root.id)
return false;
@@ -153,8 +122,8 @@ bool BrowserAccessibilityManager::CanModifyTreeInPlace(
return true;
}
-void BrowserAccessibilityManager::ModifyTreeInPlace(
- BrowserAccessibility* current_root,
+void BrowserAccessibilityManagerWin::ModifyTreeInPlace(
+ BrowserAccessibilityWin* current_root,
const webkit_glue::WebAccessibility& new_root) {
DCHECK_EQ(current_root->renderer_id(), new_root.id);
DCHECK_EQ(current_root->GetChildCount(), new_root.children.size());
@@ -168,7 +137,8 @@ void BrowserAccessibilityManager::ModifyTreeInPlace(
new_root);
}
-BrowserAccessibility* BrowserAccessibilityManager::UpdateTree(
+
+BrowserAccessibilityWin* BrowserAccessibilityManagerWin::UpdateTree(
const webkit_glue::WebAccessibility& acc_obj) {
base::hash_map<int, LONG>::iterator iter =
renderer_id_to_child_id_map_.find(acc_obj.id);
@@ -176,7 +146,7 @@ BrowserAccessibility* BrowserAccessibilityManager::UpdateTree(
return NULL;
LONG child_id = iter->second;
- BrowserAccessibility* old_browser_acc = GetFromChildID(child_id);
+ BrowserAccessibilityWin* old_browser_acc = GetFromChildID(child_id);
if (!old_browser_acc)
return NULL;
@@ -185,41 +155,45 @@ BrowserAccessibility* BrowserAccessibilityManager::UpdateTree(
return old_browser_acc;
}
- BrowserAccessibility* new_browser_acc = CreateAccessibilityTree(
- old_browser_acc->GetParent(),
- child_id,
- acc_obj,
- old_browser_acc->index_in_parent());
+ BrowserAccessibilityWin* new_browser_acc = CreateAccessibilityTree(
+ old_browser_acc->GetParent(),
+ child_id,
+ acc_obj,
+ old_browser_acc->index_in_parent());
+
+ if (old_browser_acc->GetParent()) {
+ old_browser_acc->GetParent()->ReplaceChild(
+ old_browser_acc,
+ new_browser_acc);
+ } else {
+ DCHECK_EQ(old_browser_acc, root_);
+ root_ = new_browser_acc;
+ }
+ old_browser_acc->InactivateTree();
+ old_browser_acc->Release();
+ child_id_map_[child_id] = new_browser_acc;
- if (old_browser_acc->GetParent()) {
- old_browser_acc->GetParent()->ReplaceChild(
- old_browser_acc,
- new_browser_acc);
- } else {
- DCHECK_EQ(old_browser_acc, root_);
- root_ = new_browser_acc;
- }
- old_browser_acc->InactivateTree();
- old_browser_acc->Release();
- child_id_map_[child_id] = new_browser_acc;
+ return new_browser_acc;
+}
- return new_browser_acc;
+IAccessible* BrowserAccessibilityManagerWin::GetRootAccessible() {
+ return root_;
}
-void BrowserAccessibilityManager::OnAccessibilityObjectStateChange(
+void BrowserAccessibilityManagerWin::OnAccessibilityObjectStateChange(
const webkit_glue::WebAccessibility& acc_obj) {
- BrowserAccessibility* new_browser_acc = UpdateTree(acc_obj);
+ BrowserAccessibilityWin* new_browser_acc = UpdateTree(acc_obj);
if (!new_browser_acc)
return;
LONG child_id = new_browser_acc->child_id();
NotifyWinEvent(
- EVENT_OBJECT_STATECHANGE, parent_hwnd_, OBJID_CLIENT, child_id);
+ EVENT_OBJECT_STATECHANGE, GetParentWindow(), OBJID_CLIENT, child_id);
}
-void BrowserAccessibilityManager::OnAccessibilityObjectChildrenChange(
+void BrowserAccessibilityManagerWin::OnAccessibilityObjectChildrenChange(
const webkit_glue::WebAccessibility& acc_obj) {
- BrowserAccessibility* new_browser_acc = UpdateTree(acc_obj);
+ BrowserAccessibilityWin* new_browser_acc = UpdateTree(acc_obj);
if (!new_browser_acc)
return;
@@ -230,21 +204,22 @@ void BrowserAccessibilityManager::OnAccessibilityObjectChildrenChange(
child_id = CHILDID_SELF;
}
- NotifyWinEvent(EVENT_OBJECT_REORDER, parent_hwnd_, OBJID_CLIENT, child_id);
+ NotifyWinEvent(
+ EVENT_OBJECT_REORDER, GetParentWindow(), OBJID_CLIENT, child_id);
}
-void BrowserAccessibilityManager::OnAccessibilityObjectFocusChange(
+void BrowserAccessibilityManagerWin::OnAccessibilityObjectFocusChange(
const webkit_glue::WebAccessibility& acc_obj) {
- BrowserAccessibility* new_browser_acc = UpdateTree(acc_obj);
+ BrowserAccessibilityWin* new_browser_acc = UpdateTree(acc_obj);
if (!new_browser_acc)
return;
focus_ = new_browser_acc;
LONG child_id = new_browser_acc->child_id();
- NotifyWinEvent(EVENT_OBJECT_FOCUS, parent_hwnd_, OBJID_CLIENT, child_id);
+ NotifyWinEvent(EVENT_OBJECT_FOCUS, GetParentWindow(), OBJID_CLIENT, child_id);
}
-void BrowserAccessibilityManager::OnAccessibilityObjectLoadComplete(
+void BrowserAccessibilityManagerWin::OnAccessibilityObjectLoadComplete(
const webkit_glue::WebAccessibility& acc_obj) {
root_->InactivateTree();
root_->Release();
@@ -255,34 +230,34 @@ void BrowserAccessibilityManager::OnAccessibilityObjectLoadComplete(
focus_ = root_;
LONG root_id = root_->child_id();
- NotifyWinEvent(EVENT_OBJECT_FOCUS, parent_hwnd_, OBJID_CLIENT, root_id);
+ NotifyWinEvent(EVENT_OBJECT_FOCUS, GetParentWindow(), OBJID_CLIENT, root_id);
NotifyWinEvent(
- IA2_EVENT_DOCUMENT_LOAD_COMPLETE, parent_hwnd_, OBJID_CLIENT, root_id);
+ IA2_EVENT_DOCUMENT_LOAD_COMPLETE, GetParentWindow(), OBJID_CLIENT, root_id);
}
-void BrowserAccessibilityManager::OnAccessibilityObjectValueChange(
+void BrowserAccessibilityManagerWin::OnAccessibilityObjectValueChange(
const webkit_glue::WebAccessibility& acc_obj) {
- BrowserAccessibility* new_browser_acc = UpdateTree(acc_obj);
+ BrowserAccessibilityWin* new_browser_acc = UpdateTree(acc_obj);
if (!new_browser_acc)
return;
LONG child_id = new_browser_acc->child_id();
NotifyWinEvent(
- EVENT_OBJECT_VALUECHANGE, parent_hwnd_, OBJID_CLIENT, child_id);
+ EVENT_OBJECT_VALUECHANGE, GetParentWindow(), OBJID_CLIENT, child_id);
}
-void BrowserAccessibilityManager::OnAccessibilityObjectTextChange(
+void BrowserAccessibilityManagerWin::OnAccessibilityObjectTextChange(
const webkit_glue::WebAccessibility& acc_obj) {
- BrowserAccessibility* new_browser_acc = UpdateTree(acc_obj);
+ BrowserAccessibilityWin* new_browser_acc = UpdateTree(acc_obj);
if (!new_browser_acc)
return;
LONG child_id = new_browser_acc->child_id();
NotifyWinEvent(
- IA2_EVENT_TEXT_CARET_MOVED, parent_hwnd_, OBJID_CLIENT, child_id);
+ IA2_EVENT_TEXT_CARET_MOVED, GetParentWindow(), OBJID_CLIENT, child_id);
}
-LONG BrowserAccessibilityManager::GetNextChildID() {
+LONG BrowserAccessibilityManagerWin::GetNextChildID() {
// Get the next child ID, and wrap around when we get near the end
// of a 32-bit integer range. It's okay to wrap around; we just want
// to avoid it as long as possible because clients may cache the ID of
@@ -294,12 +269,13 @@ LONG BrowserAccessibilityManager::GetNextChildID() {
return next_child_id_;
}
-BrowserAccessibility* BrowserAccessibilityManager::CreateAccessibilityTree(
- BrowserAccessibility* parent,
+BrowserAccessibilityWin*
+BrowserAccessibilityManagerWin::CreateAccessibilityTree(
+ BrowserAccessibilityWin* parent,
int child_id,
const webkit_glue::WebAccessibility& src,
int index_in_parent) {
- BrowserAccessibility* instance = factory_->Create();
+ BrowserAccessibilityWin* instance = factory_->Create();
instance->Initialize(this, parent, child_id, index_in_parent, src);
child_id_map_[child_id] = instance;
@@ -307,7 +283,7 @@ BrowserAccessibility* BrowserAccessibilityManager::CreateAccessibilityTree(
if ((src.state >> WebAccessibility::STATE_FOCUSED) & 1)
focus_ = instance;
for (int i = 0; i < static_cast<int>(src.children.size()); ++i) {
- BrowserAccessibility* child = CreateAccessibilityTree(
+ BrowserAccessibilityWin* child = CreateAccessibilityTree(
instance, GetNextChildID(), src.children[i], i);
instance->AddChild(child);
}
diff --git a/chrome/browser/browser_accessibility_manager_win.h b/chrome/browser/accessibility/browser_accessibility_manager_win.h
index 76cc2b6..4bdca66 100644
--- a/chrome/browser/browser_accessibility_manager_win.h
+++ b/chrome/browser/accessibility/browser_accessibility_manager_win.h
@@ -2,160 +2,144 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_
-#define CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_
+#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_
+#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_
#pragma once
#include <atlbase.h>
#include <atlcom.h>
#include <oleacc.h>
-#include <hash_map>
#include <vector>
+#include "chrome/browser/accessibility/browser_accessibility_manager.h"
#include "base/hash_tables.h"
#include "base/scoped_comptr_win.h"
#include "base/scoped_ptr.h"
#include "webkit/glue/webaccessibility.h"
-class BrowserAccessibility;
+class BrowserAccessibilityWin;
struct ViewHostMsg_AccessibilityNotification_Params;
-class BrowserAccessibilityFactory {
+class BrowserAccessibilityWinFactory {
public:
- virtual ~BrowserAccessibilityFactory() {}
+ virtual ~BrowserAccessibilityWinFactory() {}
- // Create an instance of BrowserAccessibility and return a new
+ // Create an instance of BrowserAccessibilityWin and return a new
// reference to it.
- virtual BrowserAccessibility* Create();
+ virtual BrowserAccessibilityWin* Create();
};
-// Class that can perform actions on behalf of the BrowserAccessibilityManager.
-class BrowserAccessibilityDelegate {
+// Manages a tree of BrowserAccessibilityWin objects.
+class BrowserAccessibilityManagerWin : public BrowserAccessibilityManager {
public:
- virtual ~BrowserAccessibilityDelegate() {}
- virtual void SetAccessibilityFocus(int acc_obj_id) = 0;
- virtual void AccessibilityDoDefaultAction(int acc_obj_id) = 0;
-};
-
-// Manages a tree of BrowserAccessibility objects.
-class BrowserAccessibilityManager {
- public:
- BrowserAccessibilityManager(
- HWND parent_hwnd,
+ BrowserAccessibilityManagerWin(
+ HWND parent_window,
const webkit_glue::WebAccessibility& src,
BrowserAccessibilityDelegate* delegate,
- BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory());
+ BrowserAccessibilityWinFactory* factory =
+ new BrowserAccessibilityWinFactory());
- virtual ~BrowserAccessibilityManager();
+ virtual ~BrowserAccessibilityManagerWin();
// Return a pointer to the root of the tree, does not make a new reference.
- BrowserAccessibility* GetRoot();
+ BrowserAccessibilityWin* GetRoot();
- // Removes the BrowserAccessibility child_id from the manager.
+ // Removes the BrowserAccessibilityWin child_id from the manager.
void Remove(LONG child_id);
// Return a pointer to the object corresponding to the given child_id,
// does not make a new reference.
- BrowserAccessibility* GetFromChildID(LONG child_id);
+ BrowserAccessibilityWin* GetFromChildID(LONG child_id);
// Get a the default IAccessible for the parent window, does not make a
// new reference.
IAccessible* GetParentWindowIAccessible();
- // Get the parent window.
- HWND GetParentHWND();
-
// Return the object that has focus, if it's a descandant of the
// given root (inclusive). Does not make a new reference.
- BrowserAccessibility* GetFocus(BrowserAccessibility* root);
+ BrowserAccessibilityWin* GetFocus(BrowserAccessibilityWin* root);
// Tell the renderer to set focus to this node.
- void SetFocus(const BrowserAccessibility& node);
+ void SetFocus(const BrowserAccessibilityWin& node);
// Tell the renderer to do the default action for this node.
- void DoDefaultAction(const BrowserAccessibility& node);
+ void DoDefaultAction(const BrowserAccessibilityWin& node);
- // Called when the renderer process has notified us of about tree changes.
- // Send a notification to MSAA clients of the change.
- void OnAccessibilityNotifications(
- const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params);
+ // BrowserAccessibilityManager Methods
+ virtual IAccessible* GetRootAccessible();
+ virtual void OnAccessibilityObjectStateChange(
+ const webkit_glue::WebAccessibility& acc_obj);
+ virtual void OnAccessibilityObjectChildrenChange(
+ const webkit_glue::WebAccessibility& acc_obj);
+ virtual void OnAccessibilityObjectFocusChange(
+ const webkit_glue::WebAccessibility& acc_obj);
+ virtual void OnAccessibilityObjectLoadComplete(
+ const webkit_glue::WebAccessibility& acc_obj);
+ virtual void OnAccessibilityObjectValueChange(
+ const webkit_glue::WebAccessibility& acc_obj);
+ virtual void OnAccessibilityObjectTextChange(
+ const webkit_glue::WebAccessibility& acc_obj);
private:
// Recursively compare the IDs of our subtree to a new subtree received
// from the renderer and return true if their IDs match exactly.
bool CanModifyTreeInPlace(
- BrowserAccessibility* current_root,
+ BrowserAccessibilityWin* current_root,
const webkit_glue::WebAccessibility& new_root);
// Recursively modify a subtree (by reinitializing) to match a new
// subtree received from the renderer process. Should only be called
// if CanModifyTreeInPlace returned true.
void ModifyTreeInPlace(
- BrowserAccessibility* current_root,
+ BrowserAccessibilityWin* current_root,
const webkit_glue::WebAccessibility& new_root);
// Update the accessibility tree with an updated WebAccessibility tree or
// subtree received from the renderer process. First attempts to modify
// the tree in place, and if that fails, replaces the entire subtree.
// Returns the updated node or NULL if no node was updated.
- BrowserAccessibility* UpdateTree(
- const webkit_glue::WebAccessibility& acc_obj);
-
- void OnAccessibilityObjectStateChange(
- const webkit_glue::WebAccessibility& acc_obj);
- void OnAccessibilityObjectChildrenChange(
- const webkit_glue::WebAccessibility& acc_obj);
- void OnAccessibilityObjectFocusChange(
- const webkit_glue::WebAccessibility& acc_obj);
- void OnAccessibilityObjectLoadComplete(
- const webkit_glue::WebAccessibility& acc_obj);
- void OnAccessibilityObjectValueChange(
- const webkit_glue::WebAccessibility& acc_obj);
- void OnAccessibilityObjectTextChange(
+ BrowserAccessibilityWin* UpdateTree(
const webkit_glue::WebAccessibility& acc_obj);
// Returns the next MSAA child id.
static LONG GetNextChildID();
- // Recursively build a tree of BrowserAccessibility objects from
+ // Recursively build a tree of BrowserAccessibilityWin objects from
// the WebAccessibility tree received from the renderer process.
- BrowserAccessibility* CreateAccessibilityTree(
- BrowserAccessibility* parent,
+ BrowserAccessibilityWin* CreateAccessibilityTree(
+ BrowserAccessibilityWin* parent,
int child_id,
const webkit_glue::WebAccessibility& src,
int index_in_parent);
- // The parent window.
- HWND parent_hwnd_;
-
// The object that can perform actions on our behalf.
BrowserAccessibilityDelegate* delegate_;
// Factory to create BrowserAccessibility objects (for dependency injection).
- scoped_ptr<BrowserAccessibilityFactory> factory_;
+ scoped_ptr<BrowserAccessibilityWinFactory> factory_;
// A default IAccessible instance for the parent window.
ScopedComPtr<IAccessible> window_iaccessible_;
// The root of the tree of IAccessible objects and the element that
// currently has focus, if any.
- BrowserAccessibility* root_;
- BrowserAccessibility* focus_;
+ BrowserAccessibilityWin* root_;
+ BrowserAccessibilityWin* focus_;
// A mapping from the IDs of objects in the renderer, to the child IDs
// we use internally here.
base::hash_map<int, LONG> renderer_id_to_child_id_map_;
- // A mapping from child IDs to BrowserAccessibility objects.
- base::hash_map<LONG, BrowserAccessibility*> child_id_map_;
+ // A mapping from child IDs to BrowserAccessibilityWin objects.
+ base::hash_map<LONG, BrowserAccessibilityWin*> child_id_map_;
// The next child ID to use; static so that they're global to the process.
// Screen readers cache these IDs to see if they've seen the same object
// before so we should avoid reusing them within the same project.
static LONG next_child_id_;
- DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager);
+ DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerWin);
};
-#endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_
+#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_
diff --git a/chrome/browser/browser_accessibility_win.cc b/chrome/browser/accessibility/browser_accessibility_win.cc
index 2517bef..f3520ee 100644
--- a/chrome/browser/browser_accessibility_win.cc
+++ b/chrome/browser/accessibility/browser_accessibility_win.cc
@@ -2,18 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/browser_accessibility_win.h"
+#include "chrome/browser/accessibility/browser_accessibility_win.h"
-#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/browser_accessibility_manager_win.h"
+#include "chrome/browser/accessibility/browser_accessibility_manager_win.h"
#include "net/base/escape.h"
using webkit_glue::WebAccessibility;
-BrowserAccessibility::BrowserAccessibility()
+BrowserAccessibilityWin::BrowserAccessibilityWin()
: manager_(NULL),
parent_(NULL),
child_id_(-1),
@@ -22,13 +21,13 @@ BrowserAccessibility::BrowserAccessibility()
instance_active_(false) {
}
-BrowserAccessibility::~BrowserAccessibility() {
+BrowserAccessibilityWin::~BrowserAccessibilityWin() {
InactivateTree();
}
-void BrowserAccessibility::Initialize(
- BrowserAccessibilityManager* manager,
- BrowserAccessibility* parent,
+void BrowserAccessibilityWin::Initialize(
+ BrowserAccessibilityManagerWin* manager,
+ BrowserAccessibilityWin* parent,
LONG child_id,
LONG index_in_parent,
const webkit_glue::WebAccessibility& src) {
@@ -62,11 +61,11 @@ void BrowserAccessibility::Initialize(
instance_active_ = true;
}
-void BrowserAccessibility::AddChild(BrowserAccessibility* child) {
+void BrowserAccessibilityWin::AddChild(BrowserAccessibilityWin* child) {
children_.push_back(child);
}
-void BrowserAccessibility::InactivateTree() {
+void BrowserAccessibilityWin::InactivateTree() {
if (!instance_active_)
return;
@@ -78,7 +77,7 @@ void BrowserAccessibility::InactivateTree() {
// references to them, so that as much of the tree as possible will be
// destroyed now - however, nodes that still have references to them
// might stick around a while until all clients have released them.
- for (std::vector<BrowserAccessibility*>::iterator iter =
+ for (std::vector<BrowserAccessibilityWin*>::iterator iter =
children_.begin();
iter != children_.end(); ++iter) {
(*iter)->InactivateTree();
@@ -88,7 +87,8 @@ void BrowserAccessibility::InactivateTree() {
manager_->Remove(child_id_);
}
-bool BrowserAccessibility::IsDescendantOf(BrowserAccessibility* ancestor) {
+bool BrowserAccessibilityWin::IsDescendantOf(
+ BrowserAccessibilityWin* ancestor) {
if (this == ancestor) {
return true;
} else if (parent_) {
@@ -98,27 +98,27 @@ bool BrowserAccessibility::IsDescendantOf(BrowserAccessibility* ancestor) {
return false;
}
-BrowserAccessibility* BrowserAccessibility::GetParent() {
+BrowserAccessibilityWin* BrowserAccessibilityWin::GetParent() {
return parent_;
}
-uint32 BrowserAccessibility::GetChildCount() {
+uint32 BrowserAccessibilityWin::GetChildCount() {
return children_.size();
}
-BrowserAccessibility* BrowserAccessibility::GetChild(uint32 child_index) {
+BrowserAccessibilityWin* BrowserAccessibilityWin::GetChild(uint32 child_index) {
DCHECK(child_index >= 0 && child_index < children_.size());
return children_[child_index];
}
-BrowserAccessibility* BrowserAccessibility::GetPreviousSibling() {
+BrowserAccessibilityWin* BrowserAccessibilityWin::GetPreviousSibling() {
if (parent_ && index_in_parent_ > 0)
return parent_->children_[index_in_parent_ - 1];
return NULL;
}
-BrowserAccessibility* BrowserAccessibility::GetNextSibling() {
+BrowserAccessibilityWin* BrowserAccessibilityWin::GetNextSibling() {
if (parent_ &&
index_in_parent_ >= 0 &&
index_in_parent_ < static_cast<int>(parent_->children_.size() - 1)) {
@@ -128,15 +128,15 @@ BrowserAccessibility* BrowserAccessibility::GetNextSibling() {
return NULL;
}
-void BrowserAccessibility::ReplaceChild(
- const BrowserAccessibility* old_acc, BrowserAccessibility* new_acc) {
+void BrowserAccessibilityWin::ReplaceChild(
+ const BrowserAccessibilityWin* old_acc, BrowserAccessibilityWin* new_acc) {
DCHECK_EQ(children_[old_acc->index_in_parent_], old_acc);
old_acc = children_[old_acc->index_in_parent_];
children_[old_acc->index_in_parent_] = new_acc;
}
-BrowserAccessibility* BrowserAccessibility::NewReference() {
+BrowserAccessibilityWin* BrowserAccessibilityWin::NewReference() {
AddRef();
return this;
}
@@ -150,11 +150,11 @@ BrowserAccessibility* BrowserAccessibility::NewReference() {
// * Return S_FALSE if the only output is a string argument and it's empty.
//
-HRESULT BrowserAccessibility::accDoDefaultAction(VARIANT var_id) {
+HRESULT BrowserAccessibilityWin::accDoDefaultAction(VARIANT var_id) {
if (!instance_active_)
return E_FAIL;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
@@ -162,7 +162,7 @@ HRESULT BrowserAccessibility::accDoDefaultAction(VARIANT var_id) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::accHitTest(LONG x_left, LONG y_top,
+STDMETHODIMP BrowserAccessibilityWin::accHitTest(LONG x_left, LONG y_top,
VARIANT* child) {
if (!instance_active_)
return E_FAIL;
@@ -173,7 +173,7 @@ STDMETHODIMP BrowserAccessibility::accHitTest(LONG x_left, LONG y_top,
return E_NOTIMPL;
}
-STDMETHODIMP BrowserAccessibility::accLocation(LONG* x_left, LONG* y_top,
+STDMETHODIMP BrowserAccessibilityWin::accLocation(LONG* x_left, LONG* y_top,
LONG* width, LONG* height,
VARIANT var_id) {
if (!instance_active_)
@@ -182,13 +182,13 @@ STDMETHODIMP BrowserAccessibility::accLocation(LONG* x_left, LONG* y_top,
if (!x_left || !y_top || !width || !height)
return E_INVALIDARG;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
// Find the top left corner of the containing window in screen coords, and
// adjust the output position by this amount.
- HWND parent_hwnd = manager_->GetParentHWND();
+ HWND parent_hwnd = manager_->GetParentWindow();
POINT top_left = {0, 0};
::ClientToScreen(parent_hwnd, &top_left);
@@ -200,9 +200,9 @@ STDMETHODIMP BrowserAccessibility::accLocation(LONG* x_left, LONG* y_top,
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::accNavigate(
+STDMETHODIMP BrowserAccessibilityWin::accNavigate(
LONG nav_dir, VARIANT start, VARIANT* end) {
- BrowserAccessibility* target = GetTargetFromChildID(start);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(start);
if (!target)
return E_INVALIDARG;
@@ -212,7 +212,7 @@ STDMETHODIMP BrowserAccessibility::accNavigate(
return E_INVALIDARG;
}
- BrowserAccessibility* result = NULL;
+ BrowserAccessibilityWin* result = NULL;
switch (nav_dir) {
case NAVDIR_DOWN:
case NAVDIR_UP:
@@ -246,7 +246,7 @@ STDMETHODIMP BrowserAccessibility::accNavigate(
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_accChild(VARIANT var_child,
+STDMETHODIMP BrowserAccessibilityWin::get_accChild(VARIANT var_child,
IDispatch** disp_child) {
if (!instance_active_)
return E_FAIL;
@@ -256,7 +256,7 @@ STDMETHODIMP BrowserAccessibility::get_accChild(VARIANT var_child,
*disp_child = NULL;
- BrowserAccessibility* target = GetTargetFromChildID(var_child);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_child);
if (!target)
return E_INVALIDARG;
@@ -264,7 +264,7 @@ STDMETHODIMP BrowserAccessibility::get_accChild(VARIANT var_child,
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_accChildCount(LONG* child_count) {
+STDMETHODIMP BrowserAccessibilityWin::get_accChildCount(LONG* child_count) {
if (!instance_active_)
return E_FAIL;
@@ -275,7 +275,7 @@ STDMETHODIMP BrowserAccessibility::get_accChildCount(LONG* child_count) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_accDefaultAction(VARIANT var_id,
+STDMETHODIMP BrowserAccessibilityWin::get_accDefaultAction(VARIANT var_id,
BSTR* def_action) {
if (!instance_active_)
return E_FAIL;
@@ -283,7 +283,7 @@ STDMETHODIMP BrowserAccessibility::get_accDefaultAction(VARIANT var_id,
if (!def_action)
return E_INVALIDARG;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
@@ -291,7 +291,7 @@ STDMETHODIMP BrowserAccessibility::get_accDefaultAction(VARIANT var_id,
WebAccessibility::ATTR_SHORTCUT, def_action);
}
-STDMETHODIMP BrowserAccessibility::get_accDescription(VARIANT var_id,
+STDMETHODIMP BrowserAccessibilityWin::get_accDescription(VARIANT var_id,
BSTR* desc) {
if (!instance_active_)
return E_FAIL;
@@ -299,21 +299,22 @@ STDMETHODIMP BrowserAccessibility::get_accDescription(VARIANT var_id,
if (!desc)
return E_INVALIDARG;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
return target->GetAttributeAsBstr(WebAccessibility::ATTR_DESCRIPTION, desc);
}
-STDMETHODIMP BrowserAccessibility::get_accFocus(VARIANT* focus_child) {
+STDMETHODIMP BrowserAccessibilityWin::get_accFocus(VARIANT* focus_child) {
if (!instance_active_)
return E_FAIL;
if (!focus_child)
return E_INVALIDARG;
- BrowserAccessibility* focus = manager_->GetFocus(this);
+ BrowserAccessibilityWin* focus = static_cast<BrowserAccessibilityWin*>(
+ manager_->GetFocus(this));
if (focus == this) {
focus_child->vt = VT_I4;
focus_child->lVal = CHILDID_SELF;
@@ -327,21 +328,21 @@ STDMETHODIMP BrowserAccessibility::get_accFocus(VARIANT* focus_child) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_accHelp(VARIANT var_id, BSTR* help) {
+STDMETHODIMP BrowserAccessibilityWin::get_accHelp(VARIANT var_id, BSTR* help) {
if (!instance_active_)
return E_FAIL;
if (!help)
return E_INVALIDARG;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
return target->GetAttributeAsBstr(WebAccessibility::ATTR_HELP, help);
}
-STDMETHODIMP BrowserAccessibility::get_accKeyboardShortcut(VARIANT var_id,
+STDMETHODIMP BrowserAccessibilityWin::get_accKeyboardShortcut(VARIANT var_id,
BSTR* acc_key) {
if (!instance_active_)
return E_FAIL;
@@ -349,21 +350,21 @@ STDMETHODIMP BrowserAccessibility::get_accKeyboardShortcut(VARIANT var_id,
if (!acc_key)
return E_INVALIDARG;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
return target->GetAttributeAsBstr(WebAccessibility::ATTR_SHORTCUT, acc_key);
}
-STDMETHODIMP BrowserAccessibility::get_accName(VARIANT var_id, BSTR* name) {
+STDMETHODIMP BrowserAccessibilityWin::get_accName(VARIANT var_id, BSTR* name) {
if (!instance_active_)
return E_FAIL;
if (!name)
return E_INVALIDARG;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
@@ -376,7 +377,7 @@ STDMETHODIMP BrowserAccessibility::get_accName(VARIANT var_id, BSTR* name) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_accParent(IDispatch** disp_parent) {
+STDMETHODIMP BrowserAccessibilityWin::get_accParent(IDispatch** disp_parent) {
if (!instance_active_)
return E_FAIL;
@@ -395,14 +396,15 @@ STDMETHODIMP BrowserAccessibility::get_accParent(IDispatch** disp_parent) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_accRole(VARIANT var_id, VARIANT* role) {
+STDMETHODIMP BrowserAccessibilityWin::get_accRole(
+ VARIANT var_id, VARIANT* role) {
if (!instance_active_)
return E_FAIL;
if (!role)
return E_INVALIDARG;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
@@ -416,7 +418,7 @@ STDMETHODIMP BrowserAccessibility::get_accRole(VARIANT var_id, VARIANT* role) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_accState(VARIANT var_id,
+STDMETHODIMP BrowserAccessibilityWin::get_accState(VARIANT var_id,
VARIANT* state) {
if (!instance_active_)
return E_FAIL;
@@ -424,7 +426,7 @@ STDMETHODIMP BrowserAccessibility::get_accState(VARIANT var_id,
if (!state)
return E_INVALIDARG;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
@@ -436,14 +438,15 @@ STDMETHODIMP BrowserAccessibility::get_accState(VARIANT var_id,
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_accValue(VARIANT var_id, BSTR* value) {
+STDMETHODIMP BrowserAccessibilityWin::get_accValue(
+ VARIANT var_id, BSTR* value) {
if (!instance_active_)
return E_FAIL;
if (!value)
return E_INVALIDARG;
- BrowserAccessibility* target = GetTargetFromChildID(var_id);
+ BrowserAccessibilityWin* target = GetTargetFromChildID(var_id);
if (!target)
return E_INVALIDARG;
@@ -453,20 +456,20 @@ STDMETHODIMP BrowserAccessibility::get_accValue(VARIANT var_id, BSTR* value) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_accHelpTopic(BSTR* help_file,
- VARIANT var_id,
- LONG* topic_id) {
+STDMETHODIMP BrowserAccessibilityWin::get_accHelpTopic(
+ BSTR* help_file, VARIANT var_id, LONG* topic_id) {
return E_NOTIMPL;
}
-STDMETHODIMP BrowserAccessibility::get_accSelection(VARIANT* selected) {
+STDMETHODIMP BrowserAccessibilityWin::get_accSelection(VARIANT* selected) {
if (!instance_active_)
return E_FAIL;
return E_NOTIMPL;
}
-STDMETHODIMP BrowserAccessibility::accSelect(LONG flags_sel, VARIANT var_id) {
+STDMETHODIMP BrowserAccessibilityWin::accSelect(
+ LONG flags_sel, VARIANT var_id) {
if (!instance_active_)
return E_FAIL;
@@ -482,7 +485,7 @@ STDMETHODIMP BrowserAccessibility::accSelect(LONG flags_sel, VARIANT var_id) {
// IAccessible2 methods.
//
-STDMETHODIMP BrowserAccessibility::role(LONG* role) {
+STDMETHODIMP BrowserAccessibilityWin::role(LONG* role) {
if (!instance_active_)
return E_FAIL;
@@ -494,7 +497,7 @@ STDMETHODIMP BrowserAccessibility::role(LONG* role) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_attributes(BSTR* attributes) {
+STDMETHODIMP BrowserAccessibilityWin::get_attributes(BSTR* attributes) {
if (!instance_active_)
return E_FAIL;
@@ -520,7 +523,7 @@ STDMETHODIMP BrowserAccessibility::get_attributes(BSTR* attributes) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_states(AccessibleStates* states) {
+STDMETHODIMP BrowserAccessibilityWin::get_states(AccessibleStates* states) {
if (!instance_active_)
return E_FAIL;
@@ -532,7 +535,7 @@ STDMETHODIMP BrowserAccessibility::get_states(AccessibleStates* states) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_uniqueID(LONG* unique_id) {
+STDMETHODIMP BrowserAccessibilityWin::get_uniqueID(LONG* unique_id) {
if (!instance_active_)
return E_FAIL;
@@ -543,18 +546,18 @@ STDMETHODIMP BrowserAccessibility::get_uniqueID(LONG* unique_id) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_windowHandle(HWND* window_handle) {
+STDMETHODIMP BrowserAccessibilityWin::get_windowHandle(HWND* window_handle) {
if (!instance_active_)
return E_FAIL;
if (!window_handle)
return E_INVALIDARG;
- *window_handle = manager_->GetParentHWND();
+ *window_handle = manager_->GetParentWindow();
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_indexInParent(LONG* index_in_parent) {
+STDMETHODIMP BrowserAccessibilityWin::get_indexInParent(LONG* index_in_parent) {
if (!instance_active_)
return E_FAIL;
@@ -569,7 +572,7 @@ STDMETHODIMP BrowserAccessibility::get_indexInParent(LONG* index_in_parent) {
// IAccessibleImage methods.
//
-STDMETHODIMP BrowserAccessibility::get_description(BSTR* desc) {
+STDMETHODIMP BrowserAccessibilityWin::get_description(BSTR* desc) {
if (!instance_active_)
return E_FAIL;
@@ -579,7 +582,7 @@ STDMETHODIMP BrowserAccessibility::get_description(BSTR* desc) {
return GetAttributeAsBstr(WebAccessibility::ATTR_DESCRIPTION, desc);
}
-STDMETHODIMP BrowserAccessibility::get_imagePosition(
+STDMETHODIMP BrowserAccessibilityWin::get_imagePosition(
enum IA2CoordinateType coordinate_type, LONG* x, LONG* y) {
if (!instance_active_)
return E_FAIL;
@@ -588,7 +591,7 @@ STDMETHODIMP BrowserAccessibility::get_imagePosition(
return E_INVALIDARG;
if (coordinate_type == IA2_COORDTYPE_SCREEN_RELATIVE) {
- HWND parent_hwnd = manager_->GetParentHWND();
+ HWND parent_hwnd = manager_->GetParentWindow();
POINT top_left = {0, 0};
::ClientToScreen(parent_hwnd, &top_left);
*x = location_.x + top_left.x;
@@ -607,7 +610,7 @@ STDMETHODIMP BrowserAccessibility::get_imagePosition(
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_imageSize(LONG* height, LONG* width) {
+STDMETHODIMP BrowserAccessibilityWin::get_imageSize(LONG* height, LONG* width) {
if (!instance_active_)
return E_FAIL;
@@ -623,7 +626,7 @@ STDMETHODIMP BrowserAccessibility::get_imageSize(LONG* height, LONG* width) {
// IAccessibleText methods.
//
-STDMETHODIMP BrowserAccessibility::get_nCharacters(LONG* n_characters) {
+STDMETHODIMP BrowserAccessibilityWin::get_nCharacters(LONG* n_characters) {
if (!instance_active_)
return E_FAIL;
@@ -639,7 +642,7 @@ STDMETHODIMP BrowserAccessibility::get_nCharacters(LONG* n_characters) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_text(
+STDMETHODIMP BrowserAccessibilityWin::get_text(
LONG start_offset, LONG end_offset, BSTR* text) {
if (!instance_active_)
return E_FAIL;
@@ -678,7 +681,7 @@ STDMETHODIMP BrowserAccessibility::get_text(
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_caretOffset(LONG* offset) {
+STDMETHODIMP BrowserAccessibilityWin::get_caretOffset(LONG* offset) {
if (!instance_active_)
return E_FAIL;
@@ -690,7 +693,7 @@ STDMETHODIMP BrowserAccessibility::get_caretOffset(LONG* offset) {
if (GetAttributeAsInt(WebAccessibility::ATTR_TEXT_SEL_START, &sel_start)) {
*offset = sel_start;
} else {
- *offset = 0;
+ *offset = 0;
}
} else {
*offset = 0;
@@ -699,7 +702,7 @@ STDMETHODIMP BrowserAccessibility::get_caretOffset(LONG* offset) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_nSelections(LONG* n_selections) {
+STDMETHODIMP BrowserAccessibilityWin::get_nSelections(LONG* n_selections) {
if (!instance_active_)
return E_FAIL;
@@ -723,9 +726,9 @@ STDMETHODIMP BrowserAccessibility::get_nSelections(LONG* n_selections) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_selection(LONG selection_index,
- LONG* start_offset,
- LONG* end_offset) {
+STDMETHODIMP BrowserAccessibilityWin::get_selection(LONG selection_index,
+ LONG* start_offset,
+ LONG* end_offset) {
if (!instance_active_)
return E_FAIL;
@@ -755,7 +758,7 @@ STDMETHODIMP BrowserAccessibility::get_selection(LONG selection_index,
// ISimpleDOMDocument methods.
//
-STDMETHODIMP BrowserAccessibility::get_URL(BSTR* url) {
+STDMETHODIMP BrowserAccessibilityWin::get_URL(BSTR* url) {
if (!instance_active_)
return E_FAIL;
@@ -765,7 +768,7 @@ STDMETHODIMP BrowserAccessibility::get_URL(BSTR* url) {
return GetAttributeAsBstr(WebAccessibility::ATTR_DOC_URL, url);
}
-STDMETHODIMP BrowserAccessibility::get_title(BSTR* title) {
+STDMETHODIMP BrowserAccessibilityWin::get_title(BSTR* title) {
if (!instance_active_)
return E_FAIL;
@@ -775,7 +778,7 @@ STDMETHODIMP BrowserAccessibility::get_title(BSTR* title) {
return GetAttributeAsBstr(WebAccessibility::ATTR_DOC_TITLE, title);
}
-STDMETHODIMP BrowserAccessibility::get_mimeType(BSTR* mime_type) {
+STDMETHODIMP BrowserAccessibilityWin::get_mimeType(BSTR* mime_type) {
if (!instance_active_)
return E_FAIL;
@@ -785,7 +788,7 @@ STDMETHODIMP BrowserAccessibility::get_mimeType(BSTR* mime_type) {
return GetAttributeAsBstr(WebAccessibility::ATTR_DOC_MIMETYPE, mime_type);
}
-STDMETHODIMP BrowserAccessibility::get_docType(BSTR* doc_type) {
+STDMETHODIMP BrowserAccessibilityWin::get_docType(BSTR* doc_type) {
if (!instance_active_)
return E_FAIL;
@@ -799,7 +802,7 @@ STDMETHODIMP BrowserAccessibility::get_docType(BSTR* doc_type) {
// ISimpleDOMNode methods.
//
-STDMETHODIMP BrowserAccessibility::get_nodeInfo(
+STDMETHODIMP BrowserAccessibilityWin::get_nodeInfo(
BSTR* node_name,
short* name_space_id,
BSTR* node_value,
@@ -837,7 +840,7 @@ STDMETHODIMP BrowserAccessibility::get_nodeInfo(
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_attributes(
+STDMETHODIMP BrowserAccessibilityWin::get_attributes(
unsigned short max_attribs,
BSTR* attrib_names,
short* name_space_id,
@@ -861,7 +864,7 @@ STDMETHODIMP BrowserAccessibility::get_attributes(
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_attributesForNames(
+STDMETHODIMP BrowserAccessibilityWin::get_attributesForNames(
unsigned short num_attribs,
BSTR* attrib_names,
short* name_space_id,
@@ -890,7 +893,7 @@ STDMETHODIMP BrowserAccessibility::get_attributesForNames(
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_computedStyle(
+STDMETHODIMP BrowserAccessibilityWin::get_computedStyle(
unsigned short max_style_properties,
boolean use_alternate_view,
BSTR *style_properties,
@@ -919,7 +922,7 @@ STDMETHODIMP BrowserAccessibility::get_computedStyle(
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_computedStyleForProperties(
+STDMETHODIMP BrowserAccessibilityWin::get_computedStyleForProperties(
unsigned short num_style_properties,
boolean use_alternate_view,
BSTR* style_properties,
@@ -947,11 +950,11 @@ STDMETHODIMP BrowserAccessibility::get_computedStyleForProperties(
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::scrollTo(boolean placeTopLeft) {
+STDMETHODIMP BrowserAccessibilityWin::scrollTo(boolean placeTopLeft) {
return E_NOTIMPL;
}
-STDMETHODIMP BrowserAccessibility::get_parentNode(ISimpleDOMNode** node) {
+STDMETHODIMP BrowserAccessibilityWin::get_parentNode(ISimpleDOMNode** node) {
if (!instance_active_)
return E_FAIL;
@@ -962,7 +965,7 @@ STDMETHODIMP BrowserAccessibility::get_parentNode(ISimpleDOMNode** node) {
return S_OK;
}
-STDMETHODIMP BrowserAccessibility::get_firstChild(ISimpleDOMNode** node) {
+STDMETHODIMP BrowserAccessibilityWin::get_firstChild(ISimpleDOMNode** node) {
if (!instance_active_)
return E_FAIL;
@@ -978,7 +981,7 @@ STDMETHODIMP BrowserAccessibility::get_firstChild(ISimpleDOMNode** node) {
}
}
-STDMETHODIMP BrowserAccessibility::get_lastChild(ISimpleDOMNode** node) {
+STDMETHODIMP BrowserAccessibilityWin::get_lastChild(ISimpleDOMNode** node) {
if (!instance_active_)
return E_FAIL;
@@ -994,7 +997,7 @@ STDMETHODIMP BrowserAccessibility::get_lastChild(ISimpleDOMNode** node) {
}
}
-STDMETHODIMP BrowserAccessibility::get_previousSibling(
+STDMETHODIMP BrowserAccessibilityWin::get_previousSibling(
ISimpleDOMNode** node) {
if (!instance_active_)
return E_FAIL;
@@ -1011,7 +1014,7 @@ STDMETHODIMP BrowserAccessibility::get_previousSibling(
}
}
-STDMETHODIMP BrowserAccessibility::get_nextSibling(ISimpleDOMNode** node) {
+STDMETHODIMP BrowserAccessibilityWin::get_nextSibling(ISimpleDOMNode** node) {
if (!instance_active_)
return E_FAIL;
@@ -1029,7 +1032,7 @@ STDMETHODIMP BrowserAccessibility::get_nextSibling(ISimpleDOMNode** node) {
}
}
-STDMETHODIMP BrowserAccessibility::get_childAt(
+STDMETHODIMP BrowserAccessibilityWin::get_childAt(
unsigned int child_index,
ISimpleDOMNode** node) {
if (!instance_active_)
@@ -1051,7 +1054,7 @@ STDMETHODIMP BrowserAccessibility::get_childAt(
// ISimpleDOMText methods.
//
-STDMETHODIMP BrowserAccessibility::get_domText(BSTR* dom_text) {
+STDMETHODIMP BrowserAccessibilityWin::get_domText(BSTR* dom_text) {
if (!instance_active_)
return E_FAIL;
@@ -1070,7 +1073,7 @@ STDMETHODIMP BrowserAccessibility::get_domText(BSTR* dom_text) {
// IServiceProvider methods.
//
-STDMETHODIMP BrowserAccessibility::QueryService(
+STDMETHODIMP BrowserAccessibilityWin::QueryService(
REFGUID guidService, REFIID riid, void** object) {
if (!instance_active_)
return E_FAIL;
@@ -1093,7 +1096,7 @@ STDMETHODIMP BrowserAccessibility::QueryService(
// CComObjectRootEx methods.
//
-HRESULT WINAPI BrowserAccessibility::InternalQueryInterface(
+HRESULT WINAPI BrowserAccessibilityWin::InternalQueryInterface(
void* this_ptr,
const _ATL_INTMAP_ENTRY* entries,
REFIID iid,
@@ -1123,7 +1126,7 @@ HRESULT WINAPI BrowserAccessibility::InternalQueryInterface(
// Private methods.
//
-BrowserAccessibility* BrowserAccessibility::GetTargetFromChildID(
+BrowserAccessibilityWin* BrowserAccessibilityWin::GetTargetFromChildID(
const VARIANT& var_id) {
if (var_id.vt != VT_I4)
return NULL;
@@ -1138,11 +1141,12 @@ BrowserAccessibility* BrowserAccessibility::GetTargetFromChildID(
return manager_->GetFromChildID(child_id);
}
-bool BrowserAccessibility::HasAttribute(WebAccessibility::Attribute attribute) {
+bool BrowserAccessibilityWin::HasAttribute(
+ WebAccessibility::Attribute attribute) {
return (attributes_.find(attribute) != attributes_.end());
}
-bool BrowserAccessibility::GetAttribute(
+bool BrowserAccessibilityWin::GetAttribute(
WebAccessibility::Attribute attribute, string16* value) {
std::map<int32, string16>::iterator iter = attributes_.find(attribute);
if (iter != attributes_.end()) {
@@ -1153,7 +1157,7 @@ bool BrowserAccessibility::GetAttribute(
return false;
}
-HRESULT BrowserAccessibility::GetAttributeAsBstr(
+HRESULT BrowserAccessibilityWin::GetAttributeAsBstr(
WebAccessibility::Attribute attribute, BSTR* value_bstr) {
string16 str;
@@ -1169,7 +1173,7 @@ HRESULT BrowserAccessibility::GetAttributeAsBstr(
return S_OK;
}
-bool BrowserAccessibility::GetAttributeAsInt(
+bool BrowserAccessibilityWin::GetAttributeAsInt(
WebAccessibility::Attribute attribute, int* value_int) {
string16 value_str;
@@ -1182,11 +1186,12 @@ bool BrowserAccessibility::GetAttributeAsInt(
return true;
}
-string16 BrowserAccessibility::Escape(string16 str) {
+string16 BrowserAccessibilityWin::Escape(string16 str) {
return EscapeQueryParamValueUTF8(str, false);
}
-void BrowserAccessibility::InitRoleAndState(LONG web_role, LONG web_state) {
+void BrowserAccessibilityWin::InitRoleAndState(LONG web_role,
+ LONG web_state) {
state_ = 0;
ia2_state_ = IA2_STATE_OPAQUE;
diff --git a/chrome/browser/browser_accessibility_win.h b/chrome/browser/accessibility/browser_accessibility_win.h
index a981c3a..26522b1 100644
--- a/chrome/browser/browser_accessibility_win.h
+++ b/chrome/browser/accessibility/browser_accessibility_win.h
@@ -2,47 +2,49 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_BROWSER_ACCESSIBILITY_WIN_H_
-#define CHROME_BROWSER_BROWSER_ACCESSIBILITY_WIN_H_
+#ifndef CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_
+#define CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_
#pragma once
#include <atlbase.h>
#include <atlcom.h>
#include <oleacc.h>
-#include <map>
#include <vector>
-#include "chrome/browser/browser_accessibility_manager_win.h"
+#include "chrome/browser/accessibility/browser_accessibility.h"
#include "ia2_api_all.h" // Generated
#include "ISimpleDOMDocument.h" // Generated
#include "ISimpleDOMNode.h" // Generated
#include "ISimpleDOMText.h" // Generated
#include "webkit/glue/webaccessibility.h"
+class BrowserAccessibilityManagerWin;
+
using webkit_glue::WebAccessibility;
////////////////////////////////////////////////////////////////////////////////
//
-// BrowserAccessibility
+// BrowserAccessibilityWin
//
-// Class implementing the MSAA IAccessible COM interface for the
-// Browser-Renderer communication of MSAA information, providing accessibility
+// Class implementing the windows accessible interface for the Browser-Renderer
+// communication of accessibility information, providing accessibility
// to be used by screen readers and other assistive technology (AT).
//
////////////////////////////////////////////////////////////////////////////////
-class ATL_NO_VTABLE BrowserAccessibility
- : public CComObjectRootEx<CComMultiThreadModel>,
- public IDispatchImpl<IAccessible2, &IID_IAccessible2,
- &LIBID_IAccessible2Lib>,
- public IAccessibleImage,
- public IAccessibleText,
- public IServiceProvider,
- public ISimpleDOMDocument,
- public ISimpleDOMNode,
- public ISimpleDOMText {
+class BrowserAccessibilityWin
+ : public BrowserAccessibility,
+ public CComObjectRootEx<CComMultiThreadModel>,
+ public IDispatchImpl<IAccessible2, &IID_IAccessible2,
+ &LIBID_IAccessible2Lib>,
+ public IAccessibleImage,
+ public IAccessibleText,
+ public IServiceProvider,
+ public ISimpleDOMDocument,
+ public ISimpleDOMNode,
+ public ISimpleDOMText {
public:
- BEGIN_COM_MAP(BrowserAccessibility)
+ BEGIN_COM_MAP(BrowserAccessibilityWin)
COM_INTERFACE_ENTRY2(IDispatch, IAccessible2)
COM_INTERFACE_ENTRY2(IAccessible, IAccessible2)
COM_INTERFACE_ENTRY(IAccessible2)
@@ -54,19 +56,19 @@ class ATL_NO_VTABLE BrowserAccessibility
COM_INTERFACE_ENTRY(ISimpleDOMText)
END_COM_MAP()
- BrowserAccessibility();
+ BrowserAccessibilityWin();
- virtual ~BrowserAccessibility();
+ virtual ~BrowserAccessibilityWin();
// Initialize this object and mark it as active.
- void Initialize(BrowserAccessibilityManager* manager,
- BrowserAccessibility* parent,
+ void Initialize(BrowserAccessibilityManagerWin* manager,
+ BrowserAccessibilityWin* parent,
LONG child_id,
LONG index_in_parent,
const webkit_glue::WebAccessibility& src);
// Add a child of this object.
- void AddChild(BrowserAccessibility* child);
+ void AddChild(BrowserAccessibilityWin* child);
// Mark this object as inactive, and remove references to all children.
// When no other clients hold any references to this object it will be
@@ -74,30 +76,30 @@ class ATL_NO_VTABLE BrowserAccessibility
void InactivateTree();
// Return true if this object is equal to or a descendant of |ancestor|.
- bool IsDescendantOf(BrowserAccessibility* ancestor);
+ bool IsDescendantOf(BrowserAccessibilityWin* ancestor);
- // Returns the parent of this object, or NULL if it's the BrowserAccessibility
- // root.
- BrowserAccessibility* GetParent();
+ // Returns the parent of this object, or NULL if it's the
+ // BrowserAccessibilityWin root.
+ BrowserAccessibilityWin* GetParent();
- // Returns the number of children of this BrowserAccessibility object.
+ // Returns the number of children of this BrowserAccessibilityWin object.
uint32 GetChildCount();
// Return a pointer to the child with the given index.
- BrowserAccessibility* GetChild(uint32 child_index);
+ BrowserAccessibilityWin* GetChild(uint32 child_index);
// Return the previous sibling of this object, or NULL if it's the first
// child of its parent.
- BrowserAccessibility* GetPreviousSibling();
+ BrowserAccessibilityWin* GetPreviousSibling();
// Return the next sibling of this object, or NULL if it's the last child
// of its parent.
- BrowserAccessibility* GetNextSibling();
+ BrowserAccessibilityWin* GetNextSibling();
- // Replace a child BrowserAccessibility object. Used when updating the
+ // Replace a child BrowserAccessibilityWin object. Used when updating the
// accessibility tree.
void ReplaceChild(
- const BrowserAccessibility* old_acc, BrowserAccessibility* new_acc);
+ const BrowserAccessibilityWin* old_acc, BrowserAccessibilityWin* new_acc);
// Accessors
LONG child_id() const { return child_id_; }
@@ -105,9 +107,9 @@ class ATL_NO_VTABLE BrowserAccessibility
LONG index_in_parent() const { return index_in_parent_; }
// Add one to the reference count and return the same object. Always
- // use this method when returning a BrowserAccessibility object as
+ // use this method when returning a BrowserAccessibilityWin object as
// an output parameter to a COM interface, never use it otherwise.
- BrowserAccessibility* NewReference();
+ BrowserAccessibilityWin* NewReference();
//
// IAccessible methods.
@@ -282,6 +284,7 @@ class ATL_NO_VTABLE BrowserAccessibility
LONG* start_offset,
LONG* end_offset);
+
// IAccessibleText methods not implemented.
STDMETHODIMP addSelection(LONG start_offset, LONG end_offset) {
return E_NOTIMPL;
@@ -297,26 +300,26 @@ class ATL_NO_VTABLE BrowserAccessibility
return E_NOTIMPL;
}
STDMETHODIMP get_offsetAtPoint(LONG x, LONG y,
- enum IA2CoordinateType coord_type,
- LONG* offset) {
+ enum IA2CoordinateType coord_type,
+ LONG* offset) {
return E_NOTIMPL;
}
STDMETHODIMP get_textBeforeOffset(LONG offset,
- enum IA2TextBoundaryType boundary_type,
- LONG* start_offset, LONG* end_offset,
- BSTR* text) {
+ enum IA2TextBoundaryType boundary_type,
+ LONG* start_offset, LONG* end_offset,
+ BSTR* text) {
return E_NOTIMPL;
}
STDMETHODIMP get_textAfterOffset(LONG offset,
- enum IA2TextBoundaryType boundary_type,
- LONG* start_offset, LONG* end_offset,
- BSTR* text) {
+ enum IA2TextBoundaryType boundary_type,
+ LONG* start_offset, LONG* end_offset,
+ BSTR* text) {
return E_NOTIMPL;
}
STDMETHODIMP get_textAtOffset(LONG offset,
- enum IA2TextBoundaryType boundary_type,
- LONG* start_offset, LONG* end_offset,
- BSTR* text) {
+ enum IA2TextBoundaryType boundary_type,
+ LONG* start_offset, LONG* end_offset,
+ BSTR* text) {
return E_NOTIMPL;
}
STDMETHODIMP removeSelection(LONG selection_index) {
@@ -491,7 +494,7 @@ class ATL_NO_VTABLE BrowserAccessibility
// This method tries to figure out the target object from |var_id| and
// returns a pointer to the target object if it exists, otherwise NULL.
// Does not return a new reference.
- BrowserAccessibility* GetTargetFromChildID(const VARIANT& var_id);
+ BrowserAccessibilityWin* GetTargetFromChildID(const VARIANT& var_id);
// Initialize the role and state metadata from the role enum and state
// bitmasks defined in webkit/glue/webaccessibility.h.
@@ -523,9 +526,9 @@ class ATL_NO_VTABLE BrowserAccessibility
// The manager of this tree of accessibility objects; needed for
// global operations like focus tracking.
- BrowserAccessibilityManager* manager_;
+ BrowserAccessibilityManagerWin* manager_;
// The parent of this object, may be NULL if we're the root object.
- BrowserAccessibility* parent_;
+ BrowserAccessibilityWin* parent_;
// The ID of this object; globally unique within the browser process.
LONG child_id_;
// The index of this within its parent object.
@@ -534,7 +537,7 @@ class ATL_NO_VTABLE BrowserAccessibility
int32 renderer_id_;
// The children of this object.
- std::vector<BrowserAccessibility*> children_;
+ std::vector<BrowserAccessibilityWin*> children_;
// Accessibility metadata from the renderer, used to respond to MSAA
// events.
@@ -558,7 +561,7 @@ class ATL_NO_VTABLE BrowserAccessibility
// failure.
bool instance_active_;
- DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility);
+ DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin);
};
-#endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_WIN_H_
+#endif // CHROME_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_
diff --git a/chrome/browser/browser_accessibility_win_unittest.cc b/chrome/browser/accessibility/browser_accessibility_win_unittest.cc
index f093153..abcb388 100644
--- a/chrome/browser/browser_accessibility_win_unittest.cc
+++ b/chrome/browser/accessibility/browser_accessibility_win_unittest.cc
@@ -4,30 +4,31 @@
#include "base/scoped_ptr.h"
#include "base/scoped_comptr_win.h"
-#include "chrome/browser/browser_accessibility_manager_win.h"
-#include "chrome/browser/browser_accessibility_win.h"
+#include "chrome/browser/accessibility/browser_accessibility_manager_win.h"
+#include "chrome/browser/accessibility/browser_accessibility_win.h"
#include "chrome/common/render_messages_params.h"
#include "testing/gtest/include/gtest/gtest.h"
using webkit_glue::WebAccessibility;
// Subclass of BrowserAccessibility that counts the number of instances.
-class CountedBrowserAccessibility : public BrowserAccessibility {
+class CountedBrowserAccessibilityWin : public BrowserAccessibilityWin {
public:
- CountedBrowserAccessibility() { global_obj_count_++; }
- virtual ~CountedBrowserAccessibility() { global_obj_count_--; }
+ CountedBrowserAccessibilityWin() { global_obj_count_++; }
+ virtual ~CountedBrowserAccessibilityWin() { global_obj_count_--; }
static int global_obj_count_;
};
-int CountedBrowserAccessibility::global_obj_count_ = 0;
+int CountedBrowserAccessibilityWin::global_obj_count_ = 0;
-// Factory that creates a CountedBrowserAccessibility.
-class CountedBrowserAccessibilityFactory : public BrowserAccessibilityFactory {
+// Factory that creates a CountedBrowserAccessibilityWin.
+class CountedBrowserAccessibilityWinFactory
+ : public BrowserAccessibilityWinFactory {
public:
- virtual ~CountedBrowserAccessibilityFactory() {}
- virtual BrowserAccessibility* Create() {
- CComObject<CountedBrowserAccessibility>* instance;
- HRESULT hr = CComObject<CountedBrowserAccessibility>::CreateInstance(
+ virtual ~CountedBrowserAccessibilityWinFactory() {}
+ virtual BrowserAccessibilityWin* Create() {
+ CComObject<CountedBrowserAccessibilityWin>* instance;
+ HRESULT hr = CComObject<CountedBrowserAccessibilityWin>::CreateInstance(
&instance);
DCHECK(SUCCEEDED(hr));
return instance->NewReference();
@@ -54,8 +55,7 @@ class BrowserAccessibilityTest : public testing::Test {
::CoInitialize(NULL);
}
- virtual void TearDown()
- {
+ virtual void TearDown() {
::CoUninitialize();
}
};
@@ -90,24 +90,25 @@ TEST_F(BrowserAccessibilityTest, TestNoLeaks) {
// and a factory for an instance-counting BrowserAccessibility, and ensure
// that exactly 3 instances were created. Note that the manager takes
// ownership of the factory.
- CountedBrowserAccessibility::global_obj_count_ = 0;
+ CountedBrowserAccessibilityWin::global_obj_count_ = 0;
+ // TODO: Use BrowserAccessibilityManager::Create instead of new below.
BrowserAccessibilityManager* manager =
- new BrowserAccessibilityManager(
+ new BrowserAccessibilityManagerWin(
GetDesktopWindow(), root, NULL,
- new CountedBrowserAccessibilityFactory());
- ASSERT_EQ(3, CountedBrowserAccessibility::global_obj_count_);
+ new CountedBrowserAccessibilityWinFactory());
+ ASSERT_EQ(3, CountedBrowserAccessibilityWin::global_obj_count_);
// Delete the manager and test that all 3 instances are deleted.
delete manager;
- ASSERT_EQ(0, CountedBrowserAccessibility::global_obj_count_);
+ ASSERT_EQ(0, CountedBrowserAccessibilityWin::global_obj_count_);
// Construct a manager again, and this time use the IAccessible interface
// to get new references to two of the three nodes in the tree.
- manager = new BrowserAccessibilityManager(
+ manager = new BrowserAccessibilityManagerWin(
GetDesktopWindow(), root, NULL,
- new CountedBrowserAccessibilityFactory());
- ASSERT_EQ(3, CountedBrowserAccessibility::global_obj_count_);
- BrowserAccessibility* root_accessible = manager->GetRoot();
+ new CountedBrowserAccessibilityWinFactory());
+ ASSERT_EQ(3, CountedBrowserAccessibilityWin::global_obj_count_);
+ IAccessible* root_accessible = manager->GetRootAccessible();
IDispatch* root_iaccessible = NULL;
IDispatch* child1_iaccessible = NULL;
VARIANT var_child;
@@ -122,14 +123,14 @@ TEST_F(BrowserAccessibilityTest, TestNoLeaks) {
// Now delete the manager, and only one of the three nodes in the tree
// should be released.
delete manager;
- ASSERT_EQ(2, CountedBrowserAccessibility::global_obj_count_);
+ ASSERT_EQ(2, CountedBrowserAccessibilityWin::global_obj_count_);
// Release each of our references and make sure that each one results in
// the instance being deleted as its reference count hits zero.
root_iaccessible->Release();
- ASSERT_EQ(1, CountedBrowserAccessibility::global_obj_count_);
+ ASSERT_EQ(1, CountedBrowserAccessibilityWin::global_obj_count_);
child1_iaccessible->Release();
- ASSERT_EQ(0, CountedBrowserAccessibility::global_obj_count_);
+ ASSERT_EQ(0, CountedBrowserAccessibilityWin::global_obj_count_);
}
TEST_F(BrowserAccessibilityTest, TestChildrenChange) {
@@ -151,17 +152,17 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChange) {
// Construct a BrowserAccessibilityManager with this WebAccessibility tree
// and a factory for an instance-counting BrowserAccessibility.
- CountedBrowserAccessibility::global_obj_count_ = 0;
+ CountedBrowserAccessibilityWin::global_obj_count_ = 0;
BrowserAccessibilityManager* manager =
- new BrowserAccessibilityManager(
+ new BrowserAccessibilityManagerWin(
GetDesktopWindow(), root, NULL,
- new CountedBrowserAccessibilityFactory());
+ new CountedBrowserAccessibilityWinFactory());
// Query for the text IAccessible and verify that it returns "old text" as its
// value.
ScopedComPtr<IDispatch> text_dispatch;
- HRESULT hr = manager->GetRoot()->get_accChild(CreateI4Variant(1),
- text_dispatch.Receive());
+ HRESULT hr = manager->GetRootAccessible()->get_accChild(
+ CreateI4Variant(1), text_dispatch.Receive());
ASSERT_EQ(S_OK, hr);
ScopedComPtr<IAccessible> text_accessible;
@@ -189,7 +190,7 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChange) {
// Query for the text IAccessible and verify that it now returns "new text"
// as its value.
- hr = manager->GetRoot()->get_accChild(
+ hr = manager->GetRootAccessible()->get_accChild(
CreateI4Variant(1),
text_dispatch.Receive());
ASSERT_EQ(S_OK, hr);
@@ -207,7 +208,7 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChange) {
// Delete the manager and test that all BrowserAccessibility instances are
// deleted.
delete manager;
- ASSERT_EQ(0, CountedBrowserAccessibility::global_obj_count_);
+ ASSERT_EQ(0, CountedBrowserAccessibilityWin::global_obj_count_);
}
TEST_F(BrowserAccessibilityTest, TestChildrenChangeNoLeaks) {
@@ -238,12 +239,12 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChangeNoLeaks) {
// and a factory for an instance-counting BrowserAccessibility and ensure
// that exactly 4 instances were created. Note that the manager takes
// ownership of the factory.
- CountedBrowserAccessibility::global_obj_count_ = 0;
+ CountedBrowserAccessibilityWin::global_obj_count_ = 0;
BrowserAccessibilityManager* manager =
- new BrowserAccessibilityManager(
+ new BrowserAccessibilityManagerWin(
GetDesktopWindow(), root, NULL,
- new CountedBrowserAccessibilityFactory());
- ASSERT_EQ(4, CountedBrowserAccessibility::global_obj_count_);
+ new CountedBrowserAccessibilityWinFactory());
+ ASSERT_EQ(4, CountedBrowserAccessibilityWin::global_obj_count_);
// Notify the BrowserAccessibilityManager that the div node and its children
// were removed and ensure that only one BrowserAccessibility instance exists.
@@ -256,10 +257,10 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChangeNoLeaks) {
std::vector<ViewHostMsg_AccessibilityNotification_Params> notifications;
notifications.push_back(param);
manager->OnAccessibilityNotifications(notifications);
- ASSERT_EQ(1, CountedBrowserAccessibility::global_obj_count_);
+ ASSERT_EQ(1, CountedBrowserAccessibilityWin::global_obj_count_);
// Delete the manager and test that all BrowserAccessibility instances are
// deleted.
delete manager;
- ASSERT_EQ(0, CountedBrowserAccessibility::global_obj_count_);
+ ASSERT_EQ(0, CountedBrowserAccessibilityWin::global_obj_count_);
}
diff --git a/chrome/browser/views/browser_views_accessibility_browsertest.cc b/chrome/browser/accessibility/browser_views_accessibility_browsertest.cc
index af33e2c..af33e2c 100644
--- a/chrome/browser/views/browser_views_accessibility_browsertest.cc
+++ b/chrome/browser/accessibility/browser_views_accessibility_browsertest.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index 5a279c6..152be78 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -11,10 +11,11 @@
#include "base/histogram.h"
#include "base/i18n/rtl.h"
#include "base/process_util.h"
+#include "base/scoped_comptr_win.h"
#include "base/thread.h"
#include "base/win_util.h"
-#include "chrome/browser/browser_accessibility_win.h"
-#include "chrome/browser/browser_accessibility_manager_win.h"
+#include "chrome/browser/accessibility/browser_accessibility.h"
+#include "chrome/browser/accessibility/browser_accessibility_manager.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_trial.h"
#include "chrome/browser/chrome_thread.h"
@@ -1489,7 +1490,7 @@ void RenderWidgetHostViewWin::OnAccessibilityNotifications(
empty_document.role = WebAccessibility::ROLE_DOCUMENT;
empty_document.state = 0;
browser_accessibility_manager_.reset(
- new BrowserAccessibilityManager(m_hWnd, empty_document, this));
+ BrowserAccessibilityManager::Create(m_hWnd, empty_document, this));
}
browser_accessibility_manager_->OnAccessibilityNotifications(params);
@@ -1552,13 +1553,13 @@ LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam,
loading_tree.role = WebAccessibility::ROLE_DOCUMENT;
loading_tree.state = (1 << WebAccessibility::STATE_BUSY);
browser_accessibility_manager_.reset(
- new BrowserAccessibilityManager(m_hWnd, loading_tree, this));
+ BrowserAccessibilityManager::Create(m_hWnd, loading_tree, this));
}
- BrowserAccessibility* root = browser_accessibility_manager_->GetRoot();
- if (root) {
- return LresultFromObject(IID_IAccessible, wparam,
- static_cast<IAccessible*>(root->NewReference()));
+ ScopedComPtr<IAccessible> root(
+ browser_accessibility_manager_->GetRootAccessible());
+ if (root.get()) {
+ return LresultFromObject(IID_IAccessible, wparam, root.Detach());
}
handled = false;
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h
index ff9a472..9fbaf11 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.h
@@ -16,7 +16,7 @@
#include "base/scoped_comptr_win.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
-#include "chrome/browser/browser_accessibility_manager_win.h"
+#include "chrome/browser/accessibility/browser_accessibility_manager.h"
#include "chrome/browser/ime_input.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/common/notification_observer.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 0f3ed35..bfbecc1 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -59,6 +59,14 @@
'sources': [
# All .cc, .h, .m, and .mm files under browser except for tests and
# mocks.
+ 'browser/accessibility/browser_accessibility.cc',
+ 'browser/accessibility/browser_accessibility.h',
+ 'browser/accessibility/browser_accessibility_manager.cc',
+ 'browser/accessibility/browser_accessibility_manager.h',
+ 'browser/accessibility/browser_accessibility_manager_win.cc',
+ 'browser/accessibility/browser_accessibility_manager_win.h',
+ 'browser/accessibility/browser_accessibility_win.cc',
+ 'browser/accessibility/browser_accessibility_win.h',
'browser/accessibility_events.h',
'browser/accessibility_events.cc',
'browser/aeropeek_manager.cc',
@@ -278,10 +286,6 @@
'browser/browser.h',
'browser/browser_about_handler.cc',
'browser/browser_about_handler.h',
- 'browser/browser_accessibility_win.cc',
- 'browser/browser_accessibility_win.h',
- 'browser/browser_accessibility_manager_win.cc',
- 'browser/browser_accessibility_manager_win.h',
'browser/browser_child_process_host.cc',
'browser/browser_child_process_host.h',
'browser/browser_init.cc',
@@ -3966,12 +3970,14 @@
],
# Exclude files that should be excluded for all non-Windows platforms.
'sources!': [
+ 'browser/accessibility/browser_accessibility_win.cc',
+ 'browser/accessibility/browser_accessibility_win.h',
+ 'browser/accessibility/browser_accessibility_manager_win.cc',
+ 'browser/accessibility/browser_accessibility_manager_win.h',
'browser/aeropeek_manager.cc',
'browser/autocomplete/autocomplete_accessibility.cc',
'browser/bookmarks/bookmark_menu_controller.cc',
'browser/bookmarks/bookmark_menu_controller.h',
- 'browser/browser_accessibility_win.cc',
- 'browser/browser_accessibility_manager_win.cc',
'browser/extensions/extension_tts_api_win.cc',
'browser/google/google_update.cc',
'browser/history/history_indexer.idl',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 5f47b0b..2f03cbf 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -410,10 +410,10 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
- 'browser/accessibility_win_browsertest.cc',
+ 'browser/accessibility/accessibility_win_browsertest.cc',
+ 'browser/accessibility/browser_views_accessibility_browsertest.cc',
# TODO: port sidebar.
'browser/sidebar/sidebar_test.cc',
- 'browser/views/browser_views_accessibility_browsertest.cc',
],
'conditions': [
['win_use_allocator_shim==1', {
@@ -965,6 +965,7 @@
'app/breakpad_mac_stubs.mm',
'app/chrome_dll.rc',
# All unittests in browser, common, renderer and service.
+ 'browser/accessibility/browser_accessibility_win_unittest.cc',
'browser/app_controller_mac_unittest.mm',
'browser/autocomplete_history_manager_unittest.cc',
'browser/autocomplete/autocomplete_edit_unittest.cc',
@@ -1015,7 +1016,6 @@
'browser/bookmarks/bookmark_model_unittest.cc',
'browser/bookmarks/bookmark_utils_unittest.cc',
'browser/browser_about_handler_unittest.cc',
- 'browser/browser_accessibility_win_unittest.cc',
'browser/browser_commands_unittest.cc',
'browser/themes/browser_theme_pack_unittest.cc',
'browser/themes/browser_theme_provider_unittest.cc',
@@ -1766,9 +1766,9 @@
}, { # else: OS != "win"
'sources!': [
'app/chrome_dll.rc',
+ 'browser/accessibility/browser_accessibility_win_unittest.cc',
'browser/bookmarks/bookmark_codec_unittest.cc',
'browser/bookmarks/bookmark_drag_data_unittest.cc',
- 'browser/browser_accessibility_win_unittest.cc',
'browser/chrome_plugin_unittest.cc',
'browser/extensions/extension_process_manager_unittest.cc',
'browser/login_prompt_unittest.cc',