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

Unified Diff: content/browser/accessibility/browser_accessibility_manager_gtk.cc

Issue 9839069: Add initial GTK web accessibility framework. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months 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: content/browser/accessibility/browser_accessibility_manager_gtk.cc
===================================================================
--- content/browser/accessibility/browser_accessibility_manager_gtk.cc (revision 0)
+++ content/browser/accessibility/browser_accessibility_manager_gtk.cc (revision 0)
@@ -0,0 +1,66 @@
+// Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility_manager_gtk.h"
+
+#include "content/browser/accessibility/browser_accessibility_gtk.h"
+#include "content/common/accessibility_messages.h"
+
+using webkit_glue::WebAccessibility;
+
+// static
+BrowserAccessibilityManager* BrowserAccessibilityManager::Create(
+ gfx::NativeView parent_view,
+ const WebAccessibility& src,
+ BrowserAccessibilityDelegate* delegate,
+ BrowserAccessibilityFactory* factory) {
+ return new BrowserAccessibilityManagerGtk(
+ parent_view,
+ src,
+ delegate,
+ factory);
+}
+
+BrowserAccessibilityManagerGtk::BrowserAccessibilityManagerGtk(
+ GtkWidget* parent_view,
+ const WebAccessibility& src,
+ BrowserAccessibilityDelegate* delegate,
+ BrowserAccessibilityFactory* factory)
+ : BrowserAccessibilityManager(parent_view, src, delegate, factory) {
+}
+
+BrowserAccessibilityManagerGtk::~BrowserAccessibilityManagerGtk() {
+}
+
+void BrowserAccessibilityManagerGtk::NotifyAccessibilityEvent(
+ int type,
+ BrowserAccessibility* node) {
+ AtkObject* atk_object = node->toBrowserAccessibilityGtk()->GetAtkObject();
+
+ switch (type) {
+ case AccessibilityNotificationChildrenChanged:
+ RecursivelySendChildrenChanged(GetRoot()->toBrowserAccessibilityGtk());
+ break;
+ case AccessibilityNotificationFocusChanged:
+ g_signal_emit_by_name(atk_object, "focus-event", true);
+ atk_focus_tracker_notify(atk_object);
+ break;
+ default:
+ break;
+ }
+}
+
+void BrowserAccessibilityManagerGtk::RecursivelySendChildrenChanged(
+ BrowserAccessibilityGtk* node) {
+ AtkObject* atkObject = node->toBrowserAccessibilityGtk()->GetAtkObject();
+ for (unsigned int i = 0; i < node->children().size(); ++i) {
+ BrowserAccessibilityGtk* child =
+ node->children()[i]->toBrowserAccessibilityGtk();
+ g_signal_emit_by_name(atkObject,
+ "children-changed::add",
+ i,
+ child->GetAtkObject());
+ RecursivelySendChildrenChanged(child);
+ }
+}
Property changes on: content/browser/accessibility/browser_accessibility_manager_gtk.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698