| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_update.h" | 5 #include "ash/system/tray_update.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
| 9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
| 10 #include "ash/system/tray/tray_views.h" | 10 #include "ash/system/tray/tray_views.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 30 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| 31 views::ImageView* image = | 31 views::ImageView* image = |
| 32 new ash::internal::FixedSizedImageView(0, ash::kTrayPopupItemHeight); | 32 new ash::internal::FixedSizedImageView(0, ash::kTrayPopupItemHeight); |
| 33 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_UPDATE_DARK). | 33 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_UPDATE_DARK). |
| 34 ToSkBitmap()); | 34 ToSkBitmap()); |
| 35 | 35 |
| 36 AddChildView(image); | 36 AddChildView(image); |
| 37 AddChildView(new views::Label( | 37 AddChildView(new views::Label( |
| 38 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE))); | 38 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE))); |
| 39 SetAccessibleName(bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE)); |
| 39 } | 40 } |
| 40 | 41 |
| 41 virtual ~UpdateView() {} | 42 virtual ~UpdateView() {} |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 // Overridden from ActionableView. | 45 // Overridden from ActionableView. |
| 45 virtual bool PerformAction(const views::Event& event) OVERRIDE { | 46 virtual bool PerformAction(const views::Event& event) OVERRIDE { |
| 46 ash::Shell::GetInstance()->tray_delegate()->RequestRestart(); | 47 ash::Shell::GetInstance()->tray_delegate()->RequestRestart(); |
| 47 return true; | 48 return true; |
| 48 } | 49 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 75 void TrayUpdate::DestroyDefaultView() { | 76 void TrayUpdate::DestroyDefaultView() { |
| 76 default_.reset(); | 77 default_.reset(); |
| 77 } | 78 } |
| 78 | 79 |
| 79 void TrayUpdate::OnUpdateRecommended() { | 80 void TrayUpdate::OnUpdateRecommended() { |
| 80 image_view()->SetVisible(true); | 81 image_view()->SetVisible(true); |
| 81 } | 82 } |
| 82 | 83 |
| 83 } // namespace internal | 84 } // namespace internal |
| 84 } // namespace ash | 85 } // namespace ash |
| OLD | NEW |