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

Unified Diff: chrome/browser/ui/webui/options/supervised_user_import_handler.cc

Issue 384023002: Rename "managed (mode|user)" to "supervised user" (part 6) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: break long lines Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/supervised_user_import_handler.cc
diff --git a/chrome/browser/ui/webui/options/managed_user_import_handler.cc b/chrome/browser/ui/webui/options/supervised_user_import_handler.cc
similarity index 86%
rename from chrome/browser/ui/webui/options/managed_user_import_handler.cc
rename to chrome/browser/ui/webui/options/supervised_user_import_handler.cc
index 8455c971683db0130ae616a93d56d8a2c959be12..b4793eb7cb909f01cb34f5188819b05a44babf34 100644
--- a/chrome/browser/ui/webui/options/managed_user_import_handler.cc
+++ b/chrome/browser/ui/webui/options/supervised_user_import_handler.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/webui/options/managed_user_import_handler.h"
+#include "chrome/browser/ui/webui/options/supervised_user_import_handler.h"
#include <set>
@@ -47,11 +47,11 @@ scoped_ptr<base::ListValue> GetAvatarIcons() {
namespace options {
-ManagedUserImportHandler::ManagedUserImportHandler()
+SupervisedUserImportHandler::SupervisedUserImportHandler()
: observer_(this),
weak_ptr_factory_(this) {}
-ManagedUserImportHandler::~ManagedUserImportHandler() {
+SupervisedUserImportHandler::~SupervisedUserImportHandler() {
Profile* profile = Profile::FromWebUI(web_ui());
if (!profile->IsSupervised()) {
SupervisedUserSyncService* service =
@@ -62,7 +62,7 @@ ManagedUserImportHandler::~ManagedUserImportHandler() {
}
}
-void ManagedUserImportHandler::GetLocalizedValues(
+void SupervisedUserImportHandler::GetLocalizedValues(
base::DictionaryValue* localized_strings) {
DCHECK(localized_strings);
@@ -86,7 +86,7 @@ void ManagedUserImportHandler::GetLocalizedValues(
localized_strings->Set("avatarIcons", GetAvatarIcons().release());
}
-void ManagedUserImportHandler::InitializeHandler() {
+void SupervisedUserImportHandler::InitializeHandler() {
Profile* profile = Profile::FromWebUI(web_ui());
if (!profile->IsSupervised()) {
SupervisedUserSyncService* sync_service =
@@ -99,7 +99,7 @@ void ManagedUserImportHandler::InitializeHandler() {
SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
profile);
subscription_ = settings_service->Subscribe(
- base::Bind(&ManagedUserImportHandler::OnSharedSettingChanged,
+ base::Bind(&SupervisedUserImportHandler::OnSharedSettingChanged,
weak_ptr_factory_.GetWeakPtr()));
} else {
DCHECK(!SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
@@ -109,41 +109,42 @@ void ManagedUserImportHandler::InitializeHandler() {
}
}
-void ManagedUserImportHandler::RegisterMessages() {
+void SupervisedUserImportHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("requestManagedUserImportUpdate",
- base::Bind(&ManagedUserImportHandler::RequestManagedUserImportUpdate,
+ base::Bind(&SupervisedUserImportHandler::
+ RequestSupervisedUserImportUpdate,
base::Unretained(this)));
}
-void ManagedUserImportHandler::OnSupervisedUsersChanged() {
- FetchManagedUsers();
+void SupervisedUserImportHandler::OnSupervisedUsersChanged() {
+ FetchSupervisedUsers();
}
-void ManagedUserImportHandler::FetchManagedUsers() {
+void SupervisedUserImportHandler::FetchSupervisedUsers() {
web_ui()->CallJavascriptFunction("options.ManagedUserListData.resetPromise");
- RequestManagedUserImportUpdate(NULL);
+ RequestSupervisedUserImportUpdate(NULL);
}
-void ManagedUserImportHandler::RequestManagedUserImportUpdate(
+void SupervisedUserImportHandler::RequestSupervisedUserImportUpdate(
const base::ListValue* /* args */) {
if (Profile::FromWebUI(web_ui())->IsSupervised())
return;
if (!IsAccountConnected() || HasAuthError()) {
- ClearManagedUsersAndShowError();
+ ClearSupervisedUsersAndShowError();
} else {
SupervisedUserSyncService* supervised_user_sync_service =
SupervisedUserSyncServiceFactory::GetForProfile(
Profile::FromWebUI(web_ui()));
if (supervised_user_sync_service) {
supervised_user_sync_service->GetSupervisedUsersAsync(
- base::Bind(&ManagedUserImportHandler::SendExistingManagedUsers,
+ base::Bind(&SupervisedUserImportHandler::SendExistingSupervisedUsers,
weak_ptr_factory_.GetWeakPtr()));
}
}
}
-void ManagedUserImportHandler::SendExistingManagedUsers(
+void SupervisedUserImportHandler::SendExistingSupervisedUsers(
const base::DictionaryValue* dict) {
DCHECK(dict);
const ProfileInfoCache& cache =
@@ -208,18 +209,18 @@ void ManagedUserImportHandler::SendExistingManagedUsers(
supervised_users);
}
-void ManagedUserImportHandler::ClearManagedUsersAndShowError() {
+void SupervisedUserImportHandler::ClearSupervisedUsersAndShowError() {
web_ui()->CallJavascriptFunction("options.ManagedUserListData.onSigninError");
}
-bool ManagedUserImportHandler::IsAccountConnected() const {
+bool SupervisedUserImportHandler::IsAccountConnected() const {
Profile* profile = Profile::FromWebUI(web_ui());
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(profile);
return signin_manager && !signin_manager->GetAuthenticatedUsername().empty();
}
-bool ManagedUserImportHandler::HasAuthError() const {
+bool SupervisedUserImportHandler::HasAuthError() const {
Profile* profile = Profile::FromWebUI(web_ui());
ProfileOAuth2TokenService* token_service =
ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
@@ -237,15 +238,15 @@ bool ManagedUserImportHandler::HasAuthError() const {
state == GoogleServiceAuthError::ACCOUNT_DISABLED;
}
-void ManagedUserImportHandler::OnSharedSettingChanged(
+void SupervisedUserImportHandler::OnSharedSettingChanged(
const std::string& supervised_user_id,
const std::string& key) {
if (key == supervised_users::kChromeAvatarIndex)
- FetchManagedUsers();
+ FetchSupervisedUsers();
}
-void ManagedUserImportHandler::OnErrorChanged() {
- FetchManagedUsers();
+void SupervisedUserImportHandler::OnErrorChanged() {
+ FetchSupervisedUsers();
}
} // namespace options

Powered by Google App Engine
This is Rietveld 408576698