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

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

Issue 3442011: Enabling access notifications for login wizard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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.h
===================================================================
--- chrome/browser/chromeos/login/wizard_accessibility_helper.h (revision 60696)
+++ chrome/browser/chromeos/login/wizard_accessibility_helper.h (working copy)
@@ -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 @@
// 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();
- // Enabled accessibility for the specified view_tree if the
- // accessibility pref is already set.
- void MaybeEnableAccessibility(views::View* view_tree, Profile* profile);
+ // 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);
- // Keyboard accelerator key to enable accessibility.
- static const app::KeyboardCode accelerator = app::VKEY_Z;
+ // 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);
+ // 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_;

Powered by Google App Engine
This is Rietveld 408576698