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

Unified Diff: chrome/browser/gtk/options/options_window_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/options/general_page_gtk.cc ('k') | chrome/browser/profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/options/options_window_gtk.cc
===================================================================
--- chrome/browser/gtk/options/options_window_gtk.cc (revision 37511)
+++ chrome/browser/gtk/options/options_window_gtk.cc (working copy)
@@ -8,15 +8,19 @@
#include "app/l10n_util.h"
#include "base/message_loop.h"
+#include "base/scoped_ptr.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_window.h"
+#include "chrome/browser/gtk/accessible_widget_helper_gtk.h"
#include "chrome/browser/gtk/options/advanced_page_gtk.h"
#include "chrome/browser/gtk/options/content_page_gtk.h"
#include "chrome/browser/gtk/options/general_page_gtk.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/window_sizer.h"
+#include "chrome/common/accessibility_events.h"
#include "chrome/common/gtk_util.h"
+#include "chrome/common/notification_service.h"
#include "chrome/common/pref_member.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
@@ -68,6 +72,8 @@
// The last page the user was on when they opened the Options window.
IntegerPrefMember last_selected_page_;
+ scoped_ptr<AccessibleWidgetHelper> accessibility_widget_helper_;
+
DISALLOW_COPY_AND_ASSIGN(OptionsWindowGtk);
};
@@ -85,6 +91,7 @@
general_page_(profile_),
content_page_(profile_),
advanced_page_(profile_) {
+
// We don't need to observe changes in this value.
last_selected_page_.Init(prefs::kOptionsWindowLastTabIndex,
g_browser_process->local_state(), NULL);
@@ -105,6 +112,9 @@
gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox),
gtk_util::kContentAreaSpacing);
+ accessibility_widget_helper_.reset(new AccessibleWidgetHelper(
+ dialog_, profile));
+
notebook_ = gtk_notebook_new();
#if defined(OS_CHROMEOS)
@@ -248,10 +258,30 @@
OptionsGroup highlight_group,
Profile* profile) {
DCHECK(profile);
+
// 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);
+
+ std::string name = l10n_util::GetStringFUTF8(
+ IDS_OPTIONS_DIALOG_TITLE,
+ WideToUTF16(l10n_util::GetString(IDS_PRODUCT_NAME)));
+ AccessibilityWindowInfo info(profile, name);
+
+ NotificationService::current()->Notify(
+ NotificationType::ACCESSIBILITY_WINDOW_OPENED,
+ Source<Profile>(profile),
+ Details<AccessibilityWindowInfo>(&info));
}
« no previous file with comments | « chrome/browser/gtk/options/general_page_gtk.cc ('k') | chrome/browser/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698