Commit 96a8f1b9 authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

webui/UserManagerScreenHandler: Remove ScreenLock implementation.

This UI surface is non-CrOS only and the ScreenLock functionality is
only function for CrOS, so this is essentially dead code.

R=khorimoto@chromium.org

Bug: none
Test: none
Change-Id: If612764c9e668c225d8d83062fe495186cbdeb61
Reviewed-on: https://chromium-review.googlesource.com/962667
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avataranthonyvd <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543198}
parent ccc27875
...@@ -303,83 +303,7 @@ UserManagerScreenHandler::UserManagerScreenHandler() : weak_ptr_factory_(this) { ...@@ -303,83 +303,7 @@ UserManagerScreenHandler::UserManagerScreenHandler() : weak_ptr_factory_(this) {
} }
} }
UserManagerScreenHandler::~UserManagerScreenHandler() { UserManagerScreenHandler::~UserManagerScreenHandler() {}
proximity_auth::ScreenlockBridge::Get()->SetLockHandler(NULL);
}
void UserManagerScreenHandler::ShowBannerMessage(
const base::string16& message) {
web_ui()->CallJavascriptFunctionUnsafe(
"login.AccountPickerScreen.showBannerMessage", base::Value(message));
}
void UserManagerScreenHandler::ShowUserPodCustomIcon(
const AccountId& account_id,
const proximity_auth::ScreenlockBridge::UserPodCustomIconOptions&
icon_options) {
std::unique_ptr<base::DictionaryValue> icon =
icon_options.ToDictionaryValue();
if (!icon || icon->empty())
return;
web_ui()->CallJavascriptFunctionUnsafe(
"login.AccountPickerScreen.showUserPodCustomIcon",
base::Value(account_id.GetUserEmail()), *icon);
}
void UserManagerScreenHandler::HideUserPodCustomIcon(
const AccountId& account_id) {
web_ui()->CallJavascriptFunctionUnsafe(
"login.AccountPickerScreen.hideUserPodCustomIcon",
base::Value(account_id.GetUserEmail()));
}
void UserManagerScreenHandler::EnableInput() {
// Nothing here because UI is not disabled when starting to authenticate.
}
void UserManagerScreenHandler::SetAuthType(
const AccountId& account_id,
proximity_auth::mojom::AuthType auth_type,
const base::string16& auth_value) {
if (GetAuthType(account_id) ==
proximity_auth::mojom::AuthType::FORCE_OFFLINE_PASSWORD) {
return;
}
user_auth_type_map_[account_id.GetUserEmail()] = auth_type;
web_ui()->CallJavascriptFunctionUnsafe(
"login.AccountPickerScreen.setAuthType",
base::Value(account_id.GetUserEmail()),
base::Value(static_cast<int>(auth_type)), base::Value(auth_value));
}
proximity_auth::mojom::AuthType UserManagerScreenHandler::GetAuthType(
const AccountId& account_id) const {
const auto it = user_auth_type_map_.find(account_id.GetUserEmail());
if (it == user_auth_type_map_.end())
return proximity_auth::mojom::AuthType::OFFLINE_PASSWORD;
return it->second;
}
proximity_auth::ScreenlockBridge::LockHandler::ScreenType
UserManagerScreenHandler::GetScreenType() const {
return proximity_auth::ScreenlockBridge::LockHandler::LOCK_SCREEN;
}
void UserManagerScreenHandler::Unlock(const AccountId& account_id) {
const base::FilePath path = profiles::GetPathOfProfileWithEmail(
g_browser_process->profile_manager(), account_id.GetUserEmail());
if (!path.empty()) {
authenticating_profile_path_ = path;
ReportAuthenticationResult(true, ProfileMetrics::AUTH_LOCAL);
}
}
void UserManagerScreenHandler::AttemptEasySignin(const AccountId& account_id,
const std::string& secret,
const std::string& key_label) {
NOTREACHED();
}
void UserManagerScreenHandler::HandleInitialize(const base::ListValue* args) { void UserManagerScreenHandler::HandleInitialize(const base::ListValue* args) {
// If the URL has a hash parameter, store it for later. // If the URL has a hash parameter, store it for later.
...@@ -389,8 +313,6 @@ void UserManagerScreenHandler::HandleInitialize(const base::ListValue* args) { ...@@ -389,8 +313,6 @@ void UserManagerScreenHandler::HandleInitialize(const base::ListValue* args) {
web_ui()->CallJavascriptFunctionUnsafe( web_ui()->CallJavascriptFunctionUnsafe(
"cr.ui.UserManager.showUserManagerScreen", "cr.ui.UserManager.showUserManagerScreen",
base::Value(IsGuestModeEnabled()), base::Value(IsAddPersonEnabled())); base::Value(IsGuestModeEnabled()), base::Value(IsAddPersonEnabled()));
proximity_auth::ScreenlockBridge::Get()->SetLockHandler(this);
} }
void UserManagerScreenHandler::HandleAuthenticatedLaunchUser( void UserManagerScreenHandler::HandleAuthenticatedLaunchUser(
...@@ -586,10 +508,6 @@ void UserManagerScreenHandler::HandleHardlockUserPod( ...@@ -586,10 +508,6 @@ void UserManagerScreenHandler::HandleHardlockUserPod(
std::string email; std::string email;
CHECK(args->GetString(0, &email)); CHECK(args->GetString(0, &email));
const AccountId account_id = AccountId::FromUserEmail(email); const AccountId account_id = AccountId::FromUserEmail(email);
SetAuthType(account_id,
proximity_auth::mojom::AuthType::FORCE_OFFLINE_PASSWORD,
base::string16());
HideUserPodCustomIcon(account_id);
} }
void UserManagerScreenHandler::HandleRemoveUserWarningLoadStats( void UserManagerScreenHandler::HandleRemoveUserWarningLoadStats(
...@@ -862,7 +780,6 @@ void UserManagerScreenHandler::SendUserList() { ...@@ -862,7 +780,6 @@ void UserManagerScreenHandler::SendUserList() {
std::vector<ProfileAttributesEntry*> entries = std::vector<ProfileAttributesEntry*> entries =
g_browser_process->profile_manager()->GetProfileAttributesStorage(). g_browser_process->profile_manager()->GetProfileAttributesStorage().
GetAllProfilesAttributesSortedByName(); GetAllProfilesAttributesSortedByName();
user_auth_type_map_.clear();
for (const ProfileAttributesEntry* entry : entries) { for (const ProfileAttributesEntry* entry : entries) {
// Don't show profiles still in the middle of being set up as new legacy // Don't show profiles still in the middle of being set up as new legacy
......
...@@ -17,13 +17,11 @@ ...@@ -17,13 +17,11 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_metrics.h" #include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/profiles/profile_statistics.h" #include "chrome/browser/profiles/profile_statistics.h"
#include "components/proximity_auth/screenlock_bridge.h"
#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_ui_message_handler.h" #include "content/public/browser/web_ui_message_handler.h"
#include "google_apis/gaia/gaia_oauth_client.h" #include "google_apis/gaia/gaia_oauth_client.h"
class AccountId;
class Browser; class Browser;
namespace base { namespace base {
...@@ -47,7 +45,6 @@ enum AuthenticatedLaunchUserEvent { ...@@ -47,7 +45,6 @@ enum AuthenticatedLaunchUserEvent {
class UserManagerScreenHandler class UserManagerScreenHandler
: public content::WebUIMessageHandler, : public content::WebUIMessageHandler,
public proximity_auth::ScreenlockBridge::LockHandler,
public gaia::GaiaOAuthClient::Delegate, public gaia::GaiaOAuthClient::Delegate,
public content::NotificationObserver { public content::NotificationObserver {
public: public:
...@@ -69,25 +66,6 @@ class UserManagerScreenHandler ...@@ -69,25 +66,6 @@ class UserManagerScreenHandler
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) override; const content::NotificationDetails& details) override;
// proximity_auth::ScreenlockBridge::LockHandler implementation.
void ShowBannerMessage(const base::string16& message) override;
void ShowUserPodCustomIcon(
const AccountId& account_id,
const proximity_auth::ScreenlockBridge::UserPodCustomIconOptions&
icon_options) override;
void HideUserPodCustomIcon(const AccountId& account_id) override;
void EnableInput() override;
void SetAuthType(const AccountId& account_id,
proximity_auth::mojom::AuthType auth_type,
const base::string16& auth_value) override;
proximity_auth::mojom::AuthType GetAuthType(
const AccountId& account_id) const override;
ScreenType GetScreenType() const override;
void Unlock(const AccountId& account_id) override;
void AttemptEasySignin(const AccountId& account_id,
const std::string& secret,
const std::string& key_label) override;
void HandleInitialize(const base::ListValue* args); void HandleInitialize(const base::ListValue* args);
void HandleAuthenticatedLaunchUser(const base::ListValue* args); void HandleAuthenticatedLaunchUser(const base::ListValue* args);
void HandleLaunchGuest(const base::ListValue* args); void HandleLaunchGuest(const base::ListValue* args);
...@@ -143,10 +121,6 @@ class UserManagerScreenHandler ...@@ -143,10 +121,6 @@ class UserManagerScreenHandler
// URL hash, used to key post-profile actions if present. // URL hash, used to key post-profile actions if present.
std::string url_hash_; std::string url_hash_;
typedef std::map<std::string, proximity_auth::mojom::AuthType>
UserAuthTypeMap;
UserAuthTypeMap user_auth_type_map_;
content::NotificationRegistrar registrar_; content::NotificationRegistrar registrar_;
// The CancelableTaskTracker is currently used by GetProfileStatistics // The CancelableTaskTracker is currently used by GetProfileStatistics
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment