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

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

Issue 2687643004: MD Settings: CrOS: Add secondary user banner (Closed)
Patch Set: Rebase Created 3 years, 10 months 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
« no previous file with comments | « chrome/browser/resources/settings/basic_page/basic_page.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)));
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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 1931
1928 #if defined(OS_CHROMEOS) 1932 #if defined(OS_CHROMEOS)
1929 chromeos::network_element::AddLocalizedStrings(html_source); 1933 chromeos::network_element::AddLocalizedStrings(html_source);
1930 #endif 1934 #endif
1931 policy_indicator::AddLocalizedStrings(html_source); 1935 policy_indicator::AddLocalizedStrings(html_source);
1932 1936
1933 html_source->SetJsonPath(kLocalizedStringsFile); 1937 html_source->SetJsonPath(kLocalizedStringsFile);
1934 } 1938 }
1935 1939
1936 } // namespace settings 1940 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/basic_page/basic_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698