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

Unified Diff: chrome/browser/profile.h

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/options_window_gtk.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile.h
===================================================================
--- chrome/browser/profile.h (revision 37511)
+++ chrome/browser/profile.h (working copy)
@@ -103,7 +103,7 @@
// Value that represents no profile Id.
static const ProfileId InvalidProfileId;
- Profile() : restored_last_session_(false) {}
+ Profile() : restored_last_session_(false), accessibility_pause_level_(0) {}
virtual ~Profile() {}
// Profile prefs are registered as soon as the prefs are loaded for the first
@@ -385,11 +385,33 @@
return restored_last_session_;
}
+ // Stop sending accessibility events until ResumeAccessibilityEvents().
+ // Calls to Pause nest; no events will be sent until the number of
+ // Resume calls matches the number of Pause calls received.
+ void PauseAccessibilityEvents() {
+ accessibility_pause_level_++;
+ }
+
+ void ResumeAccessibilityEvents() {
+ DCHECK(accessibility_pause_level_ > 0);
+ accessibility_pause_level_--;
+ }
+
+ bool ShouldSendAccessibilityEvents() {
+ return 0 == accessibility_pause_level_;
+ }
+
protected:
static URLRequestContextGetter* default_request_context_;
private:
bool restored_last_session_;
+
+ // Accessibility events will only be propagated when the pause
+ // level is zero. PauseAccessibilityEvents and ResumeAccessibilityEvents
+ // increment and decrement the level, respectively, rather than set it to
+ // true or false, so that calls can be nested.
+ int accessibility_pause_level_;
};
class OffTheRecordProfileImpl;
« no previous file with comments | « chrome/browser/gtk/options/options_window_gtk.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698