| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/screen_security/screen_tray_item.h" | 5 #include "ash/common/system/chromeos/screen_security/screen_tray_item.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/shelf/wm_shelf_util.h" | 8 #include "ash/common/shelf/wm_shelf_util.h" |
| 9 #include "ash/common/system/tray/fixed_sized_image_view.h" | 9 #include "ash/common/system/tray/fixed_sized_image_view.h" |
| 10 #include "ash/common/system/tray/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 icon_->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK) | 94 icon_->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK) |
| 95 .ToImageSkia()); | 95 .ToImageSkia()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 label_ = TrayPopupUtils::CreateDefaultLabel(); | 98 label_ = TrayPopupUtils::CreateDefaultLabel(); |
| 99 label_->SetMultiLine(true); | 99 label_->SetMultiLine(true); |
| 100 label_->SetText(label_text_); | 100 label_->SetText(label_text_); |
| 101 // TODO(bruthig): Multiline Labels don't lay out well with borders. | 101 // TODO(bruthig): Multiline Labels don't lay out well with borders. |
| 102 // See https://crbug.com/678337 & https://crbug.com/682221. | 102 // See https://crbug.com/678337 & https://crbug.com/682221. |
| 103 label_->SetBorder(nullptr); | 103 label_->SetBorder(nullptr); |
| 104 TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL); |
| 105 style.SetupLabel(label_); |
| 104 | 106 |
| 105 stop_button_ = TrayPopupUtils::CreateTrayPopupButton(this, stop_button_text_); | 107 stop_button_ = TrayPopupUtils::CreateTrayPopupButton(this, stop_button_text_); |
| 106 } | 108 } |
| 107 | 109 |
| 108 void ScreenStatusView::UpdateFromScreenTrayItem() { | 110 void ScreenStatusView::UpdateFromScreenTrayItem() { |
| 109 // Hide the notification bubble when the ash tray bubble opens. | 111 // Hide the notification bubble when the ash tray bubble opens. |
| 110 screen_tray_item_->HideNotificationView(); | 112 screen_tray_item_->HideNotificationView(); |
| 111 SetVisible(screen_tray_item_->is_started()); | 113 SetVisible(screen_tray_item_->is_started()); |
| 112 } | 114 } |
| 113 | 115 |
| 114 void ScreenStatusView::OnNativeThemeChanged(const ui::NativeTheme* theme) { | |
| 115 if (!MaterialDesignController::IsSystemTrayMenuMaterial()) { | |
| 116 views::View::OnNativeThemeChanged(theme); | |
| 117 return; | |
| 118 } | |
| 119 | |
| 120 if (theme) { | |
| 121 TrayPopupItemStyle style(theme, | |
| 122 TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL); | |
| 123 style.SetupLabel(label_); | |
| 124 } | |
| 125 } | |
| 126 | |
| 127 ScreenNotificationDelegate::ScreenNotificationDelegate( | 116 ScreenNotificationDelegate::ScreenNotificationDelegate( |
| 128 ScreenTrayItem* screen_tray) | 117 ScreenTrayItem* screen_tray) |
| 129 : screen_tray_(screen_tray) {} | 118 : screen_tray_(screen_tray) {} |
| 130 | 119 |
| 131 ScreenNotificationDelegate::~ScreenNotificationDelegate() {} | 120 ScreenNotificationDelegate::~ScreenNotificationDelegate() {} |
| 132 | 121 |
| 133 void ScreenNotificationDelegate::ButtonClick(int button_index) { | 122 void ScreenNotificationDelegate::ButtonClick(int button_index) { |
| 134 DCHECK_EQ(0, button_index); | 123 DCHECK_EQ(0, button_index); |
| 135 screen_tray_->Stop(); | 124 screen_tray_->Stop(); |
| 136 screen_tray_->RecordStoppedFromNotificationViewMetric(); | 125 screen_tray_->RecordStoppedFromNotificationViewMetric(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 188 |
| 200 void ScreenTrayItem::DestroyTrayView() { | 189 void ScreenTrayItem::DestroyTrayView() { |
| 201 tray_view_ = nullptr; | 190 tray_view_ = nullptr; |
| 202 } | 191 } |
| 203 | 192 |
| 204 void ScreenTrayItem::DestroyDefaultView() { | 193 void ScreenTrayItem::DestroyDefaultView() { |
| 205 default_view_ = nullptr; | 194 default_view_ = nullptr; |
| 206 } | 195 } |
| 207 | 196 |
| 208 } // namespace ash | 197 } // namespace ash |
| OLD | NEW |