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

Unified Diff: chrome/browser/gtk/accessible_widget_helper_gtk.cc

Issue 402099: Add an accessibility API for events raised outside of the web content. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 11 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
« no previous file with comments | « chrome/browser/gtk/accessible_widget_helper_gtk.h ('k') | chrome/browser/gtk/location_bar_view_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/accessible_widget_helper_gtk.cc
===================================================================
--- chrome/browser/gtk/accessible_widget_helper_gtk.cc (revision 0)
+++ chrome/browser/gtk/accessible_widget_helper_gtk.cc (revision 0)
@@ -0,0 +1,41 @@
+// 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/gtk/accessible_widget_helper_gtk.h"
+
+#include "app/l10n_util.h"
+#include "chrome/browser/profile.h"
+
+AccessibleWidgetHelper::AccessibleWidgetHelper(
+ GtkWidget* root_widget, Profile* profile)
+ : accessibility_event_router_(AccessibilityEventRouter::GetInstance()),
+ root_widget_(root_widget) {
+ accessibility_event_router_->AddRootWidget(root_widget_, profile);
+}
+
+AccessibleWidgetHelper::~AccessibleWidgetHelper() {
+ if (root_widget_)
+ accessibility_event_router_->RemoveRootWidget(root_widget_);
+ for (unsigned int i = 0; i < managed_widgets_.size(); i++) {
+ accessibility_event_router_->RemoveWidget(managed_widgets_[i]);
+ }
+}
+
+void AccessibleWidgetHelper::IgnoreWidget(GtkWidget* widget) {
+ accessibility_event_router_->IgnoreWidget(widget);
+ managed_widgets_.push_back(widget);
+}
+
+void AccessibleWidgetHelper::SetWidgetName(
+ GtkWidget* widget, std::string name) {
+ accessibility_event_router_->SetWidgetName(widget, name);
+ managed_widgets_.push_back(widget);
+}
+
+void AccessibleWidgetHelper::SetWidgetName(
+ GtkWidget* widget, int string_id) {
+ std::string name = l10n_util::GetStringUTF8(string_id);
+ accessibility_event_router_->SetWidgetName(widget, name);
+ managed_widgets_.push_back(widget);
+}
Property changes on: chrome/browser/gtk/accessible_widget_helper_gtk.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/gtk/accessible_widget_helper_gtk.h ('k') | chrome/browser/gtk/location_bar_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698