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

Unified Diff: ash/system/tray/tray_views.cc

Issue 10086005: ash: Show better focus rects for the tray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « ash/system/tray/tray_views.h ('k') | ash/system/user/tray_user.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_views.cc
diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc
index c09b5747e94e97812a1cdf871b3b2cf25ebb0164..e2f1afdcc7a18047649acaa64c1be81b2ccbd430 100644
--- a/ash/system/tray/tray_views.cc
+++ b/ash/system/tray/tray_views.cc
@@ -65,6 +65,13 @@ bool ActionableView::OnMousePressed(const views::MouseEvent& event) {
return PerformAction(event);
}
+void ActionableView::OnPaintFocusBorder(gfx::Canvas* canvas) {
+ if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
+ canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3),
+ kFocusBorderColor);
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
// HoverHighlightView
@@ -176,6 +183,27 @@ void FixedSizedScrollView::OnPaintFocusBorder(gfx::Canvas* canvas) {
// Do not paint the focus border.
}
+////////////////////////////////////////////////////////////////////////////////
+// AccessibleSlider
+
+AccessibleSlider::AccessibleSlider(views::SliderListener* listener,
+ views::Slider::Orientation orientation)
+ : views::Slider(listener, orientation) {
+ // Add enough padding on all sides to make sure the focus border does not
+ // overlap the slider.
+ set_border(views::Border::CreateEmptyBorder(3, 3, 3, 3));
+}
+
+AccessibleSlider::~AccessibleSlider() {
+}
+
+void AccessibleSlider::OnPaintFocusBorder(gfx::Canvas* canvas) {
+ if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
Ben Goodger (Google) 2012/04/13 15:26:29 Can you just add this to views::Slider?
sadrul 2012/04/13 15:48:36 Done (add Slider::set_focus_color so it can easily
+ canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3),
+ kFocusBorderColor);
+ }
+}
+
views::View* CreateDetailedHeaderEntry(int string_id,
ViewClickListener* listener) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
« no previous file with comments | « ash/system/tray/tray_views.h ('k') | ash/system/user/tray_user.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698