Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Side by Side Diff: ash/system/chromeos/session/tray_session_length_limit.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory>
8 #include <utility> 9 #include <utility>
9 10
10 #include "ash/shell.h" 11 #include "ash/shell.h"
11 #include "ash/system/chromeos/label_tray_view.h" 12 #include "ash/system/chromeos/label_tray_view.h"
12 #include "ash/system/system_notifier.h" 13 #include "ash/system/system_notifier.h"
13 #include "ash/system/tray/system_tray.h" 14 #include "ash/system/tray/system_tray.h"
14 #include "ash/system/tray/system_tray_delegate.h" 15 #include "ash/system/tray/system_tray_delegate.h"
15 #include "ash/system/tray/system_tray_notifier.h" 16 #include "ash/system/tray/system_tray_notifier.h"
16 #include "base/logging.h" 17 #include "base/logging.h"
17 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // For LIMIT_NONE, there's nothing more to do. 142 // For LIMIT_NONE, there's nothing more to do.
142 if (limit_state_ == LIMIT_NONE) { 143 if (limit_state_ == LIMIT_NONE) {
143 last_limit_state_ = limit_state_; 144 last_limit_state_ = limit_state_;
144 return; 145 return;
145 } 146 }
146 147
147 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 148 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
148 message_center::RichNotificationData data; 149 message_center::RichNotificationData data;
149 data.should_make_spoken_feedback_for_popup_updates = 150 data.should_make_spoken_feedback_for_popup_updates =
150 (limit_state_ != last_limit_state_); 151 (limit_state_ != last_limit_state_);
151 scoped_ptr<message_center::Notification> notification( 152 std::unique_ptr<message_center::Notification> notification(
152 new message_center::Notification( 153 new message_center::Notification(
153 message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId, 154 message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId,
154 base::string16() /* title */, 155 base::string16() /* title */,
155 ComposeNotificationMessage() /* message */, 156 ComposeNotificationMessage() /* message */,
156 bundle.GetImageNamed( 157 bundle.GetImageNamed(
157 IDR_AURA_UBER_TRAY_NOTIFICATION_SESSION_LENGTH_LIMIT), 158 IDR_AURA_UBER_TRAY_NOTIFICATION_SESSION_LENGTH_LIMIT),
158 base::string16() /* display_source */, GURL(), 159 base::string16() /* display_source */, GURL(),
159 message_center::NotifierId( 160 message_center::NotifierId(
160 message_center::NotifierId::SYSTEM_COMPONENT, 161 message_center::NotifierId::SYSTEM_COMPONENT,
161 system_notifier::kNotifierSessionLengthTimeout), 162 system_notifier::kNotifierSessionLengthTimeout),
(...skipping 29 matching lines...) Expand all
191 base::string16 TraySessionLengthLimit::ComposeTrayBubbleMessage() const { 192 base::string16 TraySessionLengthLimit::ComposeTrayBubbleMessage() const {
192 return l10n_util::GetStringFUTF16( 193 return l10n_util::GetStringFUTF16(
193 IDS_ASH_STATUS_TRAY_BUBBLE_SESSION_LENGTH_LIMIT, 194 IDS_ASH_STATUS_TRAY_BUBBLE_SESSION_LENGTH_LIMIT,
194 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, 195 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION,
195 ui::TimeFormat::LENGTH_LONG, 196 ui::TimeFormat::LENGTH_LONG,
196 10, 197 10,
197 remaining_session_time_)); 198 remaining_session_time_));
198 } 199 }
199 200
200 } // namespace ash 201 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/session/tray_session_length_limit.h ('k') | ash/system/chromeos/supervised/tray_supervised_user.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698