diff options
26 files changed, 0 insertions, 1218 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index 192a40e..517787d 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -41,7 +41,6 @@ #if defined(TOOLKIT_VIEWS) #include "chrome/browser/autocomplete/autocomplete_edit_view_views.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "views/controls/textfield/native_textfield_views.h" @@ -876,13 +875,6 @@ int AutocompleteEditViewGtk::OnPerformDrop( return ui::DragDropTypes::DRAG_NONE; } -void AutocompleteEditViewGtk::EnableAccessibility() { - accessible_widget_helper_.reset( - new AccessibleWidgetHelper(text_view(), model_->profile())); - accessible_widget_helper_->SetWidgetName( - text_view(), l10n_util::GetStringUTF8(IDS_ACCNAME_LOCATION)); -} - // static AutocompleteEditView* AutocompleteEditViewGtk::Create( AutocompleteEditController* controller, @@ -919,8 +911,6 @@ AutocompleteEditView* AutocompleteEditViewGtk::Create( // necessary. gtk_widget_hide(autocomplete->GetNativeView()); - autocomplete->EnableAccessibility(); - return autocomplete; } #endif diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h index 7ed1456..d101fe9 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h @@ -26,7 +26,6 @@ #include "ui/gfx/rect.h" #include "webkit/glue/window_open_disposition.h" -class AccessibleWidgetHelper; class AutocompleteEditController; class AutocompleteEditModel; class AutocompletePopupView; @@ -149,9 +148,6 @@ class AutocompleteEditViewGtk : public AutocompleteEditView, virtual views::View* AddToView(views::View* parent); virtual int OnPerformDrop(const views::DropTargetEvent& event); - // Enables accessibility on AutocompleteEditView. - void EnableAccessibility(); - // A factory method to create an AutocompleteEditView instance initialized for // linux_views. This currently returns an instance of // AutocompleteEditViewGtk only, but AutocompleteEditViewViews will @@ -545,10 +541,6 @@ class AutocompleteEditViewGtk : public AutocompleteEditView, ui::GtkSignalRegistrar signals_; -#if defined(TOOLKIT_VIEWS) - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; -#endif - DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk); }; diff --git a/chrome/browser/ui/gtk/accessibility_event_router_gtk.cc b/chrome/browser/ui/gtk/accessibility_event_router_gtk.cc deleted file mode 100644 index 04061c6..0000000 --- a/chrome/browser/ui/gtk/accessibility_event_router_gtk.cc +++ /dev/null @@ -1,658 +0,0 @@ -// Copyright (c) 2011 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/ui/gtk/accessibility_event_router_gtk.h" - -#include "base/basictypes.h" -#include "base/callback.h" -#include "base/message_loop.h" -#include "base/stl_util-inl.h" -#include "chrome/browser/extensions/extension_accessibility_api.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" -#include "chrome/common/notification_type.h" - -#if defined(TOOLKIT_VIEWS) -#include "views/controls/textfield/gtk_views_entry.h" -#include "views/controls/textfield/gtk_views_textview.h" -#include "views/controls/textfield/native_textfield_gtk.h" -#endif - -namespace { - -// -// Callbacks triggered by signals on gtk widgets. -// - -gboolean OnWidgetFocused(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - GtkWidget* widget = GTK_WIDGET(g_value_get_object(param_values)); - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - DispatchAccessibilityNotification( - widget, NotificationType::ACCESSIBILITY_CONTROL_FOCUSED); - return TRUE; -} - -gboolean OnButtonClicked(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - GtkWidget* widget = GTK_WIDGET(g_value_get_object(param_values)); - // Skip toggle buttons because we're also listening on "toggle" events. - if (GTK_IS_TOGGLE_BUTTON(widget)) - return true; - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - DispatchAccessibilityNotification( - widget, NotificationType::ACCESSIBILITY_CONTROL_ACTION); - return TRUE; -} - -gboolean OnButtonToggled(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - GtkWidget* widget = GTK_WIDGET(g_value_get_object(param_values)); - bool checked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); - // Skip propagating an "uncheck" event for a radio button because it's - // redundant; there will always be a corresponding "check" event for - // a different radio button the group. - if (GTK_IS_RADIO_BUTTON(widget) && !checked) - return true; - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - DispatchAccessibilityNotification( - widget, NotificationType::ACCESSIBILITY_CONTROL_ACTION); - return TRUE; -} - -gboolean OnPageSwitched(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - GtkWidget* widget = GTK_WIDGET(g_value_get_object(param_values)); - // The page hasn't switched yet, so defer calling - // DispatchAccessibilityNotification. - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - PostDispatchAccessibilityNotification( - widget, NotificationType::ACCESSIBILITY_CONTROL_ACTION); - return TRUE; -} - -gboolean OnComboBoxChanged(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - GtkWidget* widget = GTK_WIDGET(g_value_get_object(param_values)); - if (!GTK_IS_COMBO_BOX(widget)) - return true; - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - DispatchAccessibilityNotification( - widget, NotificationType::ACCESSIBILITY_CONTROL_ACTION); - return TRUE; -} - -gboolean OnTreeViewCursorChanged(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - GtkWidget* widget = GTK_WIDGET(g_value_get_object(param_values)); - if (!GTK_IS_TREE_VIEW(widget)) { - return true; - } - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - DispatchAccessibilityNotification( - widget, NotificationType::ACCESSIBILITY_CONTROL_ACTION); - return TRUE; -} - -gboolean OnEntryChanged(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - GtkWidget* widget = GTK_WIDGET(g_value_get_object(param_values)); - if (!GTK_IS_ENTRY(widget)) { - return TRUE; - } - // The text hasn't changed yet, so defer calling - // DispatchAccessibilityNotification. - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - PostDispatchAccessibilityNotification( - widget, NotificationType::ACCESSIBILITY_TEXT_CHANGED); - return TRUE; -} - -gboolean OnTextBufferChanged(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - // The text hasn't changed yet, so defer calling - // DispatchAccessibilityNotification. - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - PostDispatchAccessibilityNotification( - NULL, NotificationType::ACCESSIBILITY_TEXT_CHANGED); - return TRUE; -} - -gboolean OnTextViewChanged(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - GtkWidget* widget = GTK_WIDGET(g_value_get_object(param_values)); - if (!GTK_IS_TEXT_VIEW(widget)) { - return TRUE; - } - // The text hasn't changed yet, so defer calling - // DispatchAccessibilityNotification. - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - PostDispatchAccessibilityNotification( - widget, NotificationType::ACCESSIBILITY_TEXT_CHANGED); - return TRUE; -} - -gboolean OnMenuMoveCurrent(GSignalInvocationHint *ihint, - guint n_param_values, - const GValue* param_values, - gpointer user_data) { - // Get the widget (the GtkMenu). - GtkWidget* widget = GTK_WIDGET(g_value_get_object(param_values)); - - // Moving may move us into or out of a submenu, so after the menu - // item moves, |widget| may not be valid anymore. To be safe, then, - // find the topmost ancestor of this menu and post the notification - // dispatch on that menu. Then the dispatcher will recurse into submenus - // as necessary to figure out which item is focused. - while (GTK_MENU_SHELL(widget)->parent_menu_shell) - widget = GTK_MENU_SHELL(widget)->parent_menu_shell; - - // The menu item hasn't moved yet, so we want to defer calling - // DispatchAccessibilityNotification until after it does. - reinterpret_cast<AccessibilityEventRouterGtk*>(user_data)-> - PostDispatchAccessibilityNotification( - widget, NotificationType::ACCESSIBILITY_CONTROL_FOCUSED); - return TRUE; -} - -} // anonymous namespace - -AccessibilityEventRouterGtk::AccessibilityEventRouterGtk() - : listening_(false), - most_recent_profile_(NULL), - most_recent_widget_(NULL), - method_factory_(this) { - // We don't want our event listeners to be installed if accessibility is - // disabled. Install listeners so we can install and uninstall them as - // needed, then install them now if it's currently enabled. - ExtensionAccessibilityEventRouter *extension_event_router = - ExtensionAccessibilityEventRouter::GetInstance(); - extension_event_router->AddOnEnabledListener( - NewCallback(this, - &AccessibilityEventRouterGtk::InstallEventListeners)); - extension_event_router->AddOnDisabledListener( - NewCallback(this, - &AccessibilityEventRouterGtk::RemoveEventListeners)); - if (extension_event_router->IsAccessibilityEnabled()) { - InstallEventListeners(); - } -} - -AccessibilityEventRouterGtk::~AccessibilityEventRouterGtk() { - RemoveEventListeners(); -} - -// static -AccessibilityEventRouterGtk* AccessibilityEventRouterGtk::GetInstance() { - return Singleton<AccessibilityEventRouterGtk>::get(); -} - -void AccessibilityEventRouterGtk::InstallEventListener( - const char* signal_name, - GType widget_type, - GSignalEmissionHook hook_func) { - guint signal_id = g_signal_lookup(signal_name, widget_type); - gulong hook_id = g_signal_add_emission_hook( - signal_id, 0, hook_func, reinterpret_cast<gpointer>(this), NULL); - installed_hooks_.push_back(InstalledHook(signal_id, hook_id)); -} - -bool AccessibilityEventRouterGtk::IsPassword(GtkWidget* widget) { - bool is_password = false; -#if defined (TOOLKIT_VIEWS) - is_password = (GTK_IS_VIEWS_ENTRY(widget) && - GTK_VIEWS_ENTRY(widget)->host != NULL && - GTK_VIEWS_ENTRY(widget)->host->IsPassword()) || - (GTK_IS_VIEWS_TEXTVIEW(widget) && - GTK_VIEWS_TEXTVIEW(widget)->host != NULL && - GTK_VIEWS_TEXTVIEW(widget)->host->IsPassword()); -#endif - return is_password; -} - - -void AccessibilityEventRouterGtk::InstallEventListeners() { - // Create and destroy each type of widget we need signals for, - // to ensure their modules are loaded, otherwise g_signal_lookup - // might fail. - g_object_unref(g_object_ref_sink(gtk_combo_box_new())); - g_object_unref(g_object_ref_sink(gtk_entry_new())); - g_object_unref(g_object_ref_sink(gtk_notebook_new())); - g_object_unref(g_object_ref_sink(gtk_toggle_button_new())); - g_object_unref(g_object_ref_sink(gtk_tree_view_new())); - g_object_unref(g_object_ref_sink(gtk_text_view_new())); - g_object_unref(g_object_ref_sink(gtk_text_buffer_new(NULL))); - - // Add signal emission hooks for the events we're interested in. - InstallEventListener("clicked", GTK_TYPE_BUTTON, OnButtonClicked); - InstallEventListener("changed", GTK_TYPE_COMBO_BOX, OnComboBoxChanged); - InstallEventListener("cursor-changed", GTK_TYPE_TREE_VIEW, - OnTreeViewCursorChanged); - InstallEventListener("changed", GTK_TYPE_ENTRY, OnEntryChanged); - InstallEventListener("insert-text", GTK_TYPE_ENTRY, OnEntryChanged); - InstallEventListener("delete-text", GTK_TYPE_ENTRY, OnEntryChanged); - InstallEventListener("move-cursor", GTK_TYPE_ENTRY, OnEntryChanged); - InstallEventListener("focus-in-event", GTK_TYPE_WIDGET, OnWidgetFocused); - InstallEventListener("switch-page", GTK_TYPE_NOTEBOOK, OnPageSwitched); - InstallEventListener("toggled", GTK_TYPE_TOGGLE_BUTTON, OnButtonToggled); - InstallEventListener("move-current", GTK_TYPE_MENU, OnMenuMoveCurrent); - InstallEventListener("changed", GTK_TYPE_TEXT_BUFFER, OnTextBufferChanged); - InstallEventListener("move-cursor", GTK_TYPE_TEXT_VIEW, OnTextViewChanged); - - listening_ = true; -} - -void AccessibilityEventRouterGtk::RemoveEventListeners() { - for (size_t i = 0; i < installed_hooks_.size(); i++) { - g_signal_remove_emission_hook( - installed_hooks_[i].signal_id, - installed_hooks_[i].hook_id); - } - installed_hooks_.clear(); - - listening_ = false; -} - -void AccessibilityEventRouterGtk::AddRootWidget( - GtkWidget* root_widget, Profile* profile) { - root_widget_info_map_[root_widget].refcount++; - root_widget_info_map_[root_widget].profile = profile; -} - -void AccessibilityEventRouterGtk::RemoveRootWidget(GtkWidget* root_widget) { - DCHECK(root_widget_info_map_.find(root_widget) != - root_widget_info_map_.end()); - root_widget_info_map_[root_widget].refcount--; - if (root_widget_info_map_[root_widget].refcount == 0) { - root_widget_info_map_.erase(root_widget); - } -} - -void AccessibilityEventRouterGtk::AddWidgetNameOverride( - GtkWidget* widget, std::string name) { - widget_info_map_[widget].name = name; - widget_info_map_[widget].refcount++; -} - -void AccessibilityEventRouterGtk::RemoveWidgetNameOverride(GtkWidget* widget) { - DCHECK(widget_info_map_.find(widget) != widget_info_map_.end()); - widget_info_map_[widget].refcount--; - if (widget_info_map_[widget].refcount == 0) { - widget_info_map_.erase(widget); - } -} - -void AccessibilityEventRouterGtk::FindWidget( - GtkWidget* widget, Profile** profile, bool* is_accessible) { - *is_accessible = false; - - for (base::hash_map<GtkWidget*, RootWidgetInfo>::const_iterator iter = - root_widget_info_map_.begin(); - iter != root_widget_info_map_.end(); - ++iter) { - if (widget == iter->first || gtk_widget_is_ancestor(widget, iter->first)) { - *is_accessible = true; - if (profile) - *profile = iter->second.profile; - break; - } - } -} - -std::string AccessibilityEventRouterGtk::GetWidgetName(GtkWidget* widget) { - base::hash_map<GtkWidget*, WidgetInfo>::const_iterator iter = - widget_info_map_.find(widget); - if (iter != widget_info_map_.end()) { - return iter->second.name; - } else { - return ""; - } -} - -void AccessibilityEventRouterGtk::StartListening() { - listening_ = true; -} - -void AccessibilityEventRouterGtk::StopListening() { - listening_ = false; -} - -void AccessibilityEventRouterGtk::DispatchAccessibilityNotification( - GtkWidget* widget, NotificationType type) { - // If there's no message loop, we must be about to shutdown or we're - // running inside a test; either way, there's no reason to do any - // further processing. - if (!MessageLoop::current()) - return; - - if (!listening_) - return; - - Profile* profile = NULL; - bool is_accessible; - - // Special case: when we get ACCESSIBILITY_TEXT_CHANGED, we don't get - // a pointer to the widget, so we try to retrieve it from the most recent - // widget. - if (widget == NULL && - type == NotificationType::ACCESSIBILITY_TEXT_CHANGED && - most_recent_widget_ && - GTK_IS_TEXT_VIEW(most_recent_widget_)) { - widget = most_recent_widget_; - } - - if (!widget) - return; - - most_recent_widget_ = widget; - FindWidget(widget, &profile, &is_accessible); - if (profile) - most_recent_profile_ = profile; - - // Special case: a GtkMenu isn't associated with any particular - // toplevel window, so menu events get routed to the profile of - // the most recent event that was associated with a window. - if (GTK_IS_MENU_SHELL(widget) && most_recent_profile_) { - SendMenuItemNotification(widget, type, most_recent_profile_); - return; - } - - // In all other cases, return if this widget wasn't marked as accessible. - if (!is_accessible) - return; - - // The order of these checks matters, because, for example, a radio button - // is a subclass of button, and a combo box is a composite control where - // the focus event goes to the button that's a child of the combo box. - GtkWidget* parent = gtk_widget_get_parent(widget); - if (parent && GTK_IS_BUTTON(widget) && GTK_IS_TREE_VIEW(parent)) { - // This is a list box column header. Currently not supported. - return; - } else if (GTK_IS_COMBO_BOX(widget)) { - SendComboBoxNotification(widget, type, profile); - } else if (parent && GTK_IS_COMBO_BOX(parent)) { - SendComboBoxNotification(parent, type, profile); - } else if (GTK_IS_RADIO_BUTTON(widget)) { - SendRadioButtonNotification(widget, type, profile); - } else if (GTK_IS_TOGGLE_BUTTON(widget)) { - SendCheckboxNotification(widget, type, profile); - } else if (GTK_IS_BUTTON(widget)) { - SendButtonNotification(widget, type, profile); - } else if (GTK_IS_ENTRY(widget)) { - SendEntryNotification(widget, type, profile); - } else if (GTK_IS_TEXT_VIEW(widget)) { - SendTextViewNotification(widget, type, profile); - } else if (GTK_IS_NOTEBOOK(widget)) { - SendTabNotification(widget, type, profile); - } else if (GTK_IS_TREE_VIEW(widget)) { - SendListBoxNotification(widget, type, profile); - } else { - // If we have no idea what this control is, return and skip the - // temporary pause in event listening. - return; - } - - // After this method returns, additional signal handlers will run, - // which will sometimes generate additional signals. To avoid - // generating redundant accessibility notifications for the same - // initial event, stop listening to all signals generated from now - // until this posted task runs. - StopListening(); - MessageLoop::current()->PostTask( - FROM_HERE, method_factory_.NewRunnableMethod( - &AccessibilityEventRouterGtk::StartListening)); -} - -void AccessibilityEventRouterGtk::PostDispatchAccessibilityNotification( - GtkWidget* widget, NotificationType type) { - if (!MessageLoop::current()) - return; - - MessageLoop::current()->PostTask( - FROM_HERE, method_factory_.NewRunnableMethod( - &AccessibilityEventRouterGtk::DispatchAccessibilityNotification, - widget, - type)); -} - -void AccessibilityEventRouterGtk::SendRadioButtonNotification( - GtkWidget* widget, NotificationType type, Profile* profile) { - // Get the radio button name - std::string button_name = GetWidgetName(widget); - if (button_name.empty() && gtk_button_get_label(GTK_BUTTON(widget))) - button_name = gtk_button_get_label(GTK_BUTTON(widget)); - - // Get its state - bool checked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); - - // Get the index of this radio button and the total number of - // radio buttons in the group. - int item_count = 0; - int item_index = -1; - for (GSList* group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(widget)); - group; - group = group->next) { - if (group->data == widget) { - item_index = item_count; - } - item_count++; - } - item_index = item_count - 1 - item_index; - - AccessibilityRadioButtonInfo info( - profile, button_name, checked, item_index, item_count); - SendAccessibilityNotification(type, &info); -} - -void AccessibilityEventRouterGtk::SendCheckboxNotification( - GtkWidget* widget, NotificationType type, Profile* profile) { - std::string button_name = GetWidgetName(widget); - if (button_name.empty() && gtk_button_get_label(GTK_BUTTON(widget))) - button_name = gtk_button_get_label(GTK_BUTTON(widget)); - bool checked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); - AccessibilityCheckboxInfo info(profile, button_name, checked); - SendAccessibilityNotification(type, &info); -} - -void AccessibilityEventRouterGtk::SendButtonNotification( - GtkWidget* widget, NotificationType type, Profile* profile) { - std::string button_name = GetWidgetName(widget); - if (button_name.empty() && gtk_button_get_label(GTK_BUTTON(widget))) - button_name = gtk_button_get_label(GTK_BUTTON(widget)); - AccessibilityButtonInfo info(profile, button_name); - SendAccessibilityNotification(type, &info); -} - -void AccessibilityEventRouterGtk::SendEntryNotification( - GtkWidget* widget, NotificationType type, Profile* profile) { - std::string name = GetWidgetName(widget); - std::string value = gtk_entry_get_text(GTK_ENTRY(widget)); - gint start_pos; - gint end_pos; - gtk_editable_get_selection_bounds(GTK_EDITABLE(widget), &start_pos, &end_pos); - AccessibilityTextBoxInfo info(profile, name, IsPassword(widget)); - info.SetValue(value, start_pos, end_pos); - SendAccessibilityNotification(type, &info); -} - -void AccessibilityEventRouterGtk::SendTextViewNotification( - GtkWidget* widget, NotificationType type, Profile* profile) { - std::string name = GetWidgetName(widget); - GtkTextBuffer* buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget)); - GtkTextIter start, end; - gtk_text_buffer_get_bounds(buffer, &start, &end); - gchar* text = gtk_text_buffer_get_text(buffer, &start, &end, false); - std::string value = text; - g_free(text); - GtkTextIter sel_start, sel_end; - gtk_text_buffer_get_selection_bounds(buffer, &sel_start, &sel_end); - int start_pos = gtk_text_iter_get_offset(&sel_start); - int end_pos = gtk_text_iter_get_offset(&sel_end); - AccessibilityTextBoxInfo info(profile, name, IsPassword(widget)); - info.SetValue(value, start_pos, end_pos); - SendAccessibilityNotification(type, &info); -} - -void AccessibilityEventRouterGtk::SendTabNotification( - GtkWidget* widget, NotificationType type, Profile* profile) { - int index = gtk_notebook_get_current_page(GTK_NOTEBOOK(widget)); - int page_count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(widget)); - GtkWidget* page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(widget), index); - GtkWidget* label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(widget), page); - std::string name = GetWidgetName(widget); - if (name.empty() && gtk_label_get_text(GTK_LABEL(label))) { - name = gtk_label_get_text(GTK_LABEL(label)); - } - AccessibilityTabInfo info(profile, name, index, page_count); - SendAccessibilityNotification(type, &info); -} - -void AccessibilityEventRouterGtk::SendComboBoxNotification( - GtkWidget* widget, NotificationType type, Profile* profile) { - // Get the index of the selected item. Will return -1 if no item is - // active, which matches the semantics of the extension API. - int index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); - - // Get the number of items. - GtkTreeModel* model = gtk_combo_box_get_model(GTK_COMBO_BOX(widget)); - int count = gtk_tree_model_iter_n_children(model, NULL); - - // Get the value of the current item, if possible. Note that the - // model behind the combo box could be arbitrarily complex in theory, - // but this code just handles flat lists where the first string column - // contains the display value. - std::string value; - int string_column_index = -1; - for (int i = 0; i < gtk_tree_model_get_n_columns(model); i++) { - if (gtk_tree_model_get_column_type(model, i) == G_TYPE_STRING) { - string_column_index = i; - break; - } - } - if (string_column_index) { - GtkTreeIter iter; - if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(widget), &iter)) { - GValue gvalue = { 0 }; - gtk_tree_model_get_value(model, &iter, string_column_index, &gvalue); - const char* string_value = g_value_get_string(&gvalue); - if (string_value) { - value = string_value; - } - g_value_unset(&gvalue); - } - } else { - // Otherwise this must be a gtk_combo_box_text, in which case this - // function will return the value of the current item, instead. - value = gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)); - } - - // Get the name of this combo box. - std::string name = GetWidgetName(widget); - - // Send the notification. - AccessibilityComboBoxInfo info(profile, name, value, index, count); - SendAccessibilityNotification(type, &info); -} - -void AccessibilityEventRouterGtk::SendListBoxNotification( - GtkWidget* widget, NotificationType type, Profile* profile) { - // Get the number of items. - GtkTreeModel* model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget)); - int count = gtk_tree_model_iter_n_children(model, NULL); - - // Get the current selected index and its value. - int index = -1; - std::string value; - GtkTreePath* path; - gtk_tree_view_get_cursor(GTK_TREE_VIEW(widget), &path, NULL); - if (path != NULL) { - gint* indices = gtk_tree_path_get_indices(path); - if (indices) - index = indices[0]; - - GtkTreeIter iter; - if (gtk_tree_model_get_iter(model, &iter, path)) { - for (int i = 0; i < gtk_tree_model_get_n_columns(model); i++) { - if (gtk_tree_model_get_column_type(model, i) == G_TYPE_STRING) { - GValue gvalue = { 0 }; - gtk_tree_model_get_value(model, &iter, i, &gvalue); - const char* string_value = g_value_get_string(&gvalue); - if (string_value) { - if (!value.empty()) - value += " "; - value += string_value; - } - g_value_unset(&gvalue); - } - } - } - - gtk_tree_path_free(path); - } - - // Get the name of this control. - std::string name = GetWidgetName(widget); - - // Send the notification. - AccessibilityListBoxInfo info(profile, name, value, index, count); - SendAccessibilityNotification(type, &info); -} - -void AccessibilityEventRouterGtk::SendMenuItemNotification( - GtkWidget* menu, NotificationType type, Profile* profile) { - // Find the focused menu item, recursing into submenus as needed. - GtkWidget* menu_item = GTK_MENU_SHELL(menu)->active_menu_item; - if (!menu_item) - return; - GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(menu_item)); - while (submenu && GTK_MENU_SHELL(submenu)->active_menu_item) { - menu = submenu; - menu_item = GTK_MENU_SHELL(menu)->active_menu_item; - if (!menu_item) - return; - submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(menu_item)); - } - - // Figure out the item index and total number of items. - GList* items = gtk_container_get_children(GTK_CONTAINER(menu)); - guint count = g_list_length(items); - int index = g_list_index(items, static_cast<gconstpointer>(menu_item)); - - // Get the menu item's label. - std::string name; -#if GTK_CHECK_VERSION(2, 16, 0) - name = gtk_menu_item_get_label(GTK_MENU_ITEM(menu_item)); -#else - GList* children = gtk_container_get_children(GTK_CONTAINER(menu_item)); - for (GList* l = g_list_first(children); l != NULL; l = g_list_next(l)) { - GtkWidget* child = static_cast<GtkWidget*>(l->data); - if (GTK_IS_LABEL(child)) { - name = gtk_label_get_label(GTK_LABEL(child)); - break; - } - } -#endif - - // Send the event. - AccessibilityMenuItemInfo info(profile, name, submenu != NULL, index, count); - SendAccessibilityNotification(type, &info); -} diff --git a/chrome/browser/ui/gtk/accessibility_event_router_gtk.h b/chrome/browser/ui/gtk/accessibility_event_router_gtk.h deleted file mode 100644 index d8ca832..0000000 --- a/chrome/browser/ui/gtk/accessibility_event_router_gtk.h +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) 2011 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_UI_GTK_ACCESSIBILITY_EVENT_ROUTER_GTK_H_ -#define CHROME_BROWSER_UI_GTK_ACCESSIBILITY_EVENT_ROUTER_GTK_H_ -#pragma once - -#include <gtk/gtk.h> - -#include <string> -#include <vector> - -#include "base/basictypes.h" -#include "base/gtest_prod_util.h" -#include "base/hash_tables.h" -#include "base/singleton.h" -#include "base/task.h" -#include "chrome/browser/accessibility_events.h" - -class Profile; -#if defined (TOOLKIT_VIEWS) -namespace views { -class NativeTextfieldGtk; -} -#endif - -// Allows us to use (GtkWidget*) in a hash_map with gcc. -namespace __gnu_cxx { -template<> -struct hash<GtkWidget*> { - size_t operator()(GtkWidget* widget) const { - return reinterpret_cast<size_t>(widget); - } -}; -} // namespace __gnu_cxx - -// Struct to keep track of event listener hook ids to remove them later. -struct InstalledHook { - InstalledHook(guint _signal_id, gulong _hook_id) - : signal_id(_signal_id), hook_id(_hook_id) { } - guint signal_id; - gulong hook_id; -}; - -// NOTE: This class is part of the Accessibility Extension API, which lets -// extensions receive accessibility events. It's distinct from code that -// implements platform accessibility APIs like MSAA or ATK. -// -// Singleton class that adds a signal emission hook to many gtk events, and -// then sends an accessibility notification whenever a relevant event is -// sent to an accessible control. -// -// Gtk widgets are not accessible by default. When you register a root widget, -// that widget and all of its descendants will start sending accessibility -// event notifications. You can then override the default behavior for -// specific descendants using other methods. -// -// You can use Profile::PauseAccessibilityEvents to prevent a flurry -// of accessibility events when a window is being created or initialized. -class AccessibilityEventRouterGtk { - public: - // Internal information about a particular widget to override the - // information we get directly from gtk. - struct WidgetInfo { - WidgetInfo() : refcount(0) { } - - // The number of times that AddWidgetNameOverride has been called on this - // widget. When RemoveWidget has been called an equal number of - // times and the refcount reaches zero, this entry will be deleted. - int refcount; - - // If nonempty, will use this name instead of the widget's label. - std::string name; - }; - - // Internal information about a root widget - struct RootWidgetInfo { - RootWidgetInfo() : refcount(0), profile(NULL) { } - - // The number of times that AddRootWidget has been called on this - // widget. When RemoveRootWidget has been called an equal number of - // times and the refcount reaches zero, this entry will be deleted. - int refcount; - - // The profile associated with this root widget; accessibility - // notifications for any descendant of this root widget will get routed - // to this profile. - Profile* profile; - }; - - // Get the single instance of this class. - static AccessibilityEventRouterGtk* GetInstance(); - - // Start sending accessibility events for this widget and all of its - // descendants. Notifications will go to the specified profile. - // Uses reference counting, so it's safe to call this twice on the - // same widget, as long as each call is paired with a call to - // RemoveRootWidget. - void AddRootWidget(GtkWidget* root_widget, Profile* profile); - - // Stop sending accessibility events for this widget and all of its - // descendants. - void RemoveRootWidget(GtkWidget* root_widget); - - // Use the following string as the name of this widget, instead of the - // gtk label associated with the widget. Must be paired with a call to - // RemoveWidgetNameOverride. - void AddWidgetNameOverride(GtkWidget* widget, std::string name); - - // Forget widget name override. Must be paired with a call to - // AddWidgetNameOverride (uses reference counting). - void RemoveWidgetNameOverride(GtkWidget* widget); - - // - // The following methods are only for use by gtk signal handlers. - // - - // Called by the signal handler. Checks the type of the widget and - // calls one of the more specific Send*Notification methods, below. - void DispatchAccessibilityNotification( - GtkWidget* widget, NotificationType type); - - // Post a task to call DispatchAccessibilityNotification the next time - // through the event loop. - void PostDispatchAccessibilityNotification( - GtkWidget* widget, NotificationType type); - - private: - AccessibilityEventRouterGtk(); - virtual ~AccessibilityEventRouterGtk(); - - // Given a widget, determine if it's the descendant of a root widget - // that's mapped to a profile and if so, if it's marked as accessible. - void FindWidget(GtkWidget* widget, Profile** profile, bool* is_accessible); - - // Return the name of a widget. - std::string GetWidgetName(GtkWidget* widget); - - // Each of these methods constructs an AccessibilityControlInfo object - // and sends a notification of a specific accessibility event. - void SendButtonNotification( - GtkWidget* widget, NotificationType type, Profile* profile); - void SendCheckboxNotification( - GtkWidget* widget, NotificationType type, Profile* profile); - void SendComboBoxNotification( - GtkWidget* widget, NotificationType type, Profile* profile); - void SendListBoxNotification( - GtkWidget* widget, NotificationType type, Profile* profile); - void SendMenuItemNotification( - GtkWidget* widget, NotificationType type, Profile* profile); - void SendRadioButtonNotification( - GtkWidget* widget, NotificationType type, Profile* profile); - void SendTabNotification( - GtkWidget* widget, NotificationType type, Profile* profile); - void SendEntryNotification( - GtkWidget* widget, NotificationType type, Profile* profile); - void SendTextViewNotification( - GtkWidget* widget, NotificationType type, Profile* profile); - - bool IsPassword(GtkWidget* widget); - void InstallEventListeners(); - void RemoveEventListeners(); - - // Start and stop listening to signals. - void StartListening(); - void StopListening(); - - // Add a signal emission hook for one particular signal name and - // widget type, and save the hook_id in installed_hooks so we can - // remove it later. - void InstallEventListener( - const char *signal_name, - GType widget_type, - GSignalEmissionHook hook_func); - - friend struct DefaultSingletonTraits<AccessibilityEventRouterGtk>; - - // The set of all root widgets; only descendants of these will generate - // accessibility notifications. - base::hash_map<GtkWidget*, RootWidgetInfo> root_widget_info_map_; - - // Extra information about specific widgets. - base::hash_map<GtkWidget*, WidgetInfo> widget_info_map_; - - // Installed event listener hook ids so we can remove them later. - std::vector<InstalledHook> installed_hooks_; - - // True if we are currently listening to signals. - bool listening_; - - // The profile associated with the most recent window event - used to - // figure out where to route a few events that can't be directly traced - // to a window with a profile (like menu events). - Profile* most_recent_profile_; - - // The most recent focused widget. - GtkWidget* most_recent_widget_; - - // Used to schedule invocations of StartListening() and to defer handling - // of some events until the next time through the event loop. - ScopedRunnableMethodFactory<AccessibilityEventRouterGtk> method_factory_; - - friend class AccessibilityEventRouterGtkTest; - FRIEND_TEST_ALL_PREFIXES(AccessibilityEventRouterGtkTest, AddRootWidgetTwice); -}; - -#endif // CHROME_BROWSER_UI_GTK_ACCESSIBILITY_EVENT_ROUTER_GTK_H_ diff --git a/chrome/browser/ui/gtk/accessibility_event_router_gtk_unittest.cc b/chrome/browser/ui/gtk/accessibility_event_router_gtk_unittest.cc deleted file mode 100644 index 3b99980..0000000 --- a/chrome/browser/ui/gtk/accessibility_event_router_gtk_unittest.cc +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2011 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/ui/gtk/accessibility_event_router_gtk.h" -#include "chrome/test/testing_profile.h" -#include "testing/gtest/include/gtest/gtest.h" - -class AccessibilityEventRouterGtkTest : public testing::Test { - protected: - AccessibilityEventRouterGtkTest() { } -}; - -TEST_F(AccessibilityEventRouterGtkTest, AddRootWidgetTwice) { - AccessibilityEventRouterGtk* event_router = - AccessibilityEventRouterGtk::GetInstance(); - TestingProfile profile; - - GtkWidget* widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); - - bool found = false; - event_router->FindWidget(widget, NULL, &found); - EXPECT_FALSE(found); - - event_router->AddRootWidget(widget, &profile); - event_router->FindWidget(widget, NULL, &found); - EXPECT_TRUE(found); - - event_router->AddRootWidget(widget, &profile); - event_router->FindWidget(widget, NULL, &found); - EXPECT_TRUE(found); - - event_router->RemoveRootWidget(widget); - event_router->FindWidget(widget, NULL, &found); - EXPECT_TRUE(found); - - event_router->RemoveRootWidget(widget); - event_router->FindWidget(widget, NULL, &found); - EXPECT_FALSE(found); - - gtk_widget_destroy(widget); -}; diff --git a/chrome/browser/ui/gtk/accessible_widget_helper_gtk.cc b/chrome/browser/ui/gtk/accessible_widget_helper_gtk.cc deleted file mode 100644 index eb449ef..0000000 --- a/chrome/browser/ui/gtk/accessible_widget_helper_gtk.cc +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2011 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/ui/gtk/accessible_widget_helper_gtk.h" - -#include "chrome/browser/accessibility_events.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/common/notification_service.h" -#include "ui/base/l10n/l10n_util.h" - -AccessibleWidgetHelper::AccessibleWidgetHelper( - GtkWidget* root_widget, Profile* profile) - : accessibility_event_router_(AccessibilityEventRouterGtk::GetInstance()), - profile_(profile), - root_widget_(root_widget) { - CHECK(profile_); - accessibility_event_router_->AddRootWidget(root_widget_, profile_); -} - -AccessibleWidgetHelper::~AccessibleWidgetHelper() { - if (!window_title_.empty()) { - AccessibilityWindowInfo info(profile_, window_title_); - NotificationService::current()->Notify( - NotificationType::ACCESSIBILITY_WINDOW_CLOSED, - Source<Profile>(profile_), - Details<AccessibilityWindowInfo>(&info)); - } - - if (root_widget_) - accessibility_event_router_->RemoveRootWidget(root_widget_); - for (std::set<GtkWidget*>::iterator it = managed_widgets_.begin(); - it != managed_widgets_.end(); - ++it) { - accessibility_event_router_->RemoveWidgetNameOverride(*it); - } -} - -void AccessibleWidgetHelper::SendOpenWindowNotification( - const std::string& window_title) { - window_title_ = window_title; - AccessibilityWindowInfo info(profile_, window_title); - NotificationService::current()->Notify( - NotificationType::ACCESSIBILITY_WINDOW_OPENED, - Source<Profile>(profile_), - Details<AccessibilityWindowInfo>(&info)); -} - -void AccessibleWidgetHelper::SetWidgetName( - GtkWidget* widget, std::string name) { - if (managed_widgets_.find(widget) != managed_widgets_.end()) { - // AccessibilityEventRouterGtk reference-counts its widgets, but we - // don't. In order to avoid a memory leak, tell the event router - // to deref first, so the resulting refcount is unchanged after we - // call SetWidgetName. - accessibility_event_router_->RemoveWidgetNameOverride(widget); - } - - accessibility_event_router_->AddWidgetNameOverride(widget, name); - managed_widgets_.insert(widget); -} - -void AccessibleWidgetHelper::SetWidgetName( - GtkWidget* widget, int string_id) { - SetWidgetName(widget, l10n_util::GetStringUTF8(string_id)); -} diff --git a/chrome/browser/ui/gtk/accessible_widget_helper_gtk.h b/chrome/browser/ui/gtk/accessible_widget_helper_gtk.h deleted file mode 100644 index 6cff59c..0000000 --- a/chrome/browser/ui/gtk/accessible_widget_helper_gtk.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2011 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_UI_GTK_ACCESSIBLE_WIDGET_HELPER_GTK_H_ -#define CHROME_BROWSER_UI_GTK_ACCESSIBLE_WIDGET_HELPER_GTK_H_ -#pragma once - -#include <gtk/gtk.h> - -#include <set> -#include <string> - -#include "base/basictypes.h" -#include "base/singleton.h" -#include "chrome/browser/accessibility_events.h" -#include "chrome/browser/ui/gtk/accessibility_event_router_gtk.h" - -class Profile; - -// NOTE: This class is part of the Accessibility Extension API, which lets -// extensions receive accessibility events. It's distinct from code that -// implements platform accessibility APIs like MSAA or ATK. -// -// Helper class that helps to manage the accessibility information for all -// of the widgets in a container. Create an instance of this class for -// each container GtkWidget (like a dialog) that should send accessibility -// events for all of its descendants. -// -// Most controls have default behavior for accessibility; when this needs -// to be augmented, call one of the methods below to change its details. -// -// All of the information managed by this class is registered with the -// (global) AccessibilityEventRouterGtk and unregistered when this object is -// destroyed. -class AccessibleWidgetHelper { - public: - // Contruct an AccessibleWidgetHelper that makes the given root widget - // accessible for the lifetime of this object, sending accessibility - // notifications to the given profile. - AccessibleWidgetHelper(GtkWidget* root_widget, Profile* profile); - - virtual ~AccessibleWidgetHelper(); - - // Send a notification that a new window was opened now, and a - // corresponding close window notification when this object - // goes out of scope. - void SendOpenWindowNotification(const std::string& window_title); - - // Use the following string as the name of this widget, instead of the - // gtk label associated with the widget. - void SetWidgetName(GtkWidget* widget, std::string name); - - // Use the following string as the name of this widget, instead of the - // gtk label associated with the widget. - void SetWidgetName(GtkWidget* widget, int string_id); - - private: - AccessibilityEventRouterGtk* accessibility_event_router_; - Profile* profile_; - GtkWidget* root_widget_; - std::string window_title_; - std::set<GtkWidget*> managed_widgets_; -}; - -#endif // CHROME_BROWSER_UI_GTK_ACCESSIBLE_WIDGET_HELPER_GTK_H_ diff --git a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.cc b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.cc index 5cf1cbc..16f546c 100644 --- a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.cc @@ -10,7 +10,6 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/browser_window_gtk.h" #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" #include "chrome/browser/ui/gtk/gtk_util.h" @@ -49,9 +48,6 @@ ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT); gtk_widget_grab_focus(cancel_button); - accessible_widget_helper_.reset(new AccessibleWidgetHelper(dialog_, profile)); - accessible_widget_helper_->SendOpenWindowNotification(dialog_name); - gtk_util::AddButtonToDialog(dialog_, l10n_util::GetStringUTF8(IDS_CLEAR_BROWSING_DATA_COMMIT).c_str(), GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT); diff --git a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h index 567cb4b..4147d45 100644 --- a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h +++ b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h @@ -13,7 +13,6 @@ typedef struct _GtkWidget GtkWidget; typedef struct _GtkWindow GtkWindow; -class AccessibleWidgetHelper; class BrowsingDataRemover; class Profile; @@ -60,9 +59,6 @@ class ClearBrowsingDataDialogGtk { // of deleting itself when done. BrowsingDataRemover* remover_; - // Helper object to manage accessibility metadata. - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataDialogGtk); }; diff --git a/chrome/browser/ui/gtk/edit_search_engine_dialog.cc b/chrome/browser/ui/gtk/edit_search_engine_dialog.cc index 96f321b..cefcab3 100644 --- a/chrome/browser/ui/gtk/edit_search_engine_dialog.cc +++ b/chrome/browser/ui/gtk/edit_search_engine_dialog.cc @@ -13,7 +13,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" #include "googleurl/src/gurl.h" @@ -93,10 +92,6 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window, Profile* profile) { GTK_RESPONSE_CANCEL, NULL); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - dialog_, profile)); - accessible_widget_helper_->SendOpenWindowNotification(dialog_name); - ok_button_ = gtk_dialog_add_button(GTK_DIALOG(dialog_), controller_->template_url() ? GTK_STOCK_SAVE : @@ -129,9 +124,6 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window, Profile* profile) { gtk_entry_set_activates_default(GTK_ENTRY(title_entry_), TRUE); g_signal_connect(title_entry_, "changed", G_CALLBACK(OnEntryChangedThunk), this); - accessible_widget_helper_->SetWidgetName( - title_entry_, - IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_LABEL); keyword_entry_ = gtk_entry_new(); gtk_entry_set_activates_default(GTK_ENTRY(keyword_entry_), TRUE); @@ -139,17 +131,11 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window, Profile* profile) { G_CALLBACK(OnEntryChangedThunk), this); g_signal_connect(keyword_entry_, "insert-text", G_CALLBACK(LowercaseInsertTextHandler), NULL); - accessible_widget_helper_->SetWidgetName( - keyword_entry_, - IDS_SEARCH_ENGINES_EDITOR_KEYWORD_LABEL); url_entry_ = gtk_entry_new(); gtk_entry_set_activates_default(GTK_ENTRY(url_entry_), TRUE); g_signal_connect(url_entry_, "changed", G_CALLBACK(OnEntryChangedThunk), this); - accessible_widget_helper_->SetWidgetName( - url_entry_, - IDS_SEARCH_ENGINES_EDITOR_URL_LABEL); title_image_ = gtk_image_new_from_pixbuf(NULL); keyword_image_ = gtk_image_new_from_pixbuf(NULL); diff --git a/chrome/browser/ui/gtk/edit_search_engine_dialog.h b/chrome/browser/ui/gtk/edit_search_engine_dialog.h index a5520e1..c1ab779 100644 --- a/chrome/browser/ui/gtk/edit_search_engine_dialog.h +++ b/chrome/browser/ui/gtk/edit_search_engine_dialog.h @@ -14,7 +14,6 @@ #include "base/string16.h" #include "ui/base/gtk/gtk_signal.h" -class AccessibleWidgetHelper; class EditSearchEngineController; class EditSearchEngineControllerDelegate; class Profile; @@ -74,9 +73,6 @@ class EditSearchEngineDialog { scoped_ptr<EditSearchEngineController> controller_; - // Helper object to manage accessibility metadata. - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(EditSearchEngineDialog); }; diff --git a/chrome/browser/ui/gtk/importer/import_dialog_gtk.cc b/chrome/browser/ui/gtk/importer/import_dialog_gtk.cc index 01f5391..29fdf0f 100644 --- a/chrome/browser/ui/gtk/importer/import_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_dialog_gtk.cc @@ -8,7 +8,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/importer/importer_data_types.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -61,10 +60,6 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile, GTK_RESPONSE_REJECT, NULL); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - dialog_, profile)); - accessible_widget_helper_->SendOpenWindowNotification(dialog_name); - importer_host_->set_parent_window(GTK_WINDOW(dialog_)); // Add import button separately as we might need to disable it, if diff --git a/chrome/browser/ui/gtk/importer/import_dialog_gtk.h b/chrome/browser/ui/gtk/importer/import_dialog_gtk.h index 0427613..9619cae 100644 --- a/chrome/browser/ui/gtk/importer/import_dialog_gtk.h +++ b/chrome/browser/ui/gtk/importer/import_dialog_gtk.h @@ -9,7 +9,6 @@ #include "chrome/browser/importer/importer.h" #include "ui/base/gtk/gtk_signal.h" -class AccessibleWidgetHelper; class Profile; class ImportDialogGtk : public ImportObserver, @@ -83,9 +82,6 @@ class ImportDialogGtk : public ImportObserver, int initial_state_; - // Helper object to manage accessibility metadata. - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(ImportDialogGtk); }; diff --git a/chrome/browser/ui/gtk/keyword_editor_view.cc b/chrome/browser/ui/gtk/keyword_editor_view.cc index 85f365c..c0a5acd 100644 --- a/chrome/browser/ui/gtk/keyword_editor_view.cc +++ b/chrome/browser/ui/gtk/keyword_editor_view.cc @@ -12,7 +12,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/edit_search_engine_dialog.h" #include "chrome/browser/ui/gtk/gtk_tree.h" #include "chrome/browser/ui/gtk/gtk_util.h" @@ -94,10 +93,6 @@ void KeywordEditorView::Init() { GTK_RESPONSE_CLOSE, NULL); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - dialog_, profile_)); - accessible_widget_helper_->SendOpenWindowNotification(dialog_name); - gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), gtk_util::kContentAreaSpacing); diff --git a/chrome/browser/ui/gtk/keyword_editor_view.h b/chrome/browser/ui/gtk/keyword_editor_view.h index 27f9d0f..7a6a7bd 100644 --- a/chrome/browser/ui/gtk/keyword_editor_view.h +++ b/chrome/browser/ui/gtk/keyword_editor_view.h @@ -16,7 +16,6 @@ #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" #include "ui/base/models/table_model_observer.h" -class AccessibleWidgetHelper; class KeywordEditorController; class Profile; class TemplateURLTableModel; @@ -151,9 +150,6 @@ class KeywordEditorView : public ui::TableModelObserver, // |list_store_|. int model_second_group_index_; - // Helper object to manage accessibility metadata. - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - friend class KeywordEditorViewTest; FRIEND_TEST_ALL_PREFIXES(KeywordEditorViewTest, Empty); FRIEND_TEST_ALL_PREFIXES(KeywordEditorViewTest, Add); diff --git a/chrome/browser/ui/gtk/options/advanced_contents_gtk.cc b/chrome/browser/ui/gtk/options/advanced_contents_gtk.cc index bb9cb19..7f3b38e 100644 --- a/chrome/browser/ui/gtk/options/advanced_contents_gtk.cc +++ b/chrome/browser/ui/gtk/options/advanced_contents_gtk.cc @@ -29,7 +29,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h" #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" #include "chrome/browser/ui/gtk/gtk_util.h" @@ -186,8 +185,6 @@ class DownloadSection : public OptionsPageBase { // then turning around and saving them again. bool pref_changing_; - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(DownloadSection); }; @@ -196,9 +193,6 @@ DownloadSection::DownloadSection(Profile* profile) pref_changing_(true) { page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - page_, profile)); - // Download location options. download_location_button_ = gtk_file_chooser_button_new( l10n_util::GetStringUTF8( @@ -237,9 +231,6 @@ DownloadSection::DownloadSection(Profile* profile) FALSE, FALSE, 0); g_signal_connect(download_ask_for_save_location_checkbox_, "clicked", G_CALLBACK(OnDownloadAskForSaveLocationChanged), this); - accessible_widget_helper_->SetWidgetName( - download_ask_for_save_location_checkbox_, - IDS_OPTIONS_DOWNLOADLOCATION_ASKFORSAVELOCATION); // Option for resetting file handlers. reset_file_handlers_label_ = CreateWrappedLabel( @@ -570,8 +561,6 @@ class TranslateSection : public OptionsPageBase { // then turning around and saving them again. bool pref_changing_; - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(TranslateSection); }; @@ -580,18 +569,12 @@ TranslateSection::TranslateSection(Profile* profile) pref_changing_(true) { page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - page_, profile)); - translate_checkbox_ = CreateCheckButtonWithWrappedLabel( IDS_OPTIONS_TRANSLATE_ENABLE_TRANSLATE); gtk_box_pack_start(GTK_BOX(page_), translate_checkbox_, FALSE, FALSE, 0); g_signal_connect(translate_checkbox_, "clicked", G_CALLBACK(OnTranslateClickedThunk), this); - accessible_widget_helper_->SetWidgetName( - translate_checkbox_, - IDS_OPTIONS_TRANSLATE_ENABLE_TRANSLATE); // Init member prefs so we can update the controls if prefs change. enable_translate_.Init(prefs::kEnableTranslate, profile->GetPrefs(), this); @@ -681,8 +664,6 @@ class PrivacySection : public OptionsPageBase { // then turning around and saving them again. bool pref_changing_; - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(PrivacySection); }; @@ -691,9 +672,6 @@ PrivacySection::PrivacySection(Profile* profile) pref_changing_(true) { page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - page_, profile)); - GtkWidget* content_button = gtk_button_new_with_label( l10n_util::GetStringUTF8( IDS_OPTIONS_PRIVACY_CONTENT_SETTINGS_BUTTON).c_str()); @@ -735,8 +713,6 @@ PrivacySection::PrivacySection(Profile* profile) FALSE, FALSE, 0); g_signal_connect(enable_link_doctor_checkbox_, "clicked", G_CALLBACK(OnEnableLinkDoctorChange), this); - accessible_widget_helper_->SetWidgetName( - enable_link_doctor_checkbox_, IDS_OPTIONS_LINKDOCTOR_PREF); enable_suggest_checkbox_ = CreateCheckButtonWithWrappedLabel( IDS_OPTIONS_SUGGEST_PREF); @@ -744,8 +720,6 @@ PrivacySection::PrivacySection(Profile* profile) FALSE, FALSE, 0); g_signal_connect(enable_suggest_checkbox_, "clicked", G_CALLBACK(OnEnableSuggestChange), this); - accessible_widget_helper_->SetWidgetName( - enable_suggest_checkbox_, IDS_OPTIONS_SUGGEST_PREF); enable_dns_prefetching_checkbox_ = CreateCheckButtonWithWrappedLabel( IDS_NETWORK_DNS_PREFETCH_ENABLED_DESCRIPTION); @@ -753,9 +727,6 @@ PrivacySection::PrivacySection(Profile* profile) FALSE, FALSE, 0); g_signal_connect(enable_dns_prefetching_checkbox_, "clicked", G_CALLBACK(OnDNSPrefetchingChange), this); - accessible_widget_helper_->SetWidgetName( - enable_dns_prefetching_checkbox_, - IDS_NETWORK_DNS_PREFETCH_ENABLED_DESCRIPTION); enable_safe_browsing_checkbox_ = CreateCheckButtonWithWrappedLabel( IDS_OPTIONS_SAFEBROWSING_ENABLEPROTECTION); @@ -763,9 +734,6 @@ PrivacySection::PrivacySection(Profile* profile) FALSE, FALSE, 0); g_signal_connect(enable_safe_browsing_checkbox_, "clicked", G_CALLBACK(OnSafeBrowsingChange), this); - accessible_widget_helper_->SetWidgetName( - enable_safe_browsing_checkbox_, - IDS_OPTIONS_SAFEBROWSING_ENABLEPROTECTION); #if defined(GOOGLE_CHROME_BUILD) reporting_enabled_checkbox_ = CreateCheckButtonWithWrappedLabel( @@ -774,8 +742,6 @@ PrivacySection::PrivacySection(Profile* profile) FALSE, FALSE, 0); g_signal_connect(reporting_enabled_checkbox_, "clicked", G_CALLBACK(OnLoggingChange), this); - accessible_widget_helper_->SetWidgetName( - reporting_enabled_checkbox_, IDS_OPTIONS_ENABLE_LOGGING); #endif // Init member prefs so we can update the controls if prefs change. @@ -1000,8 +966,6 @@ class SecuritySection : public OptionsPageBase { // then turning around and saving them again. bool pref_changing_; - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(SecuritySection); }; @@ -1010,9 +974,6 @@ SecuritySection::SecuritySection(Profile* profile) pref_changing_(true) { page_ = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - page_, profile)); - GtkWidget* manage_certificates_label = CreateWrappedLabel( IDS_OPTIONS_CERTIFICATES_LABEL); gtk_misc_set_alignment(GTK_MISC(manage_certificates_label), 0, 0); @@ -1039,16 +1000,10 @@ SecuritySection::SecuritySection(Profile* profile) rev_checking_enabled_checkbox_ = AddCheckButtonWithWrappedLabel( IDS_OPTIONS_SSL_CHECKREVOCATION, page_, G_CALLBACK(OnRevCheckingEnabledToggled), this); - accessible_widget_helper_->SetWidgetName( - rev_checking_enabled_checkbox_, IDS_OPTIONS_SSL_CHECKREVOCATION); ssl3_enabled_checkbox_ = AddCheckButtonWithWrappedLabel( IDS_OPTIONS_SSL_USESSL3, page_, G_CALLBACK(OnSSL3EnabledToggled), this); - accessible_widget_helper_->SetWidgetName( - ssl3_enabled_checkbox_, IDS_OPTIONS_SSL_USESSL3); tls1_enabled_checkbox_ = AddCheckButtonWithWrappedLabel( IDS_OPTIONS_SSL_USETLS1, page_, G_CALLBACK(OnTLS1EnabledToggled), this); - accessible_widget_helper_->SetWidgetName( - tls1_enabled_checkbox_, IDS_OPTIONS_SSL_USETLS1); rev_checking_enabled_.Init(prefs::kCertRevocationCheckingEnabled, profile->GetPrefs(), this); diff --git a/chrome/browser/ui/gtk/options/content_settings_window_gtk.cc b/chrome/browser/ui/gtk/options/content_settings_window_gtk.cc index 527419a..98a494c 100644 --- a/chrome/browser/ui/gtk/options/content_settings_window_gtk.cc +++ b/chrome/browser/ui/gtk/options/content_settings_window_gtk.cc @@ -11,7 +11,6 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_list.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/browser_window_gtk.h" #include "chrome/browser/ui/gtk/gtk_tree.h" #include "chrome/browser/ui/gtk/gtk_util.h" @@ -36,16 +35,8 @@ void ContentSettingsWindowGtk::Show(GtkWindow* parent, DCHECK(profile); if (!settings_window) { - // Creating and initializing a bunch of controls generates a bunch of - // spurious events as control values change. Temporarily suppress - // accessibility events until the window is created. - profile->PauseAccessibilityEvents(); - // Create the options window. settings_window = new ContentSettingsWindowGtk(parent, profile); - - // Resume accessibility events. - profile->ResumeAccessibilityEvents(); } settings_window->ShowContentSettingsTab(page); } @@ -88,10 +79,6 @@ ContentSettingsWindowGtk::ContentSettingsWindowGtk(GtkWindow* parent, NULL); gtk_window_set_policy(GTK_WINDOW(dialog_), FALSE, FALSE, TRUE); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - dialog_, profile_)); - accessible_widget_helper_->SendOpenWindowNotification(dialog_name); - gtk_window_set_default_size(GTK_WINDOW(dialog_), 500, -1); // Allow browser windows to go in front of the options dialog in metacity. gtk_window_set_type_hint(GTK_WINDOW(dialog_), GDK_WINDOW_TYPE_HINT_NORMAL); diff --git a/chrome/browser/ui/gtk/options/content_settings_window_gtk.h b/chrome/browser/ui/gtk/options/content_settings_window_gtk.h index 7a5b248..2729c1e 100644 --- a/chrome/browser/ui/gtk/options/content_settings_window_gtk.h +++ b/chrome/browser/ui/gtk/options/content_settings_window_gtk.h @@ -15,8 +15,6 @@ #include "chrome/common/content_settings_types.h" #include "ui/base/gtk/gtk_signal.h" -class AccessibleWidgetHelper; - // A window that presents options to the user for blocking various kinds of // content in webpages (cookies, javascript, images, popups). class ContentSettingsWindowGtk { @@ -64,9 +62,6 @@ class ContentSettingsWindowGtk { ContentFilterPageGtk geolocation_page_; ContentFilterPageGtk notifications_page_; - // Helper object to manage accessibility metadata. - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(ContentSettingsWindowGtk); }; diff --git a/chrome/browser/ui/gtk/options/general_page_gtk.cc b/chrome/browser/ui/gtk/options/general_page_gtk.cc index 0d95420..497319c 100644 --- a/chrome/browser/ui/gtk/options/general_page_gtk.cc +++ b/chrome/browser/ui/gtk/options/general_page_gtk.cc @@ -20,7 +20,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/keyword_editor_view.h" @@ -82,7 +81,6 @@ GeneralPageGtk::GeneralPageGtk(Profile* profile) scoped_ptr<OptionsLayoutBuilderGtk> options_builder(OptionsLayoutBuilderGtk::CreateOptionallyCompactLayout()); page_ = options_builder->get_page_widget(); - accessible_widget_helper_.reset(new AccessibleWidgetHelper(page_, profile)); options_builder->AddWidget(managed_prefs_banner_.banner_widget(), false); options_builder->AddOptionGroup( @@ -381,8 +379,6 @@ GtkWidget* GeneralPageGtk::InitDefaultSearchGroup() { G_CALLBACK(OnDefaultSearchEngineChangedThunk), this); gtk_container_add(GTK_CONTAINER(search_hbox), default_search_engine_combobox_); - accessible_widget_helper_->SetWidgetName( - default_search_engine_combobox_, IDS_OPTIONS_DEFAULTSEARCH_GROUP_NAME); GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(default_search_engine_combobox_), diff --git a/chrome/browser/ui/gtk/options/general_page_gtk.h b/chrome/browser/ui/gtk/options/general_page_gtk.h index 0584486..0ef4c14 100644 --- a/chrome/browser/ui/gtk/options/general_page_gtk.h +++ b/chrome/browser/ui/gtk/options/general_page_gtk.h @@ -20,7 +20,6 @@ #include "googleurl/src/gurl.h" #include "ui/base/gtk/gtk_signal.h" -class AccessibleWidgetHelper; class CustomHomePagesTableModel; class Profile; class TemplateURLModel; @@ -166,9 +165,6 @@ class GeneralPageGtk : public OptionsPageBase, // The helper object that performs default browser set/check tasks. scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; - // Helper object to manage accessibility metadata. - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - // Tracks managed preference warning banner state. ManagedPrefsBannerGtk managed_prefs_banner_; diff --git a/chrome/browser/ui/gtk/options/options_window_gtk.cc b/chrome/browser/ui/gtk/options/options_window_gtk.cc index 32fea06..63da3ab 100644 --- a/chrome/browser/ui/gtk/options/options_window_gtk.cc +++ b/chrome/browser/ui/gtk/options/options_window_gtk.cc @@ -6,14 +6,12 @@ #include "base/message_loop.h" #include "base/scoped_ptr.h" -#include "chrome/browser/accessibility_events.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/options/advanced_page_gtk.h" #include "chrome/browser/ui/gtk/options/content_page_gtk.h" @@ -65,8 +63,6 @@ class OptionsWindowGtk { // The last page the user was on when they opened the Options window. IntegerPrefMember last_selected_page_; - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(OptionsWindowGtk); }; @@ -103,10 +99,6 @@ OptionsWindowGtk::OptionsWindowGtk(Profile* profile) GTK_RESPONSE_CLOSE, NULL); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - dialog_, profile)); - accessible_widget_helper_->SendOpenWindowNotification(dialog_name); - gtk_window_set_default_size(GTK_WINDOW(dialog_), 500, -1); // Allow browser windows to go in front of the options dialog in metacity. gtk_window_set_type_hint(GTK_WINDOW(dialog_), GDK_WINDOW_TYPE_HINT_NORMAL); @@ -229,16 +221,8 @@ void ShowOptionsWindow(OptionsPage page, // If there's already an existing options window, activate it and switch to // the specified page. if (!options_window) { - // Creating and initializing a bunch of controls generates a bunch of - // spurious events as control values change. Temporarily suppress - // accessibility events until the window is created. - profile->PauseAccessibilityEvents(); - // Create the options window. options_window = new OptionsWindowGtk(profile); - - // Resume accessibility events. - profile->ResumeAccessibilityEvents(); } options_window->ShowOptionsPage(page, highlight_group); } diff --git a/chrome/browser/ui/gtk/options/passwords_exceptions_window_gtk.cc b/chrome/browser/ui/gtk/options/passwords_exceptions_window_gtk.cc index f06b48d..290430d 100644 --- a/chrome/browser/ui/gtk/options/passwords_exceptions_window_gtk.cc +++ b/chrome/browser/ui/gtk/options/passwords_exceptions_window_gtk.cc @@ -10,7 +10,6 @@ #include "base/message_loop.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.h" #include "chrome/browser/ui/gtk/options/passwords_page_gtk.h" @@ -51,9 +50,6 @@ class PasswordsExceptionsWindowGtk { // The exceptions page. PasswordsExceptionsPageGtk exceptions_page_; - // Helper object to manage accessibility metadata. - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(PasswordsExceptionsWindowGtk); }; @@ -81,10 +77,6 @@ PasswordsExceptionsWindowGtk::PasswordsExceptionsWindowGtk(Profile* profile) gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), gtk_util::kContentAreaSpacing); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - dialog_, profile)); - accessible_widget_helper_->SendOpenWindowNotification(dialog_name); - notebook_ = gtk_notebook_new(); gtk_notebook_append_page( diff --git a/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.cc b/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.cc index 76cb739..e360553 100644 --- a/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.cc @@ -10,7 +10,6 @@ #include "chrome/browser/possible_url_model.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/gtk/accessible_widget_helper_gtk.h" #include "chrome/browser/ui/gtk/gtk_tree.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/options/url_picker_dialog_gtk.h" @@ -49,10 +48,6 @@ UrlPickerDialogGtk::UrlPickerDialogGtk(UrlPickerCallback* callback, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); - accessible_widget_helper_.reset(new AccessibleWidgetHelper( - dialog_, profile)); - accessible_widget_helper_->SendOpenWindowNotification(dialog_name); - add_button_ = gtk_dialog_add_button(GTK_DIALOG(dialog_), GTK_STOCK_ADD, GTK_RESPONSE_OK); gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_OK); @@ -66,7 +61,6 @@ UrlPickerDialogGtk::UrlPickerDialogGtk(UrlPickerCallback* callback, gtk_box_pack_start(GTK_BOX(url_hbox), url_label, FALSE, FALSE, 0); url_entry_ = gtk_entry_new(); - accessible_widget_helper_->SetWidgetName(url_entry_, IDS_ASI_URL); gtk_entry_set_activates_default(GTK_ENTRY(url_entry_), TRUE); g_signal_connect(url_entry_, "changed", G_CALLBACK(OnUrlEntryChangedThunk), this); @@ -102,8 +96,6 @@ UrlPickerDialogGtk::UrlPickerDialogGtk(UrlPickerCallback* callback, gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(history_list_sort_), COL_DISPLAY_URL, CompareURL, this, NULL); history_tree_ = gtk_tree_view_new_with_model(history_list_sort_); - accessible_widget_helper_->SetWidgetName( - history_tree_, IDS_ASI_DESCRIPTION); g_object_unref(history_list_store_); g_object_unref(history_list_sort_); gtk_container_add(GTK_CONTAINER(scroll_window), history_tree_); diff --git a/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.h b/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.h index 2129f4c..f1b5640 100644 --- a/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.h +++ b/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.h @@ -14,7 +14,6 @@ #include "chrome/browser/ui/gtk/gtk_tree.h" #include "ui/base/gtk/gtk_signal.h" -class AccessibleWidgetHelper; class GURL; class Profile; class PossibleURLModel; @@ -84,9 +83,6 @@ class UrlPickerDialogGtk : public gtk_tree::TableAdapter::Delegate { // Called if the user selects an url. UrlPickerCallback* callback_; - // Helper object to manage accessibility metadata. - scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; - DISALLOW_COPY_AND_ASSIGN(UrlPickerDialogGtk); }; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index ff2c08d..b2c179a 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2592,10 +2592,6 @@ 'browser/ui/gtk/about_chrome_dialog.h', 'browser/ui/gtk/accelerators_gtk.cc', 'browser/ui/gtk/accelerators_gtk.h', - 'browser/ui/gtk/accessibility_event_router_gtk.cc', - 'browser/ui/gtk/accessibility_event_router_gtk.h', - 'browser/ui/gtk/accessible_widget_helper_gtk.cc', - 'browser/ui/gtk/accessible_widget_helper_gtk.h', 'browser/ui/gtk/back_forward_button_gtk.cc', 'browser/ui/gtk/back_forward_button_gtk.h', 'browser/ui/gtk/bookmark_bar_gtk.cc', @@ -3875,10 +3871,6 @@ # Exclude all of browser/ui/gtk, then include the things we want. ['exclude', '^browser/ui/gtk'], - ['include', '^browser/ui/gtk/accessibility_event_router_gtk.cc'], - ['include', '^browser/ui/gtk/accessibility_event_router_gtk.h'], - ['include', '^browser/ui/gtk/accessible_widget_helper_gtk.cc'], - ['include', '^browser/ui/gtk/accessible_widget_helper_gtk.h'], ['include', '^browser/ui/gtk/bookmark_editor_gtk.cc'], ['include', '^browser/ui/gtk/bookmark_editor_gtk.h'], ['include', '^browser/ui/gtk/bookmark_tree_model.cc'], diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index e253114..ebc3820 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1319,7 +1319,6 @@ 'browser/global_keyboard_shortcuts_mac_unittest.mm', 'browser/google/google_update_settings_unittest.cc', 'browser/google/google_url_tracker_unittest.cc', - 'browser/ui/gtk/accessibility_event_router_gtk_unittest.cc', 'browser/ui/gtk/bookmark_bar_gtk_unittest.cc', 'browser/ui/gtk/bookmark_editor_gtk_unittest.cc', 'browser/ui/gtk/bookmark_utils_gtk_unittest.cc', |