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

Side by Side Diff: chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc

Issue 2471993002: Remove calls to User::email() from chrome/browser/ui/webui/* (Closed)
Patch Set: Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/webui/settings/md_settings_localized_strings_provide r.h" 5 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide r.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/number_formatting.h" 10 #include "base/i18n/number_formatting.h"
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 base::ASCIIToUTF16(chrome::kLanguageSettingsLearnMoreUrl)); 883 base::ASCIIToUTF16(chrome::kLanguageSettingsLearnMoreUrl));
884 } 884 }
885 885
886 #if defined(OS_CHROMEOS) 886 #if defined(OS_CHROMEOS)
887 void AddMultiProfilesStrings(content::WebUIDataSource* html_source, 887 void AddMultiProfilesStrings(content::WebUIDataSource* html_source,
888 Profile* profile) { 888 Profile* profile) {
889 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); 889 user_manager::UserManager* user_manager = user_manager::UserManager::Get();
890 890
891 const user_manager::User* user = 891 const user_manager::User* user =
892 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); 892 chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
893 std::string primary_user_email = user_manager->GetPrimaryUser()->email(); 893 const user_manager::User* primary_user = user_manager->GetPrimaryUser();
894 html_source->AddString("primaryUserEmail", primary_user_email); 894 html_source->AddString("primaryUserEmail",
895 html_source->AddBoolean("isSecondaryUser", 895 primary_user->GetAccountId().GetUserEmail());
896 user && user->email() != primary_user_email); 896 html_source->AddBoolean(
897 "isSecondaryUser",
898 user && user->GetAccountId() != primary_user->GetAccountId());
897 } 899 }
898 #endif 900 #endif
899 901
900 void AddOnStartupStrings(content::WebUIDataSource* html_source) { 902 void AddOnStartupStrings(content::WebUIDataSource* html_source) {
901 LocalizedString localized_strings[] = { 903 LocalizedString localized_strings[] = {
902 {"onStartup", IDS_SETTINGS_ON_STARTUP}, 904 {"onStartup", IDS_SETTINGS_ON_STARTUP},
903 {"onStartupOpenNewTab", IDS_SETTINGS_ON_STARTUP_OPEN_NEW_TAB}, 905 {"onStartupOpenNewTab", IDS_SETTINGS_ON_STARTUP_OPEN_NEW_TAB},
904 {"onStartupContinue", IDS_SETTINGS_ON_STARTUP_CONTINUE}, 906 {"onStartupContinue", IDS_SETTINGS_ON_STARTUP_CONTINUE},
905 {"onStartupOpenSpecific", IDS_SETTINGS_ON_STARTUP_OPEN_SPECIFIC}, 907 {"onStartupOpenSpecific", IDS_SETTINGS_ON_STARTUP_OPEN_SPECIFIC},
906 {"onStartupUseCurrent", IDS_SETTINGS_ON_STARTUP_USE_CURRENT}, 908 {"onStartupUseCurrent", IDS_SETTINGS_ON_STARTUP_USE_CURRENT},
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 #endif 1769 #endif
1768 AddUsersStrings(html_source); 1770 AddUsersStrings(html_source);
1769 AddWebContentStrings(html_source); 1771 AddWebContentStrings(html_source);
1770 1772
1771 policy_indicator::AddLocalizedStrings(html_source); 1773 policy_indicator::AddLocalizedStrings(html_source);
1772 1774
1773 html_source->SetJsonPath(kLocalizedStringsFile); 1775 html_source->SetJsonPath(kLocalizedStringsFile);
1774 } 1776 }
1775 1777
1776 } // namespace settings 1778 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698