diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-27 22:41:03 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-27 22:41:03 +0000 |
commit | 922982c6528a80ee4079a6c221f513bc8a5ddbb9 (patch) | |
tree | bd6299d14a4291ec52c4e1a1c59f57d4c7bcc418 /chrome/browser/profile.h | |
parent | 2de9333c9d608fcdfd0694d95652576718d4a4d0 (diff) | |
download | chromium_src-922982c6528a80ee4079a6c221f513bc8a5ddbb9.zip chromium_src-922982c6528a80ee4079a6c221f513bc8a5ddbb9.tar.gz chromium_src-922982c6528a80ee4079a6c221f513bc8a5ddbb9.tar.bz2 |
Add an accessibility API for events raised outside of the web content.
BUG=none
TEST=none
patch by Dominic Mazzoni <dmazzoni [at] google>
review url: http://codereview.chromium.org/402099/show
Review URL: http://codereview.chromium.org/549182
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.h')
-rw-r--r-- | chrome/browser/profile.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index 0cc0e16..39b1c3d 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -102,7 +102,7 @@ class Profile { // 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 @@ -381,11 +381,33 @@ class Profile { 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; |