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

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_highlight_manager.h

Issue 1822823002: Implement Chrome OS accessibility features to highlight focus, caret & cursor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing without views_delegate change for now Created 4 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/accessibility/accessibility_highlight_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_
7
8 #include "content/public/browser/notification_details.h"
9 #include "content/public/browser/notification_observer.h"
10 #include "content/public/browser/notification_registrar.h"
11 #include "content/public/browser/notification_source.h"
12 #include "ui/base/ime/input_method.h"
13 #include "ui/base/ime/input_method_observer.h"
14 #include "ui/base/ime/text_input_client.h"
15 #include "ui/events/event.h"
16 #include "ui/events/event_handler.h"
17
18 namespace chromeos {
19
20 // Manage visual highlights that Chrome OS can draw around the focused
21 // object, the cursor, and the text caret for accessibility.
22 class AccessibilityHighlightManager : public ui::EventHandler,
23 public content::NotificationObserver,
24 public ui::InputMethodObserver {
25 public:
26 AccessibilityHighlightManager();
27 ~AccessibilityHighlightManager() override;
28
29 void HighlightFocus(bool focus);
30 void HighlightCursor(bool cursor);
31 void HighlightCaret(bool caret);
32
33 private:
34 // ui::EventHandler overrides:
35 void OnMouseEvent(ui::MouseEvent* event) override;
36
37 // content::NotificationObserver overrides:
38 void Observe(int type,
39 const content::NotificationSource& source,
40 const content::NotificationDetails& details) override;
41
42 // ui::InputMethodObserver overrides:
43 void OnTextInputTypeChanged(const ui::TextInputClient* client) override {}
44 void OnFocus() override {}
45 void OnBlur() override {}
46 void OnInputMethodDestroyed(const ui::InputMethod* input_method) override {}
47 void OnShowImeIfNeeded() override {}
48 void OnTextInputStateChanged(const ui::TextInputClient* client) override;
49 void OnCaretBoundsChanged(const ui::TextInputClient* client) override;
50
51 bool focus_ = false;
52 gfx::Rect focus_rect_;
53
54 bool cursor_ = false;
55 gfx::Point cursor_point_;
56
57 bool caret_ = false;
58 gfx::Point caret_point_;
59
60 content::NotificationRegistrar registrar_;
61
62 DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManager);
63 };
64
65 } // namespace chromeos
66
67 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER _H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/accessibility/accessibility_highlight_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698