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

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_notification.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iwyu fixes 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/chromeos/arc/arc_auth_notification.h" 5 #include "chrome/browser/chromeos/arc/arc_auth_notification.h"
6 6
7 #include "ash/system/chromeos/devicetype_utils.h" 7 #include "ash/system/chromeos/devicetype_utils.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/arc/arc_auth_service.h" 10 #include "chrome/browser/chromeos/arc/arc_auth_service.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void ArcAuthNotification::Show() { 88 void ArcAuthNotification::Show() {
89 message_center::NotifierId notifier_id( 89 message_center::NotifierId notifier_id(
90 message_center::NotifierId::SYSTEM_COMPONENT, kNotifierId); 90 message_center::NotifierId::SYSTEM_COMPONENT, kNotifierId);
91 91
92 message_center::RichNotificationData data; 92 message_center::RichNotificationData data;
93 data.buttons.push_back(message_center::ButtonInfo( 93 data.buttons.push_back(message_center::ButtonInfo(
94 l10n_util::GetStringUTF16(IDS_ARC_OPEN_PLAY_STORE_NOTIFICATION_BUTTON))); 94 l10n_util::GetStringUTF16(IDS_ARC_OPEN_PLAY_STORE_NOTIFICATION_BUTTON)));
95 data.buttons.push_back(message_center::ButtonInfo( 95 data.buttons.push_back(message_center::ButtonInfo(
96 l10n_util::GetStringUTF16(IDS_ARC_CANCEL_NOTIFICATION_BUTTON))); 96 l10n_util::GetStringUTF16(IDS_ARC_CANCEL_NOTIFICATION_BUTTON)));
97 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); 97 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance();
98 scoped_ptr<message_center::Notification> notification( 98 std::unique_ptr<message_center::Notification> notification(
99 new message_center::Notification( 99 new message_center::Notification(
100 message_center::NOTIFICATION_TYPE_SIMPLE, kFirstRunNotificationId, 100 message_center::NOTIFICATION_TYPE_SIMPLE, kFirstRunNotificationId,
101 l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_TITLE), 101 l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_TITLE),
102 l10n_util::GetStringFUTF16(IDS_ARC_NOTIFICATION_MESSAGE, 102 l10n_util::GetStringFUTF16(IDS_ARC_NOTIFICATION_MESSAGE,
103 ash::GetChromeOSDeviceName()), 103 ash::GetChromeOSDeviceName()),
104 resource_bundle.GetImageNamed(IDR_ARC_PLAY_STORE_NOTIFICATION), 104 resource_bundle.GetImageNamed(IDR_ARC_PLAY_STORE_NOTIFICATION),
105 base::UTF8ToUTF16(kDisplaySoruce), GURL(), notifier_id, data, 105 base::UTF8ToUTF16(kDisplaySoruce), GURL(), notifier_id, data,
106 new ArcAuthNotificationDelegate())); 106 new ArcAuthNotificationDelegate()));
107 message_center::MessageCenter::Get()->AddNotification( 107 message_center::MessageCenter::Get()->AddNotification(
108 std::move(notification)); 108 std::move(notification));
109 } 109 }
110 110
111 // static 111 // static
112 void ArcAuthNotification::Hide() { 112 void ArcAuthNotification::Hide() {
113 message_center::MessageCenter::Get()->RemoveNotification( 113 message_center::MessageCenter::Get()->RemoveNotification(
114 kFirstRunNotificationId, false); 114 kFirstRunNotificationId, false);
115 } 115 }
116 116
117 } // namespace arc 117 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698