Chromium Code Reviews| 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/common/system/tray/hover_highlight_view.h" | 5 #include "ash/common/system/tray/hover_highlight_view.h" |
| 6 | 6 |
| 7 #include "ash/common/system/tray/fixed_sized_image_view.h" | 7 #include "ash/common/system/tray/fixed_sized_image_view.h" |
| 8 #include "ash/common/system/tray/tray_constants.h" | 8 #include "ash/common/system/tray/tray_constants.h" |
| 9 #include "ash/common/system/tray/view_click_listener.h" | 9 #include "ash/common/system/tray/view_click_listener.h" |
| 10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 if (tooltip_.empty()) | 45 if (tooltip_.empty()) |
| 46 return false; | 46 return false; |
| 47 *tooltip = tooltip_; | 47 *tooltip = tooltip_; |
| 48 return true; | 48 return true; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void HoverHighlightView::AddRightIcon(const gfx::ImageSkia& image) { | 51 void HoverHighlightView::AddRightIcon(const gfx::ImageSkia& image) { |
| 52 DCHECK(box_layout_); | 52 DCHECK(box_layout_); |
| 53 DCHECK(!right_icon_); | 53 DCHECK(!right_icon_); |
| 54 | 54 |
| 55 right_icon_ = new FixedSizedImageView(kTrayPopupDetailsIconWidth, 0); | 55 right_icon_ = new views::ImageView(); |
| 56 right_icon_->SetImageSize( | |
| 57 gfx::Size(kTrayPopupDetailsIconWidth, kTrayPopupDetailsIconWidth)); | |
|
stevenjb
2016/07/21 20:32:05
Is this not a problem for other FixedSizedImageVie
jdufault
2016/07/22 21:44:58
From my current understanding, FixedSizedImageView
stevenjb
2016/07/22 21:50:40
Fair enough, I just wanted to make sure we had tho
| |
| 56 right_icon_->SetImage(image); | 58 right_icon_->SetImage(image); |
| 57 right_icon_->SetEnabled(enabled()); | 59 right_icon_->SetEnabled(enabled()); |
| 58 AddChildView(right_icon_); | 60 AddChildView(right_icon_); |
| 59 } | 61 } |
| 60 | 62 |
| 61 void HoverHighlightView::SetRightIconVisible(bool visible) { | 63 void HoverHighlightView::SetRightIconVisible(bool visible) { |
| 62 if (!right_icon_) | 64 if (!right_icon_) |
| 63 return; | 65 return; |
| 64 | 66 |
| 65 right_icon_->SetVisible(visible); | 67 right_icon_->SetVisible(visible); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 263 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { | 265 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { |
| 264 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); | 266 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); |
| 265 } | 267 } |
| 266 | 268 |
| 267 void HoverHighlightView::OnFocus() { | 269 void HoverHighlightView::OnFocus() { |
| 268 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); | 270 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); |
| 269 ActionableView::OnFocus(); | 271 ActionableView::OnFocus(); |
| 270 } | 272 } |
| 271 | 273 |
| 272 } // namespace ash | 274 } // namespace ash |
| OLD | NEW |