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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/accessibility/accessibility_highlight_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..38046126b7c595d678e4c35ae45ce8201318492b
--- /dev/null
+++ b/chrome/browser/chromeos/accessibility/accessibility_highlight_manager.h
@@ -0,0 +1,67 @@
+// 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_;
+
+ DISALLOW_COPY_AND_ASSIGN(AccessibilityHighlightManager);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_HIGHLIGHT_MANAGER_H_
« 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