Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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 UI_VIEWS_CONTROLS_FOCUS_RING_H_ | 5 #ifndef UI_VIEWS_CONTROLS_FOCUS_RING_H_ |
| 6 #define UI_VIEWS_CONTROLS_FOCUS_RING_H_ | 6 #define UI_VIEWS_CONTROLS_FOCUS_RING_H_ |
| 7 | 7 |
| 8 #include "base/optional.h" | |
| 9 #include "ui/native_theme/native_theme.h" | |
| 8 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
| 9 | 11 |
| 10 namespace views { | 12 namespace views { |
| 11 | 13 |
| 12 // FocusRing is a View that is designed to act as an indicator of focus for its | 14 // FocusRing is a View that is designed to act as an indicator of focus for its |
| 13 // parent. It is a stand-alone view that paints to a layer which extends beyond | 15 // parent. It is a stand-alone view that paints to a layer which extends beyond |
| 14 // the bounds of its parent view. | 16 // the bounds of its parent view. |
| 15 class FocusRing : public View { | 17 class FocusRing : public View { |
| 16 public: | 18 public: |
| 19 static const char kViewClassName[]; | |
| 20 | |
| 17 // Create a FocusRing and adds it to |parent|. | 21 // Create a FocusRing and adds it to |parent|. |
| 18 static void Install(views::View* parent); | 22 static void Install(views::View* parent); |
| 19 | 23 |
| 20 // Removes the FocusRing from |parent|. | 24 // Removes the FocusRing from |parent|. |
| 21 static void Uninstall(views::View* parent); | 25 static void Uninstall(views::View* parent); |
| 22 | 26 |
| 27 // FIXME | |
|
sky
2016/10/11 23:59:18
?
Evan Stade
2016/10/12 00:36:38
oops, supposed to be a note to myself to add docs.
| |
| 28 static void SetColorId( | |
|
sky
2016/10/11 23:59:18
WDYT of making the override_color_id an optional p
Evan Stade
2016/10/12 00:36:38
sure, done. I got rid of base::Optional because it
| |
| 29 views::View* parent, | |
| 30 const base::Optional<ui::NativeTheme::ColorId>& override_color_id); | |
| 31 | |
| 23 // View: | 32 // View: |
| 24 const char* GetClassName() const override; | 33 const char* GetClassName() const override; |
| 25 bool CanProcessEventsWithinSubtree() const override; | 34 bool CanProcessEventsWithinSubtree() const override; |
| 26 void Layout() override; | 35 void Layout() override; |
| 27 void OnPaint(gfx::Canvas* canvas) override; | 36 void OnPaint(gfx::Canvas* canvas) override; |
| 28 | 37 |
| 29 private: | 38 private: |
| 30 static const char kViewClassName[]; | |
| 31 | |
| 32 FocusRing(); | 39 FocusRing(); |
| 33 ~FocusRing() override; | 40 ~FocusRing() override; |
| 34 | 41 |
| 42 base::Optional<ui::NativeTheme::ColorId> override_color_id_; | |
| 43 | |
| 35 DISALLOW_COPY_AND_ASSIGN(FocusRing); | 44 DISALLOW_COPY_AND_ASSIGN(FocusRing); |
| 36 }; | 45 }; |
| 37 | 46 |
| 38 } // views | 47 } // views |
| 39 | 48 |
| 40 #endif // UI_VIEWS_CONTROLS_FOCUS_RING_H_ | 49 #endif // UI_VIEWS_CONTROLS_FOCUS_RING_H_ |
| OLD | NEW |