| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "ash/system/tray/hover_highlight_view.h" | 5 #include "ash/system/tray/hover_highlight_view.h" |
| 6 | 6 |
| 7 #include "ash/system/tray/fixed_sized_image_view.h" | 7 #include "ash/system/tray/fixed_sized_image_view.h" |
| 8 #include "ash/system/tray/tray_constants.h" | 8 #include "ash/system/tray/tray_constants.h" |
| 9 #include "ash/system/tray/view_click_listener.h" | 9 #include "ash/system/tray/view_click_listener.h" |
| 10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { | 190 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { |
| 191 SetHoverHighlight(true); | 191 SetHoverHighlight(true); |
| 192 } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL || | 192 } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL || |
| 193 event->type() == ui::ET_GESTURE_TAP) { | 193 event->type() == ui::ET_GESTURE_TAP) { |
| 194 SetHoverHighlight(false); | 194 SetHoverHighlight(false); |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 ActionableView::OnGestureEvent(event); | 197 ActionableView::OnGestureEvent(event); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void HoverHighlightView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 201 SetHoverHighlight(IsMouseHovered()); |
| 202 } |
| 203 |
| 200 void HoverHighlightView::OnEnabledChanged() { | 204 void HoverHighlightView::OnEnabledChanged() { |
| 201 for (int i = 0; i < child_count(); ++i) | 205 for (int i = 0; i < child_count(); ++i) |
| 202 child_at(i)->SetEnabled(enabled()); | 206 child_at(i)->SetEnabled(enabled()); |
| 203 } | 207 } |
| 204 | 208 |
| 205 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { | 209 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { |
| 206 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); | 210 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); |
| 207 } | 211 } |
| 208 | 212 |
| 209 void HoverHighlightView::OnFocus() { | 213 void HoverHighlightView::OnFocus() { |
| 210 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); | 214 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); |
| 211 ActionableView::OnFocus(); | 215 ActionableView::OnFocus(); |
| 212 } | 216 } |
| 213 | 217 |
| 214 } // namespace ash | 218 } // namespace ash |
| OLD | NEW |