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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc

Issue 144983002: Fixed chrome://settings/accounts availability for MP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added browsertest. Created 6 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 | Annotate | Revision Log
OLDNEW
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/options/chromeos/accounts_options_handler.h" 5 #include "chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 localized_strings->SetString("add_users", l10n_util::GetStringUTF16( 81 localized_strings->SetString("add_users", l10n_util::GetStringUTF16(
82 IDS_OPTIONS_ACCOUNTS_ADD_USERS)); 82 IDS_OPTIONS_ACCOUNTS_ADD_USERS));
83 localized_strings->SetString("owner_only", l10n_util::GetStringUTF16( 83 localized_strings->SetString("owner_only", l10n_util::GetStringUTF16(
84 IDS_OPTIONS_ACCOUNTS_OWNER_ONLY)); 84 IDS_OPTIONS_ACCOUNTS_OWNER_ONLY));
85 85
86 policy::BrowserPolicyConnectorChromeOS* connector = 86 policy::BrowserPolicyConnectorChromeOS* connector =
87 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 87 g_browser_process->platform_part()->browser_policy_connector_chromeos();
88 localized_strings->SetBoolean("whitelist_is_managed", 88 localized_strings->SetBoolean("whitelist_is_managed",
89 connector->IsEnterpriseManaged()); 89 connector->IsEnterpriseManaged());
90 90
91 AddAccountUITweaksLocalizedValues(localized_strings); 91 AddAccountUITweaksLocalizedValues(localized_strings,
92 Profile::FromWebUI(web_ui()));
92 } 93 }
93 94
94 void AccountsOptionsHandler::HandleWhitelistUser(const base::ListValue* args) { 95 void AccountsOptionsHandler::HandleWhitelistUser(const base::ListValue* args) {
95 std::string typed_email; 96 std::string typed_email;
96 std::string name; 97 std::string name;
97 if (!args->GetString(0, &typed_email) || 98 if (!args->GetString(0, &typed_email) ||
98 !args->GetString(1, &name)) { 99 !args->GetString(1, &name)) {
99 return; 100 return;
100 } 101 }
101 102
(...skipping 30 matching lines...) Expand all
132 133
133 const UserList& users = UserManager::Get()->GetUsers(); 134 const UserList& users = UserManager::Get()->GetUsers();
134 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) 135 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it)
135 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); 136 new_list->AppendIfNotPresent(new base::StringValue((*it)->email()));
136 137
137 cros_settings->Set(kAccountsPrefUsers, *new_list.get()); 138 cros_settings->Set(kAccountsPrefUsers, *new_list.get());
138 } 139 }
139 140
140 } // namespace options 141 } // namespace options
141 } // namespace chromeos 142 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698