OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/options/chromeos/accounts_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 std::string owner_email; | 81 std::string owner_email; |
82 CrosSettings::Get()->GetString(kDeviceOwner, &owner_email); | 82 CrosSettings::Get()->GetString(kDeviceOwner, &owner_email); |
83 // Translate owner's email to the display email. | 83 // Translate owner's email to the display email. |
84 std::string display_email = | 84 std::string display_email = |
85 UserManager::Get()->GetUserDisplayEmail(owner_email); | 85 UserManager::Get()->GetUserDisplayEmail(owner_email); |
86 localized_strings->SetString("owner_user_id", UTF8ToUTF16(display_email)); | 86 localized_strings->SetString("owner_user_id", UTF8ToUTF16(display_email)); |
87 | 87 |
88 localized_strings->SetString("current_user_is_owner", | 88 localized_strings->SetString("current_user_is_owner", |
89 UserManager::Get()->current_user_is_owner() ? | 89 UserManager::Get()->current_user_is_owner() ? |
90 ASCIIToUTF16("true") : ASCIIToUTF16("false")); | 90 ASCIIToUTF16("true") : ASCIIToUTF16("false")); |
| 91 localized_strings->SetString("current_user_is_ephemeral", |
| 92 UserManager::Get()->current_user_is_ephemeral() ? |
| 93 ASCIIToUTF16("true") : ASCIIToUTF16("false")); |
91 localized_strings->SetString("logged_in_as_guest", | 94 localized_strings->SetString("logged_in_as_guest", |
92 UserManager::Get()->IsLoggedInAsGuest() ? | 95 UserManager::Get()->IsLoggedInAsGuest() ? |
93 ASCIIToUTF16("true") : ASCIIToUTF16("false")); | 96 ASCIIToUTF16("true") : ASCIIToUTF16("false")); |
94 localized_strings->SetString("whitelist_is_managed", | 97 localized_strings->SetString("whitelist_is_managed", |
95 g_browser_process->browser_policy_connector()->IsEnterpriseManaged() ? | 98 g_browser_process->browser_policy_connector()->IsEnterpriseManaged() ? |
96 ASCIIToUTF16("true") : ASCIIToUTF16("false")); | 99 ASCIIToUTF16("true") : ASCIIToUTF16("false")); |
97 } | 100 } |
98 | 101 |
99 void AccountsOptionsHandler::HandleWhitelistUser(const base::ListValue* args) { | 102 void AccountsOptionsHandler::HandleWhitelistUser(const base::ListValue* args) { |
100 std::string typed_email; | 103 std::string typed_email; |
(...skipping 22 matching lines...) Expand all Loading... |
123 const base::ListValue* args) { | 126 const base::ListValue* args) { |
124 DCHECK(args && args->empty()); | 127 DCHECK(args && args->empty()); |
125 | 128 |
126 const UserList& users = UserManager::Get()->GetUsers(); | 129 const UserList& users = UserManager::Get()->GetUsers(); |
127 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) { | 130 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) { |
128 WhitelistUser((*it)->email()); | 131 WhitelistUser((*it)->email()); |
129 } | 132 } |
130 } | 133 } |
131 | 134 |
132 } // namespace chromeos | 135 } // namespace chromeos |
OLD | NEW |