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 | 18 |
| 19 namespace gfx { | |
| 20 class Rect; | |
| 21 } // namespace gfx | |
| 22 | |
| 19 namespace chromeos { | 23 namespace chromeos { |
| 20 | 24 |
| 21 // Manage visual highlights that Chrome OS can draw around the focused | 25 // Manage visual highlights that Chrome OS can draw around the focused |
| 22 // object, the cursor, and the text caret for accessibility. | 26 // object, the cursor, and the text caret for accessibility. |
| 23 class AccessibilityHighlightManager | 27 class AccessibilityHighlightManager |
| 24 : public ui::EventHandler, | 28 : public ui::EventHandler, |
| 25 public content::NotificationObserver, | 29 public content::NotificationObserver, |
| 26 public ui::InputMethodObserver, | 30 public ui::InputMethodObserver, |
| 27 public aura::client::CursorClientObserver { | 31 public aura::client::CursorClientObserver { |
| 28 public: | 32 public: |
| 29 AccessibilityHighlightManager(); | 33 AccessibilityHighlightManager(); |
| 30 ~AccessibilityHighlightManager() override; | 34 ~AccessibilityHighlightManager() override; |
| 31 | 35 |
| 32 void HighlightFocus(bool focus); | 36 void HighlightFocus(bool focus); |
| 33 void HighlightCursor(bool cursor); | 37 void HighlightCursor(bool cursor); |
| 34 void HighlightCaret(bool caret); | 38 void HighlightCaret(bool caret); |
| 35 | 39 |
| 36 void RegisterObservers(); | 40 void RegisterObservers(); |
| 37 | 41 |
| 42 // OnViewFocusedInArc is called when a view is focused in arc window and | |
| 43 // accessibility focus highlight is enabled. | |
| 44 void OnViewFocusedInArc(const gfx::Rect& boundsInScreen); | |
|
dcheng
2017/01/24 09:36:56
Nit: name_like_this, here and elsewhere in this CL
yawano
2017/01/24 11:18:09
Done. Thank you for catching this!
| |
| 45 | |
| 38 protected: | 46 protected: |
| 39 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, | 47 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, |
| 40 CursorWorksOnMultipleDisplays); | 48 CursorWorksOnMultipleDisplays); |
| 41 | 49 |
| 42 // ui::EventHandler overrides: | 50 // ui::EventHandler overrides: |
| 43 void OnMouseEvent(ui::MouseEvent* event) override; | 51 void OnMouseEvent(ui::MouseEvent* event) override; |
| 44 void OnKeyEvent(ui::KeyEvent* event) override; | 52 void OnKeyEvent(ui::KeyEvent* event) override; |
| 45 | 53 |
| 46 // content::NotificationObserver overrides: | 54 // content::NotificationObserver overrides: |
| 47 void Observe(int type, | 55 void Observe(int type, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 78 | 86 |
| 79 bool registered_observers_ = false; | 87 bool registered_observers_ = false; |
| 80 content::NotificationRegistrar registrar_; | 88 content::NotificationRegistrar registrar_; |
| 81 | 89 |
| 82 DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManager); | 90 DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManager); |
| 83 }; | 91 }; |
| 84 | 92 |
| 85 } // namespace chromeos | 93 } // namespace chromeos |
| 86 | 94 |
| 87 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER _H_ | 95 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER _H_ |
| OLD | NEW |