| Index: ash/common/system/tray/tray_notification_view.cc
|
| diff --git a/ash/common/system/tray/tray_notification_view.cc b/ash/common/system/tray/tray_notification_view.cc
|
| index f6a16a8a49257fbda4c8ba0e88e987c5fa33a18c..da1a89870d41415216f389fded3497074a51950d 100644
|
| --- a/ash/common/system/tray/tray_notification_view.cc
|
| +++ b/ash/common/system/tray/tray_notification_view.cc
|
| @@ -29,8 +29,6 @@ const gfx::VectorIcon& ResourceIdToVectorIcon(int resource_id) {
|
| switch (resource_id) {
|
| case IDR_AURA_UBER_TRAY_ACCESSIBILITY_DARK:
|
| return kSystemMenuAccessibilityIcon;
|
| - case IDR_AURA_UBER_TRAY_SMS:
|
| - return kSystemMenuSmsIcon;
|
| default:
|
| NOTREACHED();
|
| break;
|
| @@ -41,8 +39,8 @@ const gfx::VectorIcon& ResourceIdToVectorIcon(int resource_id) {
|
|
|
| } // namespace
|
|
|
| -TrayNotificationView::TrayNotificationView(SystemTrayItem* owner, int icon_id)
|
| - : owner_(owner), icon_id_(icon_id), icon_(NULL), autoclose_delay_(0) {}
|
| +TrayNotificationView::TrayNotificationView(int icon_id)
|
| + : icon_id_(icon_id), icon_(NULL) {}
|
|
|
| TrayNotificationView::~TrayNotificationView() {}
|
|
|
| @@ -52,12 +50,11 @@ void TrayNotificationView::InitView(views::View* contents) {
|
| views::GridLayout* layout = new views::GridLayout(this);
|
| SetLayoutManager(layout);
|
|
|
| - views::ImageButton* close_button = new views::ImageButton(this);
|
| + views::ImageView* close_button = new views::ImageView();
|
| close_button->SetImage(
|
| - views::CustomButton::STATE_NORMAL,
|
| ResourceBundle::GetSharedInstance().GetImageSkiaNamed(IDR_MESSAGE_CLOSE));
|
| - close_button->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
|
| - views::ImageButton::ALIGN_MIDDLE);
|
| + close_button->SetHorizontalAlignment(views::ImageView::CENTER);
|
| + close_button->SetVerticalAlignment(views::ImageView::CENTER);
|
|
|
| icon_ = new views::ImageView;
|
| if (icon_id_ != 0) {
|
| @@ -105,68 +102,4 @@ void TrayNotificationView::InitView(views::View* contents) {
|
| layout->AddPaddingRow(0, kTrayPopupPaddingBetweenItems);
|
| }
|
|
|
| -void TrayNotificationView::UpdateView(views::View* new_contents) {
|
| - RemoveAllChildViews(true);
|
| - InitView(new_contents);
|
| - Layout();
|
| - PreferredSizeChanged();
|
| - SchedulePaint();
|
| -}
|
| -
|
| -void TrayNotificationView::StartAutoCloseTimer(int seconds) {
|
| - autoclose_.Stop();
|
| - autoclose_delay_ = seconds;
|
| - if (autoclose_delay_) {
|
| - autoclose_.Start(FROM_HERE, base::TimeDelta::FromSeconds(autoclose_delay_),
|
| - this, &TrayNotificationView::HandleClose);
|
| - }
|
| -}
|
| -
|
| -void TrayNotificationView::StopAutoCloseTimer() {
|
| - autoclose_.Stop();
|
| -}
|
| -
|
| -void TrayNotificationView::RestartAutoCloseTimer() {
|
| - if (autoclose_delay_)
|
| - StartAutoCloseTimer(autoclose_delay_);
|
| -}
|
| -
|
| -void TrayNotificationView::ButtonPressed(views::Button* sender,
|
| - const ui::Event& event) {
|
| - HandleClose();
|
| -}
|
| -
|
| -bool TrayNotificationView::OnMousePressed(const ui::MouseEvent& event) {
|
| - HandleClickAction();
|
| - return true;
|
| -}
|
| -
|
| -void TrayNotificationView::OnGestureEvent(ui::GestureEvent* event) {
|
| - SlideOutView::OnGestureEvent(event);
|
| - if (event->handled())
|
| - return;
|
| - if (event->type() != ui::ET_GESTURE_TAP)
|
| - return;
|
| - HandleClickAction();
|
| - event->SetHandled();
|
| -}
|
| -
|
| -void TrayNotificationView::OnClose() {}
|
| -
|
| -void TrayNotificationView::OnClickAction() {}
|
| -
|
| -void TrayNotificationView::OnSlideOut() {
|
| - owner_->HideNotificationView();
|
| -}
|
| -
|
| -void TrayNotificationView::HandleClose() {
|
| - OnClose();
|
| - owner_->HideNotificationView();
|
| -}
|
| -
|
| -void TrayNotificationView::HandleClickAction() {
|
| - HandleClose();
|
| - OnClickAction();
|
| -}
|
| -
|
| } // namespace ash
|
|
|