OLD | NEW |
1 // Copyright (c) 2011 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/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" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 IDS_OPTIONS_ACCOUNTS_OWNER_ONLY)); | 79 IDS_OPTIONS_ACCOUNTS_OWNER_ONLY)); |
80 | 80 |
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()->IsCurrentUserOwner() ? |
90 ASCIIToUTF16("true") : ASCIIToUTF16("false")); | 90 ASCIIToUTF16("true") : ASCIIToUTF16("false")); |
91 localized_strings->SetString("logged_in_as_guest", | 91 localized_strings->SetString("logged_in_as_guest", |
92 UserManager::Get()->IsLoggedInAsGuest() ? | 92 UserManager::Get()->IsLoggedInAsGuest() ? |
93 ASCIIToUTF16("true") : ASCIIToUTF16("false")); | 93 ASCIIToUTF16("true") : ASCIIToUTF16("false")); |
94 localized_strings->SetString("whitelist_is_managed", | 94 localized_strings->SetString("whitelist_is_managed", |
95 g_browser_process->browser_policy_connector()->IsEnterpriseManaged() ? | 95 g_browser_process->browser_policy_connector()->IsEnterpriseManaged() ? |
96 ASCIIToUTF16("true") : ASCIIToUTF16("false")); | 96 ASCIIToUTF16("true") : ASCIIToUTF16("false")); |
97 } | 97 } |
98 | 98 |
99 void AccountsOptionsHandler::HandleWhitelistUser(const base::ListValue* args) { | 99 void AccountsOptionsHandler::HandleWhitelistUser(const base::ListValue* args) { |
(...skipping 23 matching lines...) Expand all Loading... |
123 const base::ListValue* args) { | 123 const base::ListValue* args) { |
124 DCHECK(args && args->empty()); | 124 DCHECK(args && args->empty()); |
125 | 125 |
126 const UserList& users = UserManager::Get()->GetUsers(); | 126 const UserList& users = UserManager::Get()->GetUsers(); |
127 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) { | 127 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) { |
128 WhitelistUser((*it)->email()); | 128 WhitelistUser((*it)->email()); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 } // namespace chromeos | 132 } // namespace chromeos |
OLD | NEW |