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" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 | 39 |
| 40 void RegisterObservers(); | 40 void RegisterObservers(); |
| 41 | 41 |
| 42 // OnViewFocusedInArc is called when a view is focused in arc window and | 42 // OnViewFocusedInArc is called when a view is focused in arc window and |
| 43 // accessibility focus highlight is enabled. | 43 // accessibility focus highlight is enabled. |
| 44 void OnViewFocusedInArc(const gfx::Rect& bounds_in_screen); | 44 void OnViewFocusedInArc(const gfx::Rect& bounds_in_screen); |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, | 47 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, |
| 48 CursorWorksOnMultipleDisplays); | 48 CursorWorksOnMultipleDisplays); |
| 49 FRIEND_TEST_ALL_PREFIXES(AccessibilityFocusRingControllerTest, | |
| 50 CaretRingDrawnOnlyWithinBounds); | |
| 49 | 51 |
| 50 // ui::EventHandler overrides: | 52 // ui::EventHandler overrides: |
| 51 void OnMouseEvent(ui::MouseEvent* event) override; | 53 void OnMouseEvent(ui::MouseEvent* event) override; |
| 52 void OnKeyEvent(ui::KeyEvent* event) override; | 54 void OnKeyEvent(ui::KeyEvent* event) override; |
| 53 | 55 |
| 54 // content::NotificationObserver overrides: | 56 // content::NotificationObserver overrides: |
| 55 void Observe(int type, | 57 void Observe(int type, |
| 56 const content::NotificationSource& source, | 58 const content::NotificationSource& source, |
| 57 const content::NotificationDetails& details) override; | 59 const content::NotificationDetails& details) override; |
| 58 | 60 |
| 59 // ui::InputMethodObserver overrides: | 61 // ui::InputMethodObserver overrides: |
| 60 void OnTextInputTypeChanged(const ui::TextInputClient* client) override {} | 62 void OnTextInputTypeChanged(const ui::TextInputClient* client) override {} |
| 61 void OnFocus() override {} | 63 void OnFocus() override {} |
| 62 void OnBlur() override {} | 64 void OnBlur() override {} |
| 63 void OnInputMethodDestroyed(const ui::InputMethod* input_method) override {} | 65 void OnInputMethodDestroyed(const ui::InputMethod* input_method) override {} |
| 64 void OnShowImeIfNeeded() override {} | 66 void OnShowImeIfNeeded() override {} |
| 65 void OnTextInputStateChanged(const ui::TextInputClient* client) override; | 67 void OnTextInputStateChanged(const ui::TextInputClient* client) override; |
| 66 void OnCaretBoundsChanged(const ui::TextInputClient* client) override; | 68 void OnCaretBoundsChanged(const ui::TextInputClient* client) override; |
| 67 | 69 |
| 68 // aura::client::CursorClientObserver | 70 // aura::client::CursorClientObserver |
| 69 void OnCursorVisibilityChanged(bool is_visible) override; | 71 void OnCursorVisibilityChanged(bool is_visible) override; |
| 70 | 72 |
| 71 virtual bool IsCursorVisible(); | 73 virtual bool IsCursorVisible(); |
| 72 | 74 |
| 73 private: | 75 private: |
| 76 bool IsCaretVisible(const gfx::Rect caret_bounds); | |
|
dmazzoni
2017/06/22 04:54:49
nit: const gfx::Rect&
Maajid
2017/06/27 02:25:16
Done.
| |
| 74 void UpdateFocusAndCaretHighlights(); | 77 void UpdateFocusAndCaretHighlights(); |
| 75 void UpdateCursorHighlight(); | 78 void UpdateCursorHighlight(); |
| 76 | 79 |
| 77 bool focus_ = false; | 80 bool focus_ = false; |
| 78 gfx::Rect focus_rect_; | 81 gfx::Rect focus_rect_; |
| 79 | 82 |
| 80 bool cursor_ = false; | 83 bool cursor_ = false; |
| 81 gfx::Point cursor_point_; | 84 gfx::Point cursor_point_; |
| 82 | 85 |
| 83 bool caret_ = false; | 86 bool caret_ = false; |
| 84 bool caret_visible_ = false; | 87 bool caret_visible_ = false; |
| 85 gfx::Point caret_point_; | 88 gfx::Point caret_point_; |
| 86 | 89 |
| 87 bool registered_observers_ = false; | 90 bool registered_observers_ = false; |
| 88 content::NotificationRegistrar registrar_; | 91 content::NotificationRegistrar registrar_; |
| 89 | 92 |
| 90 DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManager); | 93 DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManager); |
| 91 }; | 94 }; |
| 92 | 95 |
| 93 } // namespace chromeos | 96 } // namespace chromeos |
| 94 | 97 |
| 95 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER _H_ | 98 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER _H_ |
| OLD | NEW |