OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/session/tray_session_length_limit.h" | 5 #include "ash/system/chromeos/session/tray_session_length_limit.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
oshima
2016/04/08 07:09:41
include?
| |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ash/system/chromeos/label_tray_view.h" | 11 #include "ash/system/chromeos/label_tray_view.h" |
12 #include "ash/system/system_notifier.h" | 12 #include "ash/system/system_notifier.h" |
13 #include "ash/system/tray/system_tray.h" | 13 #include "ash/system/tray/system_tray.h" |
14 #include "ash/system/tray/system_tray_delegate.h" | 14 #include "ash/system/tray/system_tray_delegate.h" |
15 #include "ash/system/tray/system_tray_notifier.h" | 15 #include "ash/system/tray/system_tray_notifier.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "grit/ash_resources.h" | 18 #include "grit/ash_resources.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 // For LIMIT_NONE, there's nothing more to do. | 141 // For LIMIT_NONE, there's nothing more to do. |
142 if (limit_state_ == LIMIT_NONE) { | 142 if (limit_state_ == LIMIT_NONE) { |
143 last_limit_state_ = limit_state_; | 143 last_limit_state_ = limit_state_; |
144 return; | 144 return; |
145 } | 145 } |
146 | 146 |
147 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 147 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
148 message_center::RichNotificationData data; | 148 message_center::RichNotificationData data; |
149 data.should_make_spoken_feedback_for_popup_updates = | 149 data.should_make_spoken_feedback_for_popup_updates = |
150 (limit_state_ != last_limit_state_); | 150 (limit_state_ != last_limit_state_); |
151 scoped_ptr<message_center::Notification> notification( | 151 std::unique_ptr<message_center::Notification> notification( |
152 new message_center::Notification( | 152 new message_center::Notification( |
153 message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId, | 153 message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId, |
154 base::string16() /* title */, | 154 base::string16() /* title */, |
155 ComposeNotificationMessage() /* message */, | 155 ComposeNotificationMessage() /* message */, |
156 bundle.GetImageNamed( | 156 bundle.GetImageNamed( |
157 IDR_AURA_UBER_TRAY_NOTIFICATION_SESSION_LENGTH_LIMIT), | 157 IDR_AURA_UBER_TRAY_NOTIFICATION_SESSION_LENGTH_LIMIT), |
158 base::string16() /* display_source */, GURL(), | 158 base::string16() /* display_source */, GURL(), |
159 message_center::NotifierId( | 159 message_center::NotifierId( |
160 message_center::NotifierId::SYSTEM_COMPONENT, | 160 message_center::NotifierId::SYSTEM_COMPONENT, |
161 system_notifier::kNotifierSessionLengthTimeout), | 161 system_notifier::kNotifierSessionLengthTimeout), |
(...skipping 29 matching lines...) Expand all Loading... | |
191 base::string16 TraySessionLengthLimit::ComposeTrayBubbleMessage() const { | 191 base::string16 TraySessionLengthLimit::ComposeTrayBubbleMessage() const { |
192 return l10n_util::GetStringFUTF16( | 192 return l10n_util::GetStringFUTF16( |
193 IDS_ASH_STATUS_TRAY_BUBBLE_SESSION_LENGTH_LIMIT, | 193 IDS_ASH_STATUS_TRAY_BUBBLE_SESSION_LENGTH_LIMIT, |
194 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, | 194 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, |
195 ui::TimeFormat::LENGTH_LONG, | 195 ui::TimeFormat::LENGTH_LONG, |
196 10, | 196 10, |
197 remaining_session_time_)); | 197 remaining_session_time_)); |
198 } | 198 } |
199 | 199 |
200 } // namespace ash | 200 } // namespace ash |
OLD | NEW |