| 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/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" |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 17 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 18 #include "chrome/browser/chromeos/settings/cros_settings.h" | 18 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 20 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 21 #include "chrome/grit/generated_resources.h" |
| 21 #include "chromeos/settings/cros_settings_names.h" | 22 #include "chromeos/settings/cros_settings_names.h" |
| 22 #include "components/user_manager/user_manager.h" | 23 #include "components/user_manager/user_manager.h" |
| 23 #include "content/public/browser/web_ui.h" | 24 #include "content/public/browser/web_ui.h" |
| 24 #include "google_apis/gaia/gaia_auth_util.h" | 25 #include "google_apis/gaia/gaia_auth_util.h" |
| 25 #include "grit/generated_resources.h" | |
| 26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 | 27 |
| 28 namespace chromeos { | 28 namespace chromeos { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 // Adds specified user to the whitelist. Returns false if that user is already | 32 // Adds specified user to the whitelist. Returns false if that user is already |
| 33 // in the whitelist. | 33 // in the whitelist. |
| 34 bool WhitelistUser(const std::string& username) { | 34 bool WhitelistUser(const std::string& username) { |
| 35 CrosSettings* cros_settings = CrosSettings::Get(); | 35 CrosSettings* cros_settings = CrosSettings::Get(); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 for (user_manager::UserList::const_iterator it = users.begin(); | 140 for (user_manager::UserList::const_iterator it = users.begin(); |
| 141 it < users.end(); | 141 it < users.end(); |
| 142 ++it) | 142 ++it) |
| 143 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); | 143 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); |
| 144 | 144 |
| 145 cros_settings->Set(kAccountsPrefUsers, *new_list.get()); | 145 cros_settings->Set(kAccountsPrefUsers, *new_list.get()); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace options | 148 } // namespace options |
| 149 } // namespace chromeos | 149 } // namespace chromeos |
| OLD | NEW |