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_share_tray_item.h" | 5 #include "ash/system/chromeos/screen_security/screen_share_tray_item.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/system_notifier.h" | 8 #include "ash/system/system_notifier.h" |
9 #include "grit/ash_resources.h" | 9 #include "grit/ash_resources.h" |
10 #include "grit/ash_strings.h" | 10 #include "grit/ash_strings.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } else { | 59 } else { |
60 help_label_text = l10n_util::GetStringUTF16( | 60 help_label_text = l10n_util::GetStringUTF16( |
61 IDS_ASH_STATUS_TRAY_SCREEN_SHARE_BEING_HELPED); | 61 IDS_ASH_STATUS_TRAY_SCREEN_SHARE_BEING_HELPED); |
62 } | 62 } |
63 | 63 |
64 message_center::RichNotificationData data; | 64 message_center::RichNotificationData data; |
65 data.buttons.push_back(message_center::ButtonInfo( | 65 data.buttons.push_back(message_center::ButtonInfo( |
66 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_STOP))); | 66 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_STOP))); |
67 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); | 67 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); |
68 scoped_ptr<Notification> notification(new Notification( | 68 scoped_ptr<Notification> notification(new Notification( |
69 message_center::NOTIFICATION_TYPE_SIMPLE, | 69 message_center::NOTIFICATION_TYPE_SIMPLE, kScreenShareNotificationId, |
70 kScreenShareNotificationId, | 70 help_label_text, base::string16() /* body is blank */, |
71 help_label_text, | |
72 base::string16() /* body is blank */, | |
73 resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK), | 71 resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK), |
74 base::string16() /* display_source */, | 72 base::string16() /* display_source */, GURL(), |
75 message_center::NotifierId( | 73 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
76 message_center::NotifierId::SYSTEM_COMPONENT, | 74 system_notifier::kNotifierScreenShare), |
77 system_notifier::kNotifierScreenShare), | 75 data, new tray::ScreenNotificationDelegate(this))); |
78 data, | |
79 new tray::ScreenNotificationDelegate(this))); | |
80 notification->SetSystemPriority(); | 76 notification->SetSystemPriority(); |
81 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 77 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); |
82 } | 78 } |
83 | 79 |
84 std::string ScreenShareTrayItem::GetNotificationId() { | 80 std::string ScreenShareTrayItem::GetNotificationId() { |
85 return kScreenShareNotificationId; | 81 return kScreenShareNotificationId; |
86 } | 82 } |
87 | 83 |
88 void ScreenShareTrayItem::OnScreenShareStart( | 84 void ScreenShareTrayItem::OnScreenShareStart( |
89 const base::Closure& stop_callback, | 85 const base::Closure& stop_callback, |
90 const base::string16& helper_name) { | 86 const base::string16& helper_name) { |
91 helper_name_ = helper_name; | 87 helper_name_ = helper_name; |
92 Start(stop_callback); | 88 Start(stop_callback); |
93 } | 89 } |
94 | 90 |
95 void ScreenShareTrayItem::OnScreenShareStop() { | 91 void ScreenShareTrayItem::OnScreenShareStop() { |
96 // We do not need to run the stop callback | 92 // We do not need to run the stop callback |
97 // when screening is stopped externally. | 93 // when screening is stopped externally. |
98 set_is_started(false); | 94 set_is_started(false); |
99 Update(); | 95 Update(); |
100 } | 96 } |
101 | 97 |
102 } // namespace ash | 98 } // namespace ash |
OLD | NEW |