summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 01:18:56 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 01:18:56 +0000
commit5cbe1e21980f42927d7d1c11cc860131be266e7e (patch)
tree3b52e15044336cb89e3004214b4714e6148e5ea9 /chrome/browser/profile.h
parent7a12518454d36fb4ac79431f56106b38cd2482ab (diff)
downloadchromium_src-5cbe1e21980f42927d7d1c11cc860131be266e7e.zip
chromium_src-5cbe1e21980f42927d7d1c11cc860131be266e7e.tar.gz
chromium_src-5cbe1e21980f42927d7d1c11cc860131be266e7e.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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.h')
-rw-r--r--chrome/browser/profile.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h
index 1068370..946e8b6 100644
--- a/chrome/browser/profile.h
+++ b/chrome/browser/profile.h
@@ -103,7 +103,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
@@ -385,11 +385,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;