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/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/system_notifier.h" | 10 #include "ash/system/system_notifier.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 l10n_util::GetStringUTF16( | 52 l10n_util::GetStringUTF16( |
53 IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); | 53 IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); |
54 return default_view(); | 54 return default_view(); |
55 } | 55 } |
56 | 56 |
57 void ScreenCaptureTrayItem::CreateOrUpdateNotification() { | 57 void ScreenCaptureTrayItem::CreateOrUpdateNotification() { |
58 message_center::RichNotificationData data; | 58 message_center::RichNotificationData data; |
59 data.buttons.push_back(message_center::ButtonInfo( | 59 data.buttons.push_back(message_center::ButtonInfo( |
60 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); | 60 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_CAPTURE_STOP))); |
61 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); | 61 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); |
62 scoped_ptr<Notification> notification(new Notification( | 62 std::unique_ptr<Notification> notification(new Notification( |
63 message_center::NOTIFICATION_TYPE_SIMPLE, kScreenCaptureNotificationId, | 63 message_center::NOTIFICATION_TYPE_SIMPLE, kScreenCaptureNotificationId, |
64 screen_capture_status_, base::string16() /* body is blank */, | 64 screen_capture_status_, base::string16() /* body is blank */, |
65 resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK), | 65 resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK), |
66 base::string16() /* display_source */, GURL(), | 66 base::string16() /* display_source */, GURL(), |
67 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 67 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
68 system_notifier::kNotifierScreenCapture), | 68 system_notifier::kNotifierScreenCapture), |
69 data, new tray::ScreenNotificationDelegate(this))); | 69 data, new tray::ScreenNotificationDelegate(this))); |
70 notification->SetSystemPriority(); | 70 notification->SetSystemPriority(); |
71 message_center::MessageCenter::Get()->AddNotification( | 71 message_center::MessageCenter::Get()->AddNotification( |
72 std::move(notification)); | 72 std::move(notification)); |
(...skipping 26 matching lines...) Expand all Loading... |
99 // screen capture is stopped externally. | 99 // screen capture is stopped externally. |
100 set_is_started(false); | 100 set_is_started(false); |
101 Update(); | 101 Update(); |
102 } | 102 } |
103 | 103 |
104 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { | 104 void ScreenCaptureTrayItem::OnCastingSessionStartedOrStopped(bool started) { |
105 is_casting_ = started; | 105 is_casting_ = started; |
106 } | 106 } |
107 | 107 |
108 } // namespace ash | 108 } // namespace ash |
OLD | NEW |