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

Side by Side Diff: chrome/browser/ui/webui/options2/chromeos/accounts_options_handler2.cc

Issue 9405035: Implement ephemeral users (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comments addressed. Created 8 years, 9 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
OLDNEW
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/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
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()->current_user_is_owner() ? 91 UserManager::Get()->current_user_is_owner() ?
92 ASCIIToUTF16("true") : ASCIIToUTF16("false")); 92 ASCIIToUTF16("true") : ASCIIToUTF16("false"));
93 localized_strings->SetString("current_user_is_ephemeral",
94 UserManager::Get()->current_user_is_ephemeral() ?
95 ASCIIToUTF16("true") : ASCIIToUTF16("false"));
93 localized_strings->SetString("logged_in_as_guest", 96 localized_strings->SetString("logged_in_as_guest",
94 UserManager::Get()->IsLoggedInAsGuest() ? 97 UserManager::Get()->IsLoggedInAsGuest() ?
95 ASCIIToUTF16("true") : ASCIIToUTF16("false")); 98 ASCIIToUTF16("true") : ASCIIToUTF16("false"));
96 localized_strings->SetString("whitelist_is_managed", 99 localized_strings->SetString("whitelist_is_managed",
97 g_browser_process->browser_policy_connector()->IsEnterpriseManaged() ? 100 g_browser_process->browser_policy_connector()->IsEnterpriseManaged() ?
98 ASCIIToUTF16("true") : ASCIIToUTF16("false")); 101 ASCIIToUTF16("true") : ASCIIToUTF16("false"));
99 } 102 }
100 103
101 void AccountsOptionsHandler::HandleWhitelistUser(const base::ListValue* args) { 104 void AccountsOptionsHandler::HandleWhitelistUser(const base::ListValue* args) {
102 std::string typed_email; 105 std::string typed_email;
(...skipping 23 matching lines...) Expand all
126 DCHECK(args && args->empty()); 129 DCHECK(args && args->empty());
127 130
128 const UserList& users = UserManager::Get()->GetUsers(); 131 const UserList& users = UserManager::Get()->GetUsers();
129 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) { 132 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) {
130 WhitelistUser((*it)->email()); 133 WhitelistUser((*it)->email());
131 } 134 }
132 } 135 }
133 136
134 } // namespace options2 137 } // namespace options2
135 } // namespace chromeos 138 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698