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