Chromium Code Reviews| Index: chrome/browser/chromeos/accessibility/accessibility_highlight_manager.h |
| diff --git a/chrome/browser/chromeos/accessibility/accessibility_highlight_manager.h b/chrome/browser/chromeos/accessibility/accessibility_highlight_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9d6838a0875ae4c442ecc816eda55bc33b53e372 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/accessibility/accessibility_highlight_manager.h |
| @@ -0,0 +1,65 @@ |
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_ |
| +#define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_ |
| + |
| +#include "content/public/browser/notification_details.h" |
| +#include "content/public/browser/notification_observer.h" |
| +#include "content/public/browser/notification_registrar.h" |
| +#include "content/public/browser/notification_source.h" |
| +#include "ui/base/ime/input_method.h" |
| +#include "ui/base/ime/input_method_observer.h" |
| +#include "ui/base/ime/text_input_client.h" |
| +#include "ui/events/event.h" |
| +#include "ui/events/event_handler.h" |
| + |
| +namespace chromeos { |
| + |
| +// Manage visual highlights that Chrome OS can draw around the focused |
| +// object, the cursor, and the text caret for accessibility. |
| +class AccessibilityHighlightManager : public ui::EventHandler, |
| + public content::NotificationObserver, |
| + public ui::InputMethodObserver { |
| + public: |
| + AccessibilityHighlightManager(); |
| + ~AccessibilityHighlightManager() override; |
| + |
| + void HighlightFocus(bool focus); |
| + void HighlightCursor(bool cursor); |
| + void HighlightCaret(bool caret); |
| + |
| + private: |
| + // ui::EventHandler overrides: |
| + void OnMouseEvent(ui::MouseEvent* event) override; |
| + |
| + // content::NotificationObserver overrides: |
| + void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) override; |
| + |
| + // ui::InputMethodObserver overrides: |
| + void OnTextInputTypeChanged(const ui::TextInputClient* client) override {} |
| + void OnFocus() override {} |
| + void OnBlur() override {} |
| + void OnInputMethodDestroyed(const ui::InputMethod* input_method) override {} |
| + void OnShowImeIfNeeded() override {} |
| + void OnTextInputStateChanged(const ui::TextInputClient* client) override; |
| + void OnCaretBoundsChanged(const ui::TextInputClient* client) override; |
| + |
| + bool focus_ = false; |
| + gfx::Rect focus_rect_; |
| + |
| + bool cursor_ = false; |
| + gfx::Point cursor_point_; |
| + |
| + bool caret_ = false; |
| + gfx::Point caret_point_; |
| + |
| + content::NotificationRegistrar registrar_; |
| +}; |
|
xiyuan
2016/03/21 22:59:31
nit: DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlig
dmazzoni
2016/03/22 04:09:30
Done.
|
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_ |