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

Side by Side Diff: ash/system/chromeos/power/tray_power.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: 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/power/tray_power.h" 5 #include "ash/system/chromeos/power/tray_power.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/accessibility_delegate.h" 9 #include "ash/accessibility_delegate.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 bool TrayPower::MaybeShowUsbChargerNotification() { 215 bool TrayPower::MaybeShowUsbChargerNotification() {
216 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 216 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
217 const PowerStatus& status = *PowerStatus::Get(); 217 const PowerStatus& status = *PowerStatus::Get();
218 218
219 bool usb_charger_is_connected = status.IsUsbChargerConnected(); 219 bool usb_charger_is_connected = status.IsUsbChargerConnected();
220 220
221 // Check for a USB charger being connected. 221 // Check for a USB charger being connected.
222 if (usb_charger_is_connected && !usb_charger_was_connected_ && 222 if (usb_charger_is_connected && !usb_charger_was_connected_ &&
223 !usb_notification_dismissed_) { 223 !usb_notification_dismissed_) {
224 scoped_ptr<Notification> notification(new Notification( 224 std::unique_ptr<Notification> notification(new Notification(
225 message_center::NOTIFICATION_TYPE_SIMPLE, kUsbNotificationId, 225 message_center::NOTIFICATION_TYPE_SIMPLE, kUsbNotificationId,
226 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_LOW_POWER_CHARGER_TITLE), 226 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_LOW_POWER_CHARGER_TITLE),
227 ash::SubstituteChromeOSDeviceType( 227 ash::SubstituteChromeOSDeviceType(
228 IDS_ASH_STATUS_TRAY_LOW_POWER_CHARGER_MESSAGE_SHORT), 228 IDS_ASH_STATUS_TRAY_LOW_POWER_CHARGER_MESSAGE_SHORT),
229 rb.GetImageNamed(IDR_AURA_NOTIFICATION_LOW_POWER_CHARGER), 229 rb.GetImageNamed(IDR_AURA_NOTIFICATION_LOW_POWER_CHARGER),
230 base::string16(), GURL(), 230 base::string16(), GURL(),
231 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, 231 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
232 system_notifier::kNotifierPower), 232 system_notifier::kNotifierPower),
233 message_center::RichNotificationData(), 233 message_center::RichNotificationData(),
234 new UsbNotificationDelegate(this))); 234 new UsbNotificationDelegate(this)));
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 NOTREACHED(); 348 NOTREACHED();
349 return false; 349 return false;
350 } 350 }
351 351
352 void TrayPower::NotifyUsbNotificationClosedByUser() { 352 void TrayPower::NotifyUsbNotificationClosedByUser() {
353 usb_notification_dismissed_ = true; 353 usb_notification_dismissed_ = true;
354 } 354 }
355 355
356 } // namespace ash 356 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698