| 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/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/system/tray/fixed_sized_image_view.h" | 8 #include "ash/common/system/tray/fixed_sized_image_view.h" |
| 9 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
| 10 #include "ash/common/system/tray/tray_popup_utils.h" | 10 #include "ash/common/system/tray/tray_popup_utils.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 AddChildView(tri_view_); | 198 AddChildView(tri_view_); |
| 199 | 199 |
| 200 left_icon_ = TrayPopupUtils::CreateMainImageView(); | 200 left_icon_ = TrayPopupUtils::CreateMainImageView(); |
| 201 left_icon_->SetImage(image); | 201 left_icon_->SetImage(image); |
| 202 left_icon_->SetEnabled(enabled()); | 202 left_icon_->SetEnabled(enabled()); |
| 203 tri_view_->AddView(TriView::Container::START, left_icon_); | 203 tri_view_->AddView(TriView::Container::START, left_icon_); |
| 204 | 204 |
| 205 text_label_ = TrayPopupUtils::CreateDefaultLabel(); | 205 text_label_ = TrayPopupUtils::CreateDefaultLabel(); |
| 206 text_label_->SetText(text); | 206 text_label_->SetText(text); |
| 207 text_label_->SetEnabled(enabled()); | 207 text_label_->SetEnabled(enabled()); |
| 208 TrayPopupItemStyle style(GetNativeTheme(), font_style); | 208 TrayPopupItemStyle style(font_style); |
| 209 style.SetupLabel(text_label_); | 209 style.SetupLabel(text_label_); |
| 210 | 210 |
| 211 tri_view_->AddView(TriView::Container::CENTER, text_label_); | 211 tri_view_->AddView(TriView::Container::CENTER, text_label_); |
| 212 if (!sub_text.empty()) { | 212 if (!sub_text.empty()) { |
| 213 sub_text_label_ = TrayPopupUtils::CreateDefaultLabel(); | 213 sub_text_label_ = TrayPopupUtils::CreateDefaultLabel(); |
| 214 sub_text_label_->SetText(sub_text); | 214 sub_text_label_->SetText(sub_text); |
| 215 TrayPopupItemStyle sub_style(GetNativeTheme(), | 215 TrayPopupItemStyle sub_style(TrayPopupItemStyle::FontStyle::CAPTION); |
| 216 TrayPopupItemStyle::FontStyle::CAPTION); | |
| 217 sub_style.set_color_style(TrayPopupItemStyle::ColorStyle::INACTIVE); | 216 sub_style.set_color_style(TrayPopupItemStyle::ColorStyle::INACTIVE); |
| 218 sub_style.SetupLabel(sub_text_label_); | 217 sub_style.SetupLabel(sub_text_label_); |
| 219 tri_view_->AddView(TriView::Container::CENTER, sub_text_label_); | 218 tri_view_->AddView(TriView::Container::CENTER, sub_text_label_); |
| 220 } | 219 } |
| 221 | 220 |
| 222 tri_view_->SetContainerVisible(TriView::Container::END, false); | 221 tri_view_->SetContainerVisible(TriView::Container::END, false); |
| 223 | 222 |
| 224 SetAccessibleName(text); | 223 SetAccessibleName(text); |
| 225 } | 224 } |
| 226 | 225 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { | 428 void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) { |
| 430 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); | 429 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); |
| 431 } | 430 } |
| 432 | 431 |
| 433 void HoverHighlightView::OnFocus() { | 432 void HoverHighlightView::OnFocus() { |
| 434 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); | 433 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); |
| 435 ActionableView::OnFocus(); | 434 ActionableView::OnFocus(); |
| 436 } | 435 } |
| 437 | 436 |
| 438 } // namespace ash | 437 } // namespace ash |
| OLD | NEW |