| 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/system/chromeos/screen_security/screen_capture_tray_item.h" | 5 #include "ash/system/chromeos/screen_security/screen_capture_tray_item.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/system/system_notifier.h" | 9 #include "ash/common/system/system_notifier.h" |
| 10 #include "ash/common/system/tray/system_tray_notifier.h" | 10 #include "ash/common/system/tray/system_tray_notifier.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 WmShell::Get()->AddShellObserver(this); | 30 WmShell::Get()->AddShellObserver(this); |
| 31 WmShell::Get()->system_tray_notifier()->AddScreenCaptureObserver(this); | 31 WmShell::Get()->system_tray_notifier()->AddScreenCaptureObserver(this); |
| 32 } | 32 } |
| 33 | 33 |
| 34 ScreenCaptureTrayItem::~ScreenCaptureTrayItem() { | 34 ScreenCaptureTrayItem::~ScreenCaptureTrayItem() { |
| 35 WmShell::Get()->RemoveShellObserver(this); | 35 WmShell::Get()->RemoveShellObserver(this); |
| 36 WmShell::Get()->system_tray_notifier()->RemoveScreenCaptureObserver(this); | 36 WmShell::Get()->system_tray_notifier()->RemoveScreenCaptureObserver(this); |
| 37 } | 37 } |
| 38 | 38 |
| 39 views::View* ScreenCaptureTrayItem::CreateTrayView(LoginStatus status) { | 39 views::View* ScreenCaptureTrayItem::CreateTrayView(LoginStatus status) { |
| 40 set_tray_view( | 40 set_tray_view(new tray::ScreenTrayView(this, IDR_AURA_UBER_TRAY_SCREENSHARE)); |
| 41 new tray::ScreenTrayView(this, IDR_AURA_UBER_TRAY_SCREENSHARE)); | |
| 42 return tray_view(); | 41 return tray_view(); |
| 43 } | 42 } |
| 44 | 43 |
| 45 views::View* ScreenCaptureTrayItem::CreateDefaultView(LoginStatus status) { | 44 views::View* ScreenCaptureTrayItem::CreateDefaultView(LoginStatus status) { |
| 46 set_default_view(new tray::ScreenStatusView( | 45 set_default_view(new tray::ScreenStatusView( |
| 47 this, | 46 this, IDR_AURA_UBER_TRAY_SCREENSHARE_DARK, screen_capture_status_, |
| 48 IDR_AURA_UBER_TRAY_SCREENSHARE_DARK, | 47 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); |
| 49 screen_capture_status_, | |
| 50 l10n_util::GetStringUTF16( | |
| 51 IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); | |
| 52 return default_view(); | 48 return default_view(); |
| 53 } | 49 } |
| 54 | 50 |
| 55 void ScreenCaptureTrayItem::CreateOrUpdateNotification() { | 51 void ScreenCaptureTrayItem::CreateOrUpdateNotification() { |
| 56 message_center::RichNotificationData data; | 52 message_center::RichNotificationData data; |
| 57 data.buttons.push_back(message_center::ButtonInfo( | 53 data.buttons.push_back(message_center::ButtonInfo( |
| 58 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); | 54 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); |
| 59 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); | 55 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); |
| 60 std::unique_ptr<Notification> notification(new Notification( | 56 std::unique_ptr<Notification> notification(new Notification( |
| 61 message_center::NOTIFICATION_TYPE_SIMPLE, kScreenCaptureNotificationId, | 57 message_center::NOTIFICATION_TYPE_SIMPLE, kScreenCaptureNotificationId, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // screen capture is stopped externally. | 93 // screen capture is stopped externally. |
| 98 set_is_started(false); | 94 set_is_started(false); |
| 99 Update(); | 95 Update(); |
| 100 } | 96 } |
| 101 | 97 |
| 102 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { | 98 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { |
| 103 is_casting_ = started; | 99 is_casting_ = started; |
| 104 } | 100 } |
| 105 | 101 |
| 106 } // namespace ash | 102 } // namespace ash |
| OLD | NEW |