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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { | 234 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { |
235 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); | 235 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); |
236 } | 236 } |
237 | 237 |
238 void HoverHighlightView::OnFocus() { | 238 void HoverHighlightView::OnFocus() { |
239 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); | 239 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); |
240 ActionableView::OnFocus(); | 240 ActionableView::OnFocus(); |
241 } | 241 } |
242 | 242 |
| 243 bool HoverHighlightView::GetTooltipText(const gfx::Point& p, |
| 244 base::string16* tooltip) const { |
| 245 if (tooltip_.length()) { |
| 246 *tooltip = tooltip_; |
| 247 return true; |
| 248 } else { |
| 249 return false; |
| 250 } |
| 251 } |
| 252 |
| 253 void HoverHighlightView::SetTooltipText(const base::string16& tooltip) { |
| 254 tooltip_ = tooltip; |
| 255 } |
| 256 |
243 } // namespace ash | 257 } // namespace ash |
OLD | NEW |