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

Side by Side 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, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map>
10 #include <vector>
11
9 #include "app/keyboard_codes.h" 12 #include "app/keyboard_codes.h"
10 #include "base/scoped_ptr.h" 13 #include "base/scoped_ptr.h"
11 #include "base/singleton.h" 14 #include "base/singleton.h"
12 #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h" 15 #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h"
13 #include "chrome/browser/views/accessible_view_helper.h" 16 #include "chrome/browser/views/accessible_view_helper.h"
14 #include "chrome/common/notification_registrar.h" 17 #include "chrome/common/notification_registrar.h"
15 18
16 class Profile; 19 class Profile;
17 namespace views { 20 namespace views {
21 class Accelerator;
18 class View; 22 class View;
19 } 23 }
20 24
21 // Class that provides convenience methods to enable accessibility for a 25 // Class that provides convenience methods to enable accessibility for a
22 // specified View. 26 // specified View.
23 class WizardAccessibilityHelper { 27 class WizardAccessibilityHelper {
24 public: 28 public:
25 // Get Singleton instance of WizardAccessibilityHelper. 29 // Get Singleton instance of WizardAccessibilityHelper.
26 static WizardAccessibilityHelper* GetInstance(); 30 static WizardAccessibilityHelper* GetInstance();
27 31
28 // Enables Accessibility by setting the accessibility pref and 32 // Get accelerator for enabling accessibility.
29 // registering the specified view_tree to raise UI notifications. 33 static views::Accelerator GetAccelerator();
30 void EnableAccessibility(views::View* view_tree, Profile* profile);
31 34
32 // Enabled accessibility for the specified view_tree if the 35 // Enables Accessibility by setting the accessibility pref and registers
33 // accessibility pref is already set. 36 // all views in the view buffer to raise accessibility notifications,
34 void MaybeEnableAccessibility(views::View* view_tree, Profile* profile); 37 // including the specified |view_tree|.
38 void EnableAccessibility(views::View* view_tree);
35 39
36 // Keyboard accelerator key to enable accessibility. 40 // Enables accessibility for the specified |view_tree| if the
37 static const app::KeyboardCode accelerator = app::VKEY_Z; 41 // accessibility pref is already set. Otherwise the |view_tree| is
42 // added to a view buffer so that accessibility can be enabled for it
43 // later when requested.
44 void MaybeEnableAccessibility(views::View* view_tree);
45
46 // Speak the given text if the accessibility pref is already set. |queue|
47 // specifies whether this utterance will be queued or spoken immediately.
48 // |interruptible| specified whether this utterance can be flushed by a
49 // subsequent utterance.
50 void MaybeSpeak(const char* str, bool queue, bool interruptible);
38 51
39 private: 52 private:
40 friend struct DefaultSingletonTraits<WizardAccessibilityHelper>; 53 friend struct DefaultSingletonTraits<WizardAccessibilityHelper>;
54
41 WizardAccessibilityHelper(); 55 WizardAccessibilityHelper();
42 ~WizardAccessibilityHelper() {}
43 56
44 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; 57 virtual ~WizardAccessibilityHelper() {}
58
59 static scoped_ptr<views::Accelerator> accelerator_;
60
61 void AddViewToBuffer(views::View* view_tree);
62
63 std::map<views::View*, bool> views_buffer_;
64
65 std::vector<AccessibleViewHelper*> accessible_view_helpers_;
45 66
46 scoped_ptr<WizardAccessibilityHandler> accessibility_handler_; 67 scoped_ptr<WizardAccessibilityHandler> accessibility_handler_;
47 68
69 Profile* profile_;
70
48 // Used for tracking registrations to accessibility notifications. 71 // Used for tracking registrations to accessibility notifications.
49 NotificationRegistrar registrar_; 72 NotificationRegistrar registrar_;
50 73
51 DISALLOW_COPY_AND_ASSIGN(WizardAccessibilityHelper); 74 DISALLOW_COPY_AND_ASSIGN(WizardAccessibilityHelper);
52 }; 75 };
53 76
54 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_ 77 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_ACCESSIBILITY_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698