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

Unified Diff: chrome/browser/chromeos/login/wizard_accessibility_helper.cc

Issue 6312160: Map Views to Profiles directly from their window, eliminating the need... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
Index: chrome/browser/chromeos/login/wizard_accessibility_helper.cc
===================================================================
--- chrome/browser/chromeos/login/wizard_accessibility_helper.cc (revision 74020)
+++ chrome/browser/chromeos/login/wizard_accessibility_helper.cc (working copy)
@@ -74,15 +74,6 @@
prefs::kAccessibilityEnabled);
}
-void WizardAccessibilityHelper::MaybeEnableAccessibility(
- views::View* view_tree) {
- if (IsAccessibilityEnabled()) {
- EnableAccessibilityForView(view_tree);
- } else {
- AddViewToBuffer(view_tree);
- }
-}
-
void WizardAccessibilityHelper::MaybeSpeak(const char* str, bool queue,
bool interruptible) {
if (IsAccessibilityEnabled()) {
@@ -90,32 +81,12 @@
}
}
-void WizardAccessibilityHelper::EnableAccessibilityForView(
- views::View* view_tree) {
- VLOG(1) << "Enabling accessibility.";
- if (!registered_notifications_)
- RegisterNotifications();
- SetAccessibilityEnabled(true);
- if (view_tree) {
- AddViewToBuffer(view_tree);
- // If accessibility pref is set, enable accessibility for all views in
- // the buffer for which access is not yet enabled.
- for (std::map<views::View*, bool>::iterator iter =
- views_buffer_.begin();
- iter != views_buffer_.end(); ++iter) {
- if (!(*iter).second) {
- AccessibleViewHelper *helper = new AccessibleViewHelper((*iter).first,
- profile_);
- accessible_view_helpers_.push_back(helper);
- (*iter).second = true;
- }
- }
- }
-}
-
-void WizardAccessibilityHelper::ToggleAccessibility(views::View* view_tree) {
+void WizardAccessibilityHelper::ToggleAccessibility() {
if (!IsAccessibilityEnabled()) {
- EnableAccessibilityForView(view_tree);
+ VLOG(1) << "Enabling accessibility.";
+ if (!registered_notifications_)
+ RegisterNotifications();
+ SetAccessibilityEnabled(true);
} else {
SetAccessibilityEnabled(false);
if (registered_notifications_)
@@ -140,21 +111,4 @@
}
}
-void WizardAccessibilityHelper::AddViewToBuffer(views::View* view_tree) {
- if (!view_tree->GetWidget())
- return;
- bool view_exists = false;
- // Check if the view is already queued for enabling accessibility.
- // Prevent adding the same view in the buffer twice.
- for (std::map<views::View*, bool>::iterator iter = views_buffer_.begin();
- iter != views_buffer_.end(); ++iter) {
- if ((*iter).first == view_tree) {
- view_exists = true;
- break;
- }
- }
- if (!view_exists)
- views_buffer_[view_tree] = false;
-}
-
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/wizard_accessibility_helper.h ('k') | chrome/browser/chromeos/login/wizard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698