Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2924)

Unified Diff: chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc

Issue 743273002: Various changes required to support ChromeVox Next to read Views and Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
diff --git a/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
index 0a2246aa8e66c5897a2cdd1204bb502ac8f9c64f..1448a211f2ca9a52ce8501b129b0719a66dec9c3 100644
--- a/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
+++ b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
@@ -5,15 +5,37 @@
#include "chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h"
#include "ash/shell.h"
+#include "base/strings/utf_string_conversions.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/aura/window.h"
#include "ui/views/accessibility/ax_aura_obj_cache.h"
-AXRootObjWrapper::AXRootObjWrapper(int32 id) : id_(id) {
+namespace {
+class AlertWindow : public aura::Window {
+ public:
+ AlertWindow() : aura::Window(NULL) {}
+ virtual ~AlertWindow() {}
+};
+
+} // namespace
+
+AXRootObjWrapper::AXRootObjWrapper(int32 id)
+ : id_(id), alert_window_(new AlertWindow()) {
}
-AXRootObjWrapper::~AXRootObjWrapper() {}
+AXRootObjWrapper::~AXRootObjWrapper() {
+ if (alert_window_) {
+ delete alert_window_;
+ alert_window_ = NULL;
+ }
+}
+
+views::AXAuraObjWrapper* AXRootObjWrapper::GetAlertForText(
+ const std::string& text) {
+ alert_window_->SetTitle(base::UTF8ToUTF16((text)));
+ return views::AXAuraObjCache::GetInstance()->GetOrCreate(alert_window_);
+}
bool AXRootObjWrapper::HasChild(views::AXAuraObjWrapper* child) {
std::vector<views::AXAuraObjWrapper*> children;
@@ -37,6 +59,9 @@ void AXRootObjWrapper::GetChildren(
out_children->push_back(
views::AXAuraObjCache::GetInstance()->GetOrCreate(children[i]));
}
+
+ out_children->push_back(
+ views::AXAuraObjCache::GetInstance()->GetOrCreate(alert_window_));
}
void AXRootObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
« no previous file with comments | « chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698