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

Unified Diff: ui/views/controls/focus_ring.h

Issue 2383243002: Refactor MdFocusRing to make it easier to reuse on other controls. (Closed)
Patch Set: install Created 4 years, 2 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 | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/controls/focus_ring.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/focus_ring.h
diff --git a/ui/views/controls/focus_ring.h b/ui/views/controls/focus_ring.h
new file mode 100644
index 0000000000000000000000000000000000000000..2438bc7b9dd5f215359deddab148669cc2f798a6
--- /dev/null
+++ b/ui/views/controls/focus_ring.h
@@ -0,0 +1,40 @@
+// Copyright 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 UI_VIEWS_CONTROLS_FOCUS_RING_H_
+#define UI_VIEWS_CONTROLS_FOCUS_RING_H_
+
+#include "ui/views/view.h"
+
+namespace views {
+
+// FocusRing is a View that is designed to act as an indicator of focus for its
+// parent. It is a stand-alone view that paints to a layer which extends beyond
+// the bounds of its parent view.
+class FocusRing : public View {
+ public:
+ // Create a FocusRing and adds it to |parent|.
+ static void Install(views::View* parent);
+
+ // Removes the FocusRing from |parent|.
+ static void Uninstall(views::View* parent);
+
+ // View:
+ const char* GetClassName() const override;
+ bool CanProcessEventsWithinSubtree() const override;
+ void Layout() override;
+ void OnPaint(gfx::Canvas* canvas) override;
+
+ private:
+ static const char kViewClassName[];
+
+ FocusRing();
+ ~FocusRing() override;
+
+ DISALLOW_COPY_AND_ASSIGN(FocusRing);
+};
+
+} // views
+
+#endif // UI_VIEWS_CONTROLS_FOCUS_RING_H_
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/controls/focus_ring.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698