OLD | NEW |
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 "chrome/browser/chromeos/file_system_provider/notification_manager.h" | 5 #include "chrome/browser/chromeos/file_system_provider/notification_manager.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/extensions/app_icon_loader_impl.h" | 9 #include "chrome/browser/extensions/app_icon_loader_impl.h" |
10 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 10 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
11 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" |
| 12 #include "components/signin/core/account_id/account_id.h" |
12 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
13 #include "ui/message_center/message_center.h" | 14 #include "ui/message_center/message_center.h" |
14 #include "ui/message_center/notification.h" | 15 #include "ui/message_center/notification.h" |
15 #include "ui/message_center/notification_delegate.h" | 16 #include "ui/message_center/notification_delegate.h" |
16 #include "ui/message_center/notification_types.h" | 17 #include "ui/message_center/notification_types.h" |
17 #include "ui/message_center/notifier_settings.h" | 18 #include "ui/message_center/notifier_settings.h" |
18 | 19 |
19 namespace chromeos { | 20 namespace chromeos { |
20 namespace file_system_provider { | 21 namespace file_system_provider { |
21 namespace { | 22 namespace { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 icon_loader_->FetchImage(file_system_info_.extension_id()); | 112 icon_loader_->FetchImage(file_system_info_.extension_id()); |
112 | 113 |
113 message_center::RichNotificationData rich_notification_data; | 114 message_center::RichNotificationData rich_notification_data; |
114 rich_notification_data.buttons.push_back( | 115 rich_notification_data.buttons.push_back( |
115 message_center::ButtonInfo(l10n_util::GetStringUTF16( | 116 message_center::ButtonInfo(l10n_util::GetStringUTF16( |
116 IDS_FILE_SYSTEM_PROVIDER_UNRESPONSIVE_ABORT_BUTTON))); | 117 IDS_FILE_SYSTEM_PROVIDER_UNRESPONSIVE_ABORT_BUTTON))); |
117 | 118 |
118 message_center::NotifierId notifier_id( | 119 message_center::NotifierId notifier_id( |
119 message_center::NotifierId::SYSTEM_COMPONENT, | 120 message_center::NotifierId::SYSTEM_COMPONENT, |
120 file_system_info_.mount_path().value()); | 121 file_system_info_.mount_path().value()); |
121 notifier_id.profile_id = multi_user_util::GetUserIDFromProfile(profile_); | 122 notifier_id.profile_id = |
| 123 multi_user_util::GetAccountIdFromProfile(profile_).GetUserEmail(); |
122 | 124 |
123 scoped_ptr<message_center::Notification> notification( | 125 scoped_ptr<message_center::Notification> notification( |
124 new message_center::Notification( | 126 new message_center::Notification( |
125 message_center::NOTIFICATION_TYPE_SIMPLE, | 127 message_center::NOTIFICATION_TYPE_SIMPLE, |
126 file_system_info_.mount_path().value(), | 128 file_system_info_.mount_path().value(), |
127 base::UTF8ToUTF16(file_system_info_.display_name()), | 129 base::UTF8ToUTF16(file_system_info_.display_name()), |
128 l10n_util::GetStringUTF16( | 130 l10n_util::GetStringUTF16( |
129 callbacks_.size() == 1 | 131 callbacks_.size() == 1 |
130 ? IDS_FILE_SYSTEM_PROVIDER_UNRESPONSIVE_WARNING | 132 ? IDS_FILE_SYSTEM_PROVIDER_UNRESPONSIVE_WARNING |
131 : IDS_FILE_SYSTEM_PROVIDER_MANY_UNRESPONSIVE_WARNING), | 133 : IDS_FILE_SYSTEM_PROVIDER_MANY_UNRESPONSIVE_WARNING), |
(...skipping 11 matching lines...) Expand all Loading... |
143 while (it != callbacks_.end()) { | 145 while (it != callbacks_.end()) { |
144 CallbackMap::iterator current_it = it++; | 146 CallbackMap::iterator current_it = it++; |
145 NotificationCallback callback = current_it->second; | 147 NotificationCallback callback = current_it->second; |
146 callbacks_.erase(current_it); | 148 callbacks_.erase(current_it); |
147 callback.Run(result); | 149 callback.Run(result); |
148 } | 150 } |
149 } | 151 } |
150 | 152 |
151 } // namespace file_system_provider | 153 } // namespace file_system_provider |
152 } // namespace chromeos | 154 } // namespace chromeos |
OLD | NEW |