Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 990 } | 990 } |
| 991 | 991 |
| 992 #if defined(OS_CHROMEOS) | 992 #if defined(OS_CHROMEOS) |
| 993 void AddMultiProfilesStrings(content::WebUIDataSource* html_source, | 993 void AddMultiProfilesStrings(content::WebUIDataSource* html_source, |
| 994 Profile* profile) { | 994 Profile* profile) { |
| 995 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 995 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 996 | 996 |
| 997 const user_manager::User* user = | 997 const user_manager::User* user = |
| 998 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 998 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 999 const user_manager::User* primary_user = user_manager->GetPrimaryUser(); | 999 const user_manager::User* primary_user = user_manager->GetPrimaryUser(); |
| 1000 html_source->AddString("primaryUserEmail", | 1000 std::string primary_user_email = primary_user->GetAccountId().GetUserEmail(); |
| 1001 primary_user->GetAccountId().GetUserEmail()); | 1001 html_source->AddString("primaryUserEmail", primary_user_email); |
| 1002 html_source->AddBoolean( | 1002 html_source->AddBoolean( |
| 1003 "isSecondaryUser", | 1003 "isSecondaryUser", |
| 1004 user && user->GetAccountId() != primary_user->GetAccountId()); | 1004 user && user->GetAccountId() != primary_user->GetAccountId()); |
| 1005 html_source->AddString( | |
| 1006 "secondaryUserBannerText", | |
| 1007 l10n_util::GetStringFUTF16(IDS_SETTINGS_SECONDARY_USER_BANNER, | |
| 1008 base::ASCIIToUTF16(primary_user_email))); | |
|
dschuyler
2017/02/11 02:54:56
I believe this will be converted back to UTF8 agai
stevenjb
2017/02/13 18:28:00
It's not UTF8, this is all UTF16.
dschuyler
2017/02/13 21:37:09
Maybe I'm missing something(?). It looks like prim
stevenjb
2017/02/13 21:58:27
While you are not wrong, that seems like something
| |
| 1005 } | 1009 } |
| 1006 #endif | 1010 #endif |
| 1007 | 1011 |
| 1008 void AddOnStartupStrings(content::WebUIDataSource* html_source) { | 1012 void AddOnStartupStrings(content::WebUIDataSource* html_source) { |
| 1009 LocalizedString localized_strings[] = { | 1013 LocalizedString localized_strings[] = { |
| 1010 {"onStartup", IDS_SETTINGS_ON_STARTUP}, | 1014 {"onStartup", IDS_SETTINGS_ON_STARTUP}, |
| 1011 {"onStartupOpenNewTab", IDS_SETTINGS_ON_STARTUP_OPEN_NEW_TAB}, | 1015 {"onStartupOpenNewTab", IDS_SETTINGS_ON_STARTUP_OPEN_NEW_TAB}, |
| 1012 {"onStartupContinue", IDS_SETTINGS_ON_STARTUP_CONTINUE}, | 1016 {"onStartupContinue", IDS_SETTINGS_ON_STARTUP_CONTINUE}, |
| 1013 {"onStartupOpenSpecific", IDS_SETTINGS_ON_STARTUP_OPEN_SPECIFIC}, | 1017 {"onStartupOpenSpecific", IDS_SETTINGS_ON_STARTUP_OPEN_SPECIFIC}, |
| 1014 {"onStartupUseCurrent", IDS_SETTINGS_ON_STARTUP_USE_CURRENT}, | 1018 {"onStartupUseCurrent", IDS_SETTINGS_ON_STARTUP_USE_CURRENT}, |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1908 | 1912 |
| 1909 #if defined(OS_CHROMEOS) | 1913 #if defined(OS_CHROMEOS) |
| 1910 chromeos::network_element::AddLocalizedStrings(html_source); | 1914 chromeos::network_element::AddLocalizedStrings(html_source); |
| 1911 #endif | 1915 #endif |
| 1912 policy_indicator::AddLocalizedStrings(html_source); | 1916 policy_indicator::AddLocalizedStrings(html_source); |
| 1913 | 1917 |
| 1914 html_source->SetJsonPath(kLocalizedStringsFile); | 1918 html_source->SetJsonPath(kLocalizedStringsFile); |
| 1915 } | 1919 } |
| 1916 | 1920 |
| 1917 } // namespace settings | 1921 } // namespace settings |
| OLD | NEW |