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

Side by Side Diff: chrome/browser/sync/sync_error_notifier_ash.cc

Issue 1428213004: This CL replaces std::string user_id in ash/* with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 5 years, 1 month 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 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/sync/sync_error_notifier_ash.h" 5 #include "chrome/browser/sync/sync_error_notifier_ash.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
9 #include "ash/system/system_notifier.h" 9 #include "ash/system/system_notifier.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/notifications/notification.h" 13 #include "chrome/browser/notifications/notification.h"
14 #include "chrome/browser/notifications/notification_ui_manager.h" 14 #include "chrome/browser/notifications/notification_ui_manager.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 16 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
17 #include "chrome/browser/ui/chrome_pages.h" 17 #include "chrome/browser/ui/chrome_pages.h"
18 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 18 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
19 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 19 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
20 #include "chrome/common/url_constants.h" 20 #include "chrome/common/url_constants.h"
21 #include "chrome/grit/chromium_strings.h" 21 #include "chrome/grit/chromium_strings.h"
22 #include "chrome/grit/generated_resources.h" 22 #include "chrome/grit/generated_resources.h"
23 #include "components/signin/core/account_id/account_id.h"
23 #include "grit/theme_resources.h" 24 #include "grit/theme_resources.h"
24 #include "ui/base/l10n/l10n_util.h" 25 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/base/resource/resource_bundle.h" 26 #include "ui/base/resource/resource_bundle.h"
26 #include "ui/message_center/notification.h" 27 #include "ui/message_center/notification.h"
27 #include "ui/message_center/notification_delegate.h" 28 #include "ui/message_center/notification_delegate.h"
28 29
29 #if defined(OS_CHROMEOS) 30 #if defined(OS_CHROMEOS)
30 #include "chrome/browser/chromeos/login/user_flow.h" 31 #include "chrome/browser/chromeos/login/user_flow.h"
31 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" 32 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
32 #include "components/user_manager/user_manager.h" 33 #include "components/user_manager/user_manager.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 159
159 // Set the delegate for the notification's sync setup button. 160 // Set the delegate for the notification's sync setup button.
160 SyncNotificationDelegate* delegate = 161 SyncNotificationDelegate* delegate =
161 new SyncNotificationDelegate(notification_id_, profile_); 162 new SyncNotificationDelegate(notification_id_, profile_);
162 163
163 message_center::NotifierId notifier_id( 164 message_center::NotifierId notifier_id(
164 message_center::NotifierId::SYSTEM_COMPONENT, 165 message_center::NotifierId::SYSTEM_COMPONENT,
165 kProfileSyncNotificationId); 166 kProfileSyncNotificationId);
166 167
167 // Set |profile_id| for multi-user notification blocker. 168 // Set |profile_id| for multi-user notification blocker.
168 notifier_id.profile_id = multi_user_util::GetUserIDFromProfile(profile_); 169 notifier_id.profile_id =
170 multi_user_util::GetAccountIdFromProfile(profile_).GetUserEmail();
169 171
170 // Add a new notification. 172 // Add a new notification.
171 Notification notification( 173 Notification notification(
172 message_center::NOTIFICATION_TYPE_SIMPLE, 174 message_center::NOTIFICATION_TYPE_SIMPLE,
173 l10n_util::GetStringUTF16(IDS_SYNC_ERROR_BUBBLE_VIEW_TITLE), 175 l10n_util::GetStringUTF16(IDS_SYNC_ERROR_BUBBLE_VIEW_TITLE),
174 l10n_util::GetStringUTF16(IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE), 176 l10n_util::GetStringUTF16(IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE),
175 ui::ResourceBundle::GetSharedInstance().GetImageNamed( 177 ui::ResourceBundle::GetSharedInstance().GetImageNamed(
176 IDR_NOTIFICATION_ALERT), 178 IDR_NOTIFICATION_ALERT),
177 notifier_id, 179 notifier_id,
178 base::string16(), // display_source 180 base::string16(), // display_source
179 GURL(notification_id_), notification_id_, data, delegate); 181 GURL(notification_id_), notification_id_, data, delegate);
180 notification_ui_manager->Add(notification, profile_); 182 notification_ui_manager->Add(notification, profile_);
181 } 183 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_error_notifier_ash.cc ('k') | chrome/browser/ui/ash/chrome_shell_content_state_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698