Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 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 | 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_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/notification_details.h" | 8 #include "content/public/browser/notification_details.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| 11 #include "content/public/browser/notification_source.h" | 11 #include "content/public/browser/notification_source.h" |
| 12 #include "ui/aura/client/cursor_client_observer.h" | 12 #include "ui/aura/client/cursor_client_observer.h" |
| 13 #include "ui/base/ime/input_method.h" | 13 #include "ui/base/ime/input_method.h" |
| 14 #include "ui/base/ime/input_method_observer.h" | 14 #include "ui/base/ime/input_method_observer.h" |
| 15 #include "ui/base/ime/text_input_client.h" | 15 #include "ui/base/ime/text_input_client.h" |
| 16 #include "ui/events/event.h" | 16 #include "ui/events/event.h" |
| 17 #include "ui/events/event_handler.h" | 17 #include "ui/events/event_handler.h" |
| 18 #include "ui/gfx/geometry/rect.h" | |
| 18 | 19 |
| 19 namespace chromeos { | 20 namespace chromeos { |
| 20 | 21 |
| 21 // Manage visual highlights that Chrome OS can draw around the focused | 22 // Manage visual highlights that Chrome OS can draw around the focused |
| 22 // object, the cursor, and the text caret for accessibility. | 23 // object, the cursor, and the text caret for accessibility. |
| 23 class AccessibilityHighlightManager | 24 class AccessibilityHighlightManager |
| 24 : public ui::EventHandler, | 25 : public ui::EventHandler, |
| 25 public content::NotificationObserver, | 26 public content::NotificationObserver, |
| 26 public ui::InputMethodObserver, | 27 public ui::InputMethodObserver, |
| 27 public aura::client::CursorClientObserver { | 28 public aura::client::CursorClientObserver { |
| 28 public: | 29 public: |
| 29 AccessibilityHighlightManager(); | 30 AccessibilityHighlightManager(); |
| 30 ~AccessibilityHighlightManager() override; | 31 ~AccessibilityHighlightManager() override; |
| 31 | 32 |
| 32 void HighlightFocus(bool focus); | 33 void HighlightFocus(bool focus); |
| 33 void HighlightCursor(bool cursor); | 34 void HighlightCursor(bool cursor); |
| 34 void HighlightCaret(bool caret); | 35 void HighlightCaret(bool caret); |
| 35 | 36 |
| 36 void RegisterObservers(); | 37 void RegisterObservers(); |
| 37 | 38 |
| 39 void OnViewFocusedInArc(const gfx::Rect& bounds); | |
|
hidehiko
2017/01/20 13:24:15
Comment when this is actually called? and/or what'
yawano
2017/01/23 09:04:51
Done.
| |
| 40 | |
| 38 protected: | 41 protected: |
| 39 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, | 42 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, |
| 40 CursorWorksOnMultipleDisplays); | 43 CursorWorksOnMultipleDisplays); |
| 41 | 44 |
| 42 // ui::EventHandler overrides: | 45 // ui::EventHandler overrides: |
| 43 void OnMouseEvent(ui::MouseEvent* event) override; | 46 void OnMouseEvent(ui::MouseEvent* event) override; |
| 44 void OnKeyEvent(ui::KeyEvent* event) override; | 47 void OnKeyEvent(ui::KeyEvent* event) override; |
| 45 | 48 |
| 46 // content::NotificationObserver overrides: | 49 // content::NotificationObserver overrides: |
| 47 void Observe(int type, | 50 void Observe(int type, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 78 | 81 |
| 79 bool registered_observers_ = false; | 82 bool registered_observers_ = false; |
| 80 content::NotificationRegistrar registrar_; | 83 content::NotificationRegistrar registrar_; |
| 81 | 84 |
| 82 DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManager); | 85 DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManager); |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 } // namespace chromeos | 88 } // namespace chromeos |
| 86 | 89 |
| 87 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER _H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER _H_ |
| OLD | NEW |