| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |