OLD | NEW |
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 // The ChromeNotifierService works together with sync to maintain the state of | 5 // The ChromeNotifierService works together with sync to maintain the state of |
6 // user notifications, which can then be presented in the notification center, | 6 // user notifications, which can then be presented in the notification center, |
7 // via the Notification UI Manager. | 7 // via the Notification UI Manager. |
8 | 8 |
9 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" | 9 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" |
10 | 10 |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 | 813 |
814 return synced_notification_app_info_service_-> | 814 return synced_notification_app_info_service_-> |
815 FindSyncedNotificationAppInfoByAppId(app_id); | 815 FindSyncedNotificationAppInfoByAppId(app_id); |
816 } | 816 } |
817 | 817 |
818 const Notification ChromeNotifierService::CreateWelcomeNotificationForService( | 818 const Notification ChromeNotifierService::CreateWelcomeNotificationForService( |
819 SyncedNotificationAppInfo* app_info) { | 819 SyncedNotificationAppInfo* app_info) { |
820 std::string welcome_notification_id = base::GenerateGUID(); | 820 std::string welcome_notification_id = base::GenerateGUID(); |
821 message_center::NotifierId notifier_id = app_info->GetNotifierId(); | 821 message_center::NotifierId notifier_id = app_info->GetNotifierId(); |
822 scoped_refptr<WelcomeDelegate> delegate( | 822 scoped_refptr<WelcomeDelegate> delegate( |
823 new WelcomeDelegate(welcome_notification_id, profile_, notifier_id)); | 823 new WelcomeDelegate(welcome_notification_id, |
| 824 profile_, |
| 825 notifier_id, |
| 826 app_info->welcome_link_url())); |
824 | 827 |
825 message_center::ButtonInfo button_info( | 828 message_center::ButtonInfo button_info( |
826 l10n_util::GetStringUTF16(IDS_NOTIFIER_WELCOME_BUTTON)); | 829 l10n_util::GetStringUTF16(IDS_NOTIFIER_WELCOME_BUTTON)); |
827 button_info.icon = ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 830 button_info.icon = ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
828 IDR_NOTIFIER_BLOCK_BUTTON); | 831 IDR_NOTIFIER_BLOCK_BUTTON); |
829 | 832 |
830 message_center::RichNotificationData rich_notification_data; | 833 message_center::RichNotificationData rich_notification_data; |
831 rich_notification_data.buttons.push_back(button_info); | 834 rich_notification_data.buttons.push_back(button_info); |
832 return Notification( | 835 return Notification( |
833 message_center::NOTIFICATION_TYPE_BASE_FORMAT, | 836 message_center::NOTIFICATION_TYPE_BASE_FORMAT, |
834 GURL(kSyncedNotificationsWelcomeOrigin), | 837 GURL(kSyncedNotificationsWelcomeOrigin), |
835 base::UTF8ToUTF16(app_info->settings_display_name()), | 838 base::UTF8ToUTF16(app_info->settings_display_name()), |
836 l10n_util::GetStringUTF16(IDS_NOTIFIER_WELCOME_BODY), | 839 l10n_util::GetStringUTF16(IDS_NOTIFIER_WELCOME_BODY), |
837 app_info->icon(), | 840 app_info->icon(), |
838 blink::WebTextDirectionDefault, | 841 blink::WebTextDirectionDefault, |
839 notifier_id, | 842 notifier_id, |
840 l10n_util::GetStringUTF16(IDS_NOTIFICATION_WELCOME_DISPLAY_SOURCE), | 843 l10n_util::GetStringUTF16(IDS_NOTIFICATION_WELCOME_DISPLAY_SOURCE), |
841 base::UTF8ToUTF16(welcome_notification_id), | 844 base::UTF8ToUTF16(welcome_notification_id), |
842 rich_notification_data, | 845 rich_notification_data, |
843 delegate.get()); | 846 delegate.get()); |
844 } | 847 } |
845 | 848 |
846 } // namespace notifier | 849 } // namespace notifier |
OLD | NEW |