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 <utility> |
| 8 |
7 #include "ash/shell.h" | 9 #include "ash/shell.h" |
8 #include "ash/system/system_notifier.h" | 10 #include "ash/system/system_notifier.h" |
9 #include "grit/ash_resources.h" | 11 #include "grit/ash_resources.h" |
10 #include "grit/ash_strings.h" | 12 #include "grit/ash_strings.h" |
11 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
12 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
13 #include "ui/message_center/message_center.h" | 15 #include "ui/message_center/message_center.h" |
14 #include "ui/message_center/notification.h" | 16 #include "ui/message_center/notification.h" |
15 | 17 |
16 using message_center::Notification; | 18 using message_center::Notification; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); | 69 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); |
68 scoped_ptr<Notification> notification(new Notification( | 70 scoped_ptr<Notification> notification(new Notification( |
69 message_center::NOTIFICATION_TYPE_SIMPLE, kScreenShareNotificationId, | 71 message_center::NOTIFICATION_TYPE_SIMPLE, kScreenShareNotificationId, |
70 help_label_text, base::string16() /* body is blank */, | 72 help_label_text, base::string16() /* body is blank */, |
71 resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK), | 73 resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK), |
72 base::string16() /* display_source */, GURL(), | 74 base::string16() /* display_source */, GURL(), |
73 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 75 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
74 system_notifier::kNotifierScreenShare), | 76 system_notifier::kNotifierScreenShare), |
75 data, new tray::ScreenNotificationDelegate(this))); | 77 data, new tray::ScreenNotificationDelegate(this))); |
76 notification->SetSystemPriority(); | 78 notification->SetSystemPriority(); |
77 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 79 message_center::MessageCenter::Get()->AddNotification( |
| 80 std::move(notification)); |
78 } | 81 } |
79 | 82 |
80 std::string ScreenShareTrayItem::GetNotificationId() { | 83 std::string ScreenShareTrayItem::GetNotificationId() { |
81 return kScreenShareNotificationId; | 84 return kScreenShareNotificationId; |
82 } | 85 } |
83 | 86 |
84 void ScreenShareTrayItem::OnScreenShareStart( | 87 void ScreenShareTrayItem::OnScreenShareStart( |
85 const base::Closure& stop_callback, | 88 const base::Closure& stop_callback, |
86 const base::string16& helper_name) { | 89 const base::string16& helper_name) { |
87 helper_name_ = helper_name; | 90 helper_name_ = helper_name; |
88 Start(stop_callback); | 91 Start(stop_callback); |
89 } | 92 } |
90 | 93 |
91 void ScreenShareTrayItem::OnScreenShareStop() { | 94 void ScreenShareTrayItem::OnScreenShareStop() { |
92 // We do not need to run the stop callback | 95 // We do not need to run the stop callback |
93 // when screening is stopped externally. | 96 // when screening is stopped externally. |
94 set_is_started(false); | 97 set_is_started(false); |
95 Update(); | 98 Update(); |
96 } | 99 } |
97 | 100 |
98 } // namespace ash | 101 } // namespace ash |
OLD | NEW |