diff options
author | chaitanyag@chromium.org <chaitanyag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 01:43:01 +0000 |
---|---|---|
committer | chaitanyag@chromium.org <chaitanyag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 01:43:01 +0000 |
commit | e65dda8abfda0fc35d837e275771b53719946cd3 (patch) | |
tree | bb39e5975056cb2183daed34a108dce81b1d6348 | |
parent | e54edc37fb21741c9e5cacf6ff330da03332391e (diff) | |
download | chromium_src-e65dda8abfda0fc35d837e275771b53719946cd3.zip chromium_src-e65dda8abfda0fc35d837e275771b53719946cd3.tar.gz chromium_src-e65dda8abfda0fc35d837e275771b53719946cd3.tar.bz2 |
Enabling access notifications for login wizard
Review URL: http://codereview.chromium.org/3442011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60743 0039d316-1c4b-4281-b951-d872f2087c98
18 files changed, 211 insertions, 44 deletions
diff --git a/chrome/browser/chromeos/login/existing_user_view.cc b/chrome/browser/chromeos/login/existing_user_view.cc index ace4426..43858e5 100644 --- a/chrome/browser/chromeos/login/existing_user_view.cc +++ b/chrome/browser/chromeos/login/existing_user_view.cc @@ -7,6 +7,7 @@ #include "app/l10n_util.h" #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/user_controller.h" +#include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "grit/generated_resources.h" #include "views/focus/focus_manager.h" #include "views/grid_layout.h" @@ -69,12 +70,13 @@ class UserEntryTextfield : public views::Textfield { DISALLOW_COPY_AND_ASSIGN(UserEntryTextfield); }; + ExistingUserView::ExistingUserView(UserController* uc) - : accel_login_off_the_record_( - views::Accelerator(app::VKEY_B, false, false, true)), - password_field_(NULL), + : password_field_(NULL), submit_button_(NULL), - user_controller_(uc) { + user_controller_(uc), + accel_enable_accessibility_( + WizardAccessibilityHelper::GetAccelerator()) { AddAccelerator(accel_login_off_the_record_); } @@ -108,26 +110,35 @@ void ExistingUserView::RecreateFields() { SetLayoutManager(layout); layout->Layout(this); SchedulePaint(); + AddAccelerator(accel_enable_accessibility_); } -void ExistingUserView::FocusPasswordField() { - if (GetFocusManager()) { - password_field()->RequestFocus(); - } -} - -void ExistingUserView::OnLocaleChanged() { - RecreateFields(); -} - - bool ExistingUserView::AcceleratorPressed( const views::Accelerator& accelerator) { if (accelerator == accel_login_off_the_record_) { user_controller_->OnLoginOffTheRecord(); return true; + } else if (accelerator == accel_enable_accessibility_) { + WizardAccessibilityHelper::GetInstance()->EnableAccessibility(this); + return true; } return false; } +void ExistingUserView::ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child) { + if (is_add && this == child) + WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); +} + +void ExistingUserView::FocusPasswordField() { + if (GetFocusManager()) { + password_field()->RequestFocus(); + } +} + +void ExistingUserView::OnLocaleChanged() { + RecreateFields(); +} } // namespace chromeos diff --git a/chrome/browser/chromeos/login/existing_user_view.h b/chrome/browser/chromeos/login/existing_user_view.h index a304496..15886bf 100644 --- a/chrome/browser/chromeos/login/existing_user_view.h +++ b/chrome/browser/chromeos/login/existing_user_view.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_VIEW_H_ #pragma once +#include "views/accelerator.h" #include "views/controls/button/native_button.h" #include "views/controls/textfield/textfield.h" #include "views/view.h" @@ -32,6 +33,9 @@ class ExistingUserView : public views::View { protected: // views::View overrides: virtual void OnLocaleChanged(); + virtual void ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child); views::Accelerator accel_login_off_the_record_; @@ -43,6 +47,9 @@ class ExistingUserView : public views::View { UserController* user_controller_; + private: + views::Accelerator accel_enable_accessibility_; + DISALLOW_COPY_AND_ASSIGN(ExistingUserView); }; diff --git a/chrome/browser/chromeos/login/network_selection_view.cc b/chrome/browser/chromeos/login/network_selection_view.cc index 6298e04..4b80b9c 100644 --- a/chrome/browser/chromeos/login/network_selection_view.cc +++ b/chrome/browser/chromeos/login/network_selection_view.cc @@ -15,6 +15,7 @@ #include "chrome/browser/chromeos/login/language_switch_menu.h" #include "chrome/browser/chromeos/login/network_screen_delegate.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" +#include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "chrome/browser/chromeos/status/network_dropdown_button.h" #include "gfx/size.h" #include "grit/chromium_strings.h" @@ -340,6 +341,13 @@ void NetworkSelectionView::OnLocaleChanged() { SchedulePaint(); } +void NetworkSelectionView::ViewHierarchyChanged(bool is_add, + View* parent, + View* child) { + if (is_add && this == child) + WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); +} + //////////////////////////////////////////////////////////////////////////////// // NetworkSelectionView, public: diff --git a/chrome/browser/chromeos/login/network_selection_view.h b/chrome/browser/chromeos/login/network_selection_view.h index 56c3616..b089ff8 100644 --- a/chrome/browser/chromeos/login/network_selection_view.h +++ b/chrome/browser/chromeos/login/network_selection_view.h @@ -71,6 +71,9 @@ class NetworkSelectionView : public views::View, protected: // Overridden from views::View. virtual void OnLocaleChanged(); + virtual void ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child); // LoginHtmlDialog::Delegate implementation: virtual void OnDialogClosed() {} diff --git a/chrome/browser/chromeos/login/new_user_view.cc b/chrome/browser/chromeos/login/new_user_view.cc index 7be024d..89fda20 100644 --- a/chrome/browser/chromeos/login/new_user_view.cc +++ b/chrome/browser/chromeos/login/new_user_view.cc @@ -23,6 +23,7 @@ #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" +#include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "grit/app_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -89,6 +90,7 @@ NewUserView::NewUserView(Delegate* delegate, accel_focus_user_(views::Accelerator(app::VKEY_U, false, false, true)), accel_login_off_the_record_( views::Accelerator(app::VKEY_B, false, false, true)), + accel_enable_accessibility_(WizardAccessibilityHelper::GetAccelerator()), delegate_(delegate), ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)), focus_delayed_(false), @@ -161,6 +163,7 @@ void NewUserView::Init() { AddAccelerator(accel_focus_user_); AddAccelerator(accel_focus_pass_); AddAccelerator(accel_login_off_the_record_); + AddAccelerator(accel_enable_accessibility_); UpdateLocalizedStrings(); RequestFocus(); @@ -180,6 +183,8 @@ bool NewUserView::AcceleratorPressed(const views::Accelerator& accelerator) { password_field_->RequestFocus(); } else if (accelerator == accel_login_off_the_record_) { delegate_->OnLoginOffTheRecord(); + } else if (accelerator == accel_enable_accessibility_) { + WizardAccessibilityHelper::GetInstance()->EnableAccessibility(this); } else { return false; } @@ -268,6 +273,7 @@ void NewUserView::ViewHierarchyChanged(bool is_add, MessageLoop::current()->PostTask(FROM_HERE, focus_grabber_factory_.NewRunnableMethod( &NewUserView::FocusFirstField)); + WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); } } diff --git a/chrome/browser/chromeos/login/new_user_view.h b/chrome/browser/chromeos/login/new_user_view.h index 19a8801..926dff0 100644 --- a/chrome/browser/chromeos/login/new_user_view.h +++ b/chrome/browser/chromeos/login/new_user_view.h @@ -113,7 +113,8 @@ class NewUserView : public views::View, protected: // views::View overrides: - virtual void ViewHierarchyChanged(bool is_add, views::View *parent, + virtual void ViewHierarchyChanged(bool is_add, + views::View *parent, views::View *child); virtual void NativeViewHierarchyChanged(bool attached, gfx::NativeView native_view, @@ -151,6 +152,7 @@ class NewUserView : public views::View, views::Accelerator accel_focus_pass_; views::Accelerator accel_focus_user_; views::Accelerator accel_login_off_the_record_; + views::Accelerator accel_enable_accessibility_; // Notifications receiver. Delegate* delegate_; diff --git a/chrome/browser/chromeos/login/password_changed_view.cc b/chrome/browser/chromeos/login/password_changed_view.cc index daa2909..87c89d5 100644 --- a/chrome/browser/chromeos/login/password_changed_view.cc +++ b/chrome/browser/chromeos/login/password_changed_view.cc @@ -9,6 +9,7 @@ #include "app/resource_bundle.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" +#include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "views/controls/button/radio_button.h" @@ -60,8 +61,10 @@ gfx::Size PasswordChangedView::GetPreferredSize() { void PasswordChangedView::ViewHierarchyChanged(bool is_add, views::View* parent, views::View* child) { - if (is_add && child == this) + if (is_add && child == this) { Init(); + WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); + } } void PasswordChangedView::Init() { diff --git a/chrome/browser/chromeos/login/screen_lock_view.cc b/chrome/browser/chromeos/login/screen_lock_view.cc index b1dbd3a..f7d3330 100644 --- a/chrome/browser/chromeos/login/screen_lock_view.cc +++ b/chrome/browser/chromeos/login/screen_lock_view.cc @@ -12,6 +12,8 @@ #include "chrome/browser/chromeos/login/screen_locker.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/login/user_view.h" +#include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" +#include "chrome/browser/profile_manager.h" #include "chrome/common/notification_service.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -215,4 +217,10 @@ void ScreenLockView::Observe( user_view_->SetImage(user->image()); } +void ScreenLockView::ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child) { + if (is_add && this == child) + WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); +} } // namespace chromeos diff --git a/chrome/browser/chromeos/login/screen_lock_view.h b/chrome/browser/chromeos/login/screen_lock_view.h index 9f4c6b0..e826271 100644 --- a/chrome/browser/chromeos/login/screen_lock_view.h +++ b/chrome/browser/chromeos/login/screen_lock_view.h @@ -68,6 +68,12 @@ class ScreenLockView : public views::View, // UserView::Delegate implementation: virtual void OnSignout(); + protected: + // views::View implementation: + virtual void ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child); + private: friend class test::ScreenLockerTester; diff --git a/chrome/browser/chromeos/login/update_view.cc b/chrome/browser/chromeos/login/update_view.cc index e99d13d..59e20dd 100644 --- a/chrome/browser/chromeos/login/update_view.cc +++ b/chrome/browser/chromeos/login/update_view.cc @@ -11,6 +11,7 @@ #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" #include "chrome/browser/chromeos/login/update_screen.h" +#include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "views/border.h" @@ -209,6 +210,11 @@ bool UpdateView::AcceleratorPressed(const views::Accelerator& a) { return false; } +void UpdateView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { + if (is_add && this == child) + WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); +} + void UpdateView::InitLabel(views::Label** label) { *label = new views::Label(); (*label)->SetColor(kLabelColor); diff --git a/chrome/browser/chromeos/login/update_view.h b/chrome/browser/chromeos/login/update_view.h index c8c0b60..0549edf 100644 --- a/chrome/browser/chromeos/login/update_view.h +++ b/chrome/browser/chromeos/login/update_view.h @@ -52,6 +52,12 @@ class UpdateView : public views::View { virtual void Layout(); virtual bool AcceleratorPressed(const views::Accelerator& a); + protected: + // views::View implementation: + virtual void ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child); + private: // Creates Label control and adds it as a child. void InitLabel(views::Label** label); diff --git a/chrome/browser/chromeos/login/user_image_view.cc b/chrome/browser/chromeos/login/user_image_view.cc index 577820c..dfd89ea 100644 --- a/chrome/browser/chromeos/login/user_image_view.cc +++ b/chrome/browser/chromeos/login/user_image_view.cc @@ -11,6 +11,8 @@ #include "base/callback.h" #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" +#include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" +#include "chrome/browser/profile_manager.h" #include "gfx/canvas.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -163,6 +165,13 @@ void UserImageView::UpdateVideoFrame(const SkBitmap& frame) { user_image_->SetImage(&user_image); } +void UserImageView::ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child) { + if (is_add && this == child) + WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); +} + gfx::Size UserImageView::GetPreferredSize() { return gfx::Size(width(), height()); } diff --git a/chrome/browser/chromeos/login/user_image_view.h b/chrome/browser/chromeos/login/user_image_view.h index 791218c..7f59381 100644 --- a/chrome/browser/chromeos/login/user_image_view.h +++ b/chrome/browser/chromeos/login/user_image_view.h @@ -52,6 +52,12 @@ class UserImageView : public views::View, // Overridden from views::ButtonListener. virtual void ButtonPressed(views::Button* sender, const views::Event& event); + protected: + // views::View overrides: + virtual void ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child); + private: // Initializes layout manager for this view. void InitLayout(); diff --git a/chrome/browser/chromeos/login/wizard_accessibility_handler.cc b/chrome/browser/chromeos/login/wizard_accessibility_handler.cc index af4f63f..6271f12 100644 --- a/chrome/browser/chromeos/login/wizard_accessibility_handler.cc +++ b/chrome/browser/chromeos/login/wizard_accessibility_handler.cc @@ -17,7 +17,7 @@ void WizardAccessibilityHandler::Observe( info = Details<const AccessibilityControlInfo>(details).ptr(); switch (type.value) { case NotificationType::ACCESSIBILITY_CONTROL_FOCUSED: - Speak(info->name().c_str()); + Speak(info->name().c_str(), false, true); break; case NotificationType::ACCESSIBILITY_CONTROL_ACTION: break; @@ -33,10 +33,19 @@ void WizardAccessibilityHandler::Observe( } } -void WizardAccessibilityHandler::Speak(const char* speak_str) { +void WizardAccessibilityHandler::Speak(const char* speak_str, + bool queue, + bool interruptible) { if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { - chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()-> - StopSpeaking(); + if (queue || !interruptible) { + std::string props = ""; + props.append("enqueue="); + props.append(queue ? "1;" : "0;"); + props.append("interruptible="); + props.append(interruptible ? "1;" : "0;"); + chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()-> + SetSpeakProperties(props.c_str()); + } chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()-> Speak(speak_str); } diff --git a/chrome/browser/chromeos/login/wizard_accessibility_handler.h b/chrome/browser/chromeos/login/wizard_accessibility_handler.h index 555696d..68987b4 100644 --- a/chrome/browser/chromeos/login/wizard_accessibility_handler.h +++ b/chrome/browser/chromeos/login/wizard_accessibility_handler.h @@ -13,9 +13,11 @@ // Class that handles the accessibility notifications and generates // appropriate spoken/audio feedback. class WizardAccessibilityHandler : public NotificationObserver { - private: + public: // Speaks the specified string. - void Speak(const char* speak_str); + void Speak(const char* speak_str, bool queue, bool interruptible); + + private: // Override from NotificationObserver. virtual void Observe(NotificationType type, diff --git a/chrome/browser/chromeos/login/wizard_accessibility_helper.cc b/chrome/browser/chromeos/login/wizard_accessibility_helper.cc index 5daf0c0..eea0bc2 100644 --- a/chrome/browser/chromeos/login/wizard_accessibility_helper.cc +++ b/chrome/browser/chromeos/login/wizard_accessibility_helper.cc @@ -5,6 +5,7 @@ #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "base/logging.h" +#include "base/stl_util-inl.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extension_accessibility_api.h" #include "chrome/browser/prefs/pref_service.h" @@ -13,6 +14,18 @@ #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" +#include "views/accelerator.h" +#include "views/view.h" + +scoped_ptr<views::Accelerator> WizardAccessibilityHelper::accelerator_; + +// static +views::Accelerator WizardAccessibilityHelper::GetAccelerator() { + if (!WizardAccessibilityHelper::accelerator_.get()) + WizardAccessibilityHelper::accelerator_.reset( + new views::Accelerator(app::VKEY_Z, false, true, true)); + return *(WizardAccessibilityHelper::accelerator_.get()); +} // static WizardAccessibilityHelper* WizardAccessibilityHelper::GetInstance() { @@ -21,6 +34,7 @@ WizardAccessibilityHelper* WizardAccessibilityHelper::GetInstance() { WizardAccessibilityHelper::WizardAccessibilityHelper() { accessibility_handler_.reset(new WizardAccessibilityHandler()); + profile_ = ProfileManager::GetDefaultProfile(); registrar_.Add(accessibility_handler_.get(), NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, NotificationService::AllSources()); @@ -39,18 +53,28 @@ WizardAccessibilityHelper::WizardAccessibilityHelper() { } void WizardAccessibilityHelper::MaybeEnableAccessibility( - views::View* view_tree, Profile* profile) { - if (g_browser_process != NULL && + views::View* view_tree) { + if (g_browser_process && g_browser_process->local_state()->GetBoolean( prefs::kAccessibilityEnabled)) { - EnableAccessibility(view_tree, profile); + EnableAccessibility(view_tree); + } else { + AddViewToBuffer(view_tree); } } -void WizardAccessibilityHelper::EnableAccessibility( - views::View* view_tree, Profile* profile) { +void WizardAccessibilityHelper::MaybeSpeak(const char* str, bool queue, + bool interruptible) { + if (g_browser_process && + g_browser_process->local_state()->GetBoolean( + prefs::kAccessibilityEnabled)) { + accessibility_handler_->Speak(str, queue, interruptible); + } +} + +void WizardAccessibilityHelper::EnableAccessibility(views::View* view_tree) { LOG(INFO) << "Enabling accessibility."; - if (g_browser_process != NULL) { + if (g_browser_process) { PrefService* prefService = g_browser_process->local_state(); if (!prefService->GetBoolean(prefs::kAccessibilityEnabled)) { prefService->SetBoolean(prefs::kAccessibilityEnabled, true); @@ -59,6 +83,34 @@ void WizardAccessibilityHelper::EnableAccessibility( } ExtensionAccessibilityEventRouter::GetInstance()-> SetAccessibilityEnabled(true); - accessible_view_helper_.reset(new AccessibleViewHelper( - view_tree, profile)); + 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::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; } diff --git a/chrome/browser/chromeos/login/wizard_accessibility_helper.h b/chrome/browser/chromeos/login/wizard_accessibility_helper.h index 5f4d370..9344a47 100644 --- a/chrome/browser/chromeos/login/wizard_accessibility_helper.h +++ b/chrome/browser/chromeos/login/wizard_accessibility_helper.h @@ -6,6 +6,9 @@ #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ #pragma once +#include <map> +#include <vector> + #include "app/keyboard_codes.h" #include "base/scoped_ptr.h" #include "base/singleton.h" @@ -15,6 +18,7 @@ class Profile; namespace views { +class Accelerator; class View; } @@ -25,26 +29,45 @@ class WizardAccessibilityHelper { // Get Singleton instance of WizardAccessibilityHelper. static WizardAccessibilityHelper* GetInstance(); - // Enables Accessibility by setting the accessibility pref and - // registering the specified view_tree to raise UI notifications. - void EnableAccessibility(views::View* view_tree, Profile* profile); + // Get accelerator for enabling accessibility. + static views::Accelerator GetAccelerator(); + + // Enables Accessibility by setting the accessibility pref and registers + // all views in the view buffer to raise accessibility notifications, + // including the specified |view_tree|. + void EnableAccessibility(views::View* view_tree); - // Enabled accessibility for the specified view_tree if the - // accessibility pref is already set. - void MaybeEnableAccessibility(views::View* view_tree, Profile* profile); + // Enables accessibility for the specified |view_tree| if the + // accessibility pref is already set. Otherwise the |view_tree| is + // added to a view buffer so that accessibility can be enabled for it + // later when requested. + void MaybeEnableAccessibility(views::View* view_tree); - // Keyboard accelerator key to enable accessibility. - static const app::KeyboardCode accelerator = app::VKEY_Z; + // Speak the given text if the accessibility pref is already set. |queue| + // specifies whether this utterance will be queued or spoken immediately. + // |interruptible| specified whether this utterance can be flushed by a + // subsequent utterance. + void MaybeSpeak(const char* str, bool queue, bool interruptible); private: friend struct DefaultSingletonTraits<WizardAccessibilityHelper>; + WizardAccessibilityHelper(); - ~WizardAccessibilityHelper() {} - scoped_ptr<AccessibleViewHelper> accessible_view_helper_; + virtual ~WizardAccessibilityHelper() {} + + static scoped_ptr<views::Accelerator> accelerator_; + + void AddViewToBuffer(views::View* view_tree); + + std::map<views::View*, bool> views_buffer_; + + std::vector<AccessibleViewHelper*> accessible_view_helpers_; scoped_ptr<WizardAccessibilityHandler> accessibility_handler_; + Profile* profile_; + // Used for tracking registrations to accessibility notifications. NotificationRegistrar registrar_; diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 84b3179..8dbbaf1 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -92,8 +92,8 @@ class ContentView : public views::View { false, true, true)), accel_register_screen_(views::Accelerator(app::VKEY_R, false, true, true)), - accel_enable_accessibility_(views::Accelerator( - WizardAccessibilityHelper::accelerator, false, true, true)) { + accel_enable_accessibility_( + WizardAccessibilityHelper::GetAccelerator()) { AddAccelerator(accel_account_screen_); AddAccelerator(accel_login_screen_); AddAccelerator(accel_network_screen_); @@ -132,7 +132,7 @@ class ContentView : public views::View { controller->ShowRegistrationScreen(); } else if (accel == accel_enable_accessibility_) { WizardAccessibilityHelper::GetInstance()->EnableAccessibility( - controller->contents(), ProfileManager::GetDefaultProfile()); + controller->contents()); } else { return false; } |