Commit 0fbbb42c authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

cros: Rename browser-side login types from *Views to *Mojo.

Also rename UserSelectionScreenProxy to UserBoardViewMojo.

The backend is a mojo client; the browser-side code should not know
that the implementation is in views.

Bug: 784495
Change-Id: I1f3933e7191a9be8f1d73720a27c747391763737
Reviewed-on: https://chromium-review.googlesource.com/1008843
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550458}
parent 3688c603
......@@ -1148,12 +1148,12 @@ source_set("chromeos") {
"login/ui/login_display_host.h",
"login/ui/login_display_host_common.cc",
"login/ui/login_display_host_common.h",
"login/ui/login_display_host_views.cc",
"login/ui/login_display_host_views.h",
"login/ui/login_display_host_mojo.cc",
"login/ui/login_display_host_mojo.h",
"login/ui/login_display_host_webui.cc",
"login/ui/login_display_host_webui.h",
"login/ui/login_display_views.cc",
"login/ui/login_display_views.h",
"login/ui/login_display_mojo.cc",
"login/ui/login_display_mojo.h",
"login/ui/login_display_webui.cc",
"login/ui/login_display_webui.h",
"login/ui/login_feedback.cc",
......@@ -1175,10 +1175,10 @@ source_set("chromeos") {
"login/ui/web_contents_forced_title.h",
"login/ui/webui_login_view.cc",
"login/ui/webui_login_view.h",
"login/user_board_view_mojo.cc",
"login/user_board_view_mojo.h",
"login/user_flow.cc",
"login/user_flow.h",
"login/user_selection_screen_proxy.cc",
"login/user_selection_screen_proxy.h",
"login/users/affiliation.cc",
"login/users/affiliation.h",
"login/users/avatar/user_image_loader.cc",
......
......@@ -20,7 +20,7 @@
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h"
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h"
#include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h"
#include "chrome/browser/chromeos/login/user_selection_screen_proxy.h"
#include "chrome/browser/chromeos/login/user_board_view_mojo.h"
#include "chrome/browser/chromeos/system/system_clock.h"
#include "chrome/browser/ui/ash/session_controller_client.h"
#include "chrome/browser/ui/ash/wallpaper_controller_client.h"
......@@ -46,10 +46,10 @@ ViewsScreenLocker::ViewsScreenLocker(ScreenLocker* screen_locker)
version_info_updater_(this),
weak_factory_(this) {
LoginScreenClient::Get()->SetDelegate(this);
user_selection_screen_proxy_ = std::make_unique<UserSelectionScreenProxy>();
user_board_view_mojo_ = std::make_unique<UserBoardViewMojo>();
user_selection_screen_ =
std::make_unique<ChromeUserSelectionScreen>(kLockDisplay);
user_selection_screen_->SetView(user_selection_screen_proxy_.get());
user_selection_screen_->SetView(user_board_view_mojo_.get());
allowed_input_methods_subscription_ =
CrosSettings::Get()->AddSettingsObserver(
......
......@@ -15,8 +15,8 @@
namespace chromeos {
class UserBoardViewMojo;
class UserSelectionScreen;
class UserSelectionScreenProxy;
// ViewsScreenLocker acts like LoginScreenClient::Delegate which handles method
// calls coming from ash into chrome.
......@@ -87,7 +87,7 @@ class ViewsScreenLocker : public LoginScreenClient::Delegate,
void OnAllowedInputMethodsChanged();
void OnDevChannelInfoUpdated();
std::unique_ptr<UserSelectionScreenProxy> user_selection_screen_proxy_;
std::unique_ptr<UserBoardViewMojo> user_board_view_mojo_;
std::unique_ptr<UserSelectionScreen> user_selection_screen_;
// The ScreenLocker that owns this instance.
......
......@@ -5,7 +5,7 @@
#include "chrome/browser/chromeos/login/ui/gaia_dialog_delegate.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_views.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_mojo.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
#include "chrome/browser/ui/ash/ash_util.h"
......@@ -29,7 +29,7 @@ constexpr int kGaiaDialogWidth = 768;
} // namespace
GaiaDialogDelegate::GaiaDialogDelegate(
base::WeakPtr<LoginDisplayHostViews> controller)
base::WeakPtr<LoginDisplayHostMojo> controller)
: controller_(controller),
size_(gfx::Size(kGaiaDialogWidth, kGaiaDialogHeight)) {}
......
......@@ -23,7 +23,7 @@ class Widget;
namespace chromeos {
class LoginDisplayHostViews;
class LoginDisplayHostMojo;
class OobeUI;
// This class manages the behavior of the gaia signin dialog.
......@@ -35,7 +35,7 @@ class OobeUI;
// clientView---->Widget's view hierarchy
class GaiaDialogDelegate : public ui::WebDialogDelegate {
public:
explicit GaiaDialogDelegate(base::WeakPtr<LoginDisplayHostViews> controller);
explicit GaiaDialogDelegate(base::WeakPtr<LoginDisplayHostMojo> controller);
~GaiaDialogDelegate() override;
// Show the dialog widget.
......@@ -74,7 +74,7 @@ class GaiaDialogDelegate : public ui::WebDialogDelegate {
std::vector<ui::Accelerator> GetAccelerators() override;
bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
base::WeakPtr<LoginDisplayHostViews> controller_;
base::WeakPtr<LoginDisplayHostMojo> controller_;
// This is owned by the underlying native widget.
// Before its deletion, onDialogClosed will get called and delete this object.
......
......@@ -35,14 +35,16 @@ class WizardController;
// / |
// LoginDisplayHostCommon MockLoginDisplayHost
// / |
// LoginDisplayHostViews LoginDisplayHostWebUI
// LoginDisplayHostMojo LoginDisplayHostWebUI
//
//
// - LoginDisplayHost defines the generic interface.
// - LoginDisplayHostCommon is UI-agnostic code shared between the views and
// webui hosts.
// - MockLoginDisplayHost is for tests.
// - LoginDisplayHostViews is for the login screen, which is written in views.
// - LoginDisplayHostMojo is for the login screen which is a mojo controller
// (ie, ash/public/interfaces/login_screen.mojom,
// ash/login/login_screen_controller.h).
// - LoginDisplayHostWebUI is for OOBE, which is written in HTML/JS/CSS.
class LoginDisplayHost {
public:
......
......@@ -26,7 +26,7 @@ class DemoAppLauncher;
// LoginDisplayHostCommon contains code which is not specific to a particular UI
// implementation - the goal is to reduce code duplication between
// LoginDisplayHostViews and LoginDisplayHostWebUI.
// LoginDisplayHostMojo and LoginDisplayHostWebUI.
class LoginDisplayHostCommon : public LoginDisplayHost,
public content::NotificationObserver {
public:
......
......@@ -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/chromeos/login/ui/login_display_host_views.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_mojo.h"
#include <string>
#include <utility>
......@@ -12,7 +12,7 @@
#include "chrome/browser/chromeos/login/screens/gaia_view.h"
#include "chrome/browser/chromeos/login/ui/gaia_dialog_delegate.h"
#include "chrome/browser/chromeos/login/ui/login_display.h"
#include "chrome/browser/chromeos/login/ui/login_display_views.h"
#include "chrome/browser/chromeos/login/ui/login_display_mojo.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
#include "chromeos/login/auth/user_context.h"
......@@ -20,50 +20,61 @@
namespace chromeos {
LoginDisplayHostViews::LoginDisplayHostViews() : weak_factory_(this) {
LoginDisplayHostMojo::LoginDisplayHostMojo() : weak_factory_(this) {
// Preload the WebUI for post-login screens.
InitWidgetAndView();
}
LoginDisplayHostViews::~LoginDisplayHostViews() {
LoginDisplayHostMojo::~LoginDisplayHostMojo() {
LoginScreenClient::Get()->SetDelegate(nullptr);
if (dialog_)
dialog_->Close();
}
LoginDisplay* LoginDisplayHostViews::CreateLoginDisplay(
void LoginDisplayHostMojo::OnDialogDestroyed(const GaiaDialogDelegate* dialog) {
if (dialog == dialog_) {
dialog_ = nullptr;
wizard_controller_.reset();
}
}
void LoginDisplayHostMojo::SetUsers(const user_manager::UserList& users) {
users_ = users;
}
LoginDisplay* LoginDisplayHostMojo::CreateLoginDisplay(
LoginDisplay::Delegate* delegate) {
return new LoginDisplayViews(delegate, this);
return new LoginDisplayMojo(delegate, this);
}
gfx::NativeWindow LoginDisplayHostViews::GetNativeWindow() const {
gfx::NativeWindow LoginDisplayHostMojo::GetNativeWindow() const {
NOTIMPLEMENTED();
return nullptr;
}
OobeUI* LoginDisplayHostViews::GetOobeUI() const {
OobeUI* LoginDisplayHostMojo::GetOobeUI() const {
if (!dialog_)
return nullptr;
return dialog_->GetOobeUI();
}
WebUILoginView* LoginDisplayHostViews::GetWebUILoginView() const {
WebUILoginView* LoginDisplayHostMojo::GetWebUILoginView() const {
NOTREACHED();
return nullptr;
}
void LoginDisplayHostViews::OnFinalize() {
void LoginDisplayHostMojo::OnFinalize() {
if (dialog_)
dialog_->Close();
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
void LoginDisplayHostViews::SetStatusAreaVisible(bool visible) {
void LoginDisplayHostMojo::SetStatusAreaVisible(bool visible) {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::StartWizard(OobeScreen first_screen) {
void LoginDisplayHostMojo::StartWizard(OobeScreen first_screen) {
DCHECK(GetOobeUI());
// Dtor of the old WizardController should be called before ctor of the
......@@ -76,20 +87,20 @@ void LoginDisplayHostViews::StartWizard(OobeScreen first_screen) {
dialog_->Show(false /*closable_by_esc*/);
}
WizardController* LoginDisplayHostViews::GetWizardController() {
WizardController* LoginDisplayHostMojo::GetWizardController() {
NOTIMPLEMENTED();
return nullptr;
}
void LoginDisplayHostViews::OnStartUserAdding() {
void LoginDisplayHostMojo::OnStartUserAdding() {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::CancelUserAdding() {
void LoginDisplayHostMojo::CancelUserAdding() {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::OnStartSignInScreen(
void LoginDisplayHostMojo::OnStartSignInScreen(
const LoginScreenContext& context) {
// This function may be called early in startup flow, before LoginScreenClient
// has been initialized. Wait until LoginScreenClient is initialized as it is
......@@ -97,7 +108,7 @@ void LoginDisplayHostViews::OnStartSignInScreen(
if (!LoginScreenClient::HasInstance()) {
// TODO(jdufault): Add a timeout here / make sure we do not post infinitely.
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(&LoginDisplayHostViews::OnStartSignInScreen,
FROM_HERE, base::BindOnce(&LoginDisplayHostMojo::OnStartSignInScreen,
weak_factory_.GetWeakPtr(), context));
return;
}
......@@ -113,32 +124,32 @@ void LoginDisplayHostViews::OnStartSignInScreen(
existing_user_controller_->Init(user_manager::UserManager::Get()->GetUsers());
}
void LoginDisplayHostViews::OnPreferencesChanged() {
void LoginDisplayHostMojo::OnPreferencesChanged() {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::OnStartAppLaunch() {
void LoginDisplayHostMojo::OnStartAppLaunch() {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::OnStartArcKiosk() {
void LoginDisplayHostMojo::OnStartArcKiosk() {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::OnBrowserCreated() {
void LoginDisplayHostMojo::OnBrowserCreated() {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::StartVoiceInteractionOobe() {
void LoginDisplayHostMojo::StartVoiceInteractionOobe() {
NOTIMPLEMENTED();
}
bool LoginDisplayHostViews::IsVoiceInteractionOobe() {
bool LoginDisplayHostMojo::IsVoiceInteractionOobe() {
NOTIMPLEMENTED();
return false;
}
void LoginDisplayHostViews::UpdateGaiaDialogVisibility(bool visible) {
void LoginDisplayHostMojo::UpdateGaiaDialogVisibility(bool visible) {
DCHECK(dialog_);
if (visible) {
dialog_->Show(true /*closable_by_esc*/);
......@@ -155,16 +166,16 @@ void LoginDisplayHostViews::UpdateGaiaDialogVisibility(bool visible) {
dialog_->Hide();
}
void LoginDisplayHostViews::UpdateGaiaDialogSize(int width, int height) {
void LoginDisplayHostMojo::UpdateGaiaDialogSize(int width, int height) {
if (dialog_)
dialog_->SetSize(width, height);
}
const user_manager::UserList LoginDisplayHostViews::GetUsers() {
const user_manager::UserList LoginDisplayHostMojo::GetUsers() {
return users_;
}
void LoginDisplayHostViews::HandleAuthenticateUser(
void LoginDisplayHostMojo::HandleAuthenticateUser(
const AccountId& account_id,
const std::string& hashed_password,
const password_manager::SyncPasswordData& sync_password_data,
......@@ -186,39 +197,39 @@ void LoginDisplayHostViews::HandleAuthenticateUser(
existing_user_controller_->Login(user_context, chromeos::SigninSpecifics());
}
void LoginDisplayHostViews::HandleAttemptUnlock(const AccountId& account_id) {
void LoginDisplayHostMojo::HandleAttemptUnlock(const AccountId& account_id) {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::HandleHardlockPod(const AccountId& account_id) {
void LoginDisplayHostMojo::HandleHardlockPod(const AccountId& account_id) {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::HandleRecordClickOnLockIcon(
void LoginDisplayHostMojo::HandleRecordClickOnLockIcon(
const AccountId& account_id) {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::HandleOnFocusPod(const AccountId& account_id) {
void LoginDisplayHostMojo::HandleOnFocusPod(const AccountId& account_id) {
NOTIMPLEMENTED();
}
void LoginDisplayHostViews::HandleOnNoPodFocused() {
void LoginDisplayHostMojo::HandleOnNoPodFocused() {
NOTIMPLEMENTED();
}
bool LoginDisplayHostViews::HandleFocusLockScreenApps(bool reverse) {
bool LoginDisplayHostMojo::HandleFocusLockScreenApps(bool reverse) {
NOTIMPLEMENTED();
return false;
}
void LoginDisplayHostViews::HandleLoginAsGuest() {
void LoginDisplayHostMojo::HandleLoginAsGuest() {
existing_user_controller_->Login(UserContext(user_manager::USER_TYPE_GUEST,
user_manager::GuestAccountId()),
chromeos::SigninSpecifics());
}
void LoginDisplayHostViews::HandleLaunchPublicSession(
void LoginDisplayHostMojo::HandleLaunchPublicSession(
const AccountId& account_id,
const std::string& locale,
const std::string& input_method) {
......@@ -228,29 +239,17 @@ void LoginDisplayHostViews::HandleLaunchPublicSession(
existing_user_controller_->Login(context, chromeos::SigninSpecifics());
}
void LoginDisplayHostViews::OnAuthFailure(const AuthFailure& error) {
void LoginDisplayHostMojo::OnAuthFailure(const AuthFailure& error) {
if (on_authenticated_)
std::move(on_authenticated_).Run(false);
}
void LoginDisplayHostViews::OnAuthSuccess(const UserContext& user_context) {
void LoginDisplayHostMojo::OnAuthSuccess(const UserContext& user_context) {
if (on_authenticated_)
std::move(on_authenticated_).Run(true);
}
void LoginDisplayHostViews::OnDialogDestroyed(
const GaiaDialogDelegate* dialog) {
if (dialog == dialog_) {
dialog_ = nullptr;
wizard_controller_.reset();
}
}
void LoginDisplayHostViews::SetUsers(const user_manager::UserList& users) {
users_ = users;
}
void LoginDisplayHostViews::InitWidgetAndView() {
void LoginDisplayHostMojo::InitWidgetAndView() {
if (dialog_)
return;
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_VIEWS_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_VIEWS_H_
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_MOJO_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_MOJO_H_
#include <memory>
#include <string>
......@@ -22,12 +22,18 @@ class GaiaDialogDelegate;
// A LoginDisplayHost instance that sends requests to the views-based signin
// screen.
class LoginDisplayHostViews : public LoginDisplayHostCommon,
public LoginScreenClient::Delegate,
public AuthStatusConsumer {
class LoginDisplayHostMojo : public LoginDisplayHostCommon,
public LoginScreenClient::Delegate,
public AuthStatusConsumer {
public:
LoginDisplayHostViews();
~LoginDisplayHostViews() override;
LoginDisplayHostMojo();
~LoginDisplayHostMojo() override;
// Called when the gaia dialog is destroyed.
void OnDialogDestroyed(const GaiaDialogDelegate* dialog);
// Set the users in the views login screen.
void SetUsers(const user_manager::UserList& users);
// LoginDisplayHost:
LoginDisplay* CreateLoginDisplay(LoginDisplay::Delegate* delegate) override;
......@@ -73,12 +79,6 @@ class LoginDisplayHostViews : public LoginDisplayHostCommon,
void OnAuthFailure(const AuthFailure& error) override;
void OnAuthSuccess(const UserContext& user_context) override;
// Called when the gaia dialog is destroyed.
void OnDialogDestroyed(const GaiaDialogDelegate* dialog);
// Set the users in the views login screen.
void SetUsers(const user_manager::UserList& users);
private:
// Initialize the dialog widget for webui (for gaia and post login screens).
void InitWidgetAndView();
......@@ -97,11 +97,11 @@ class LoginDisplayHostViews : public LoginDisplayHostCommon,
// TODO(crbug.com/808277): consider remove user case.
user_manager::UserList users_;
base::WeakPtrFactory<LoginDisplayHostViews> weak_factory_;
base::WeakPtrFactory<LoginDisplayHostMojo> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostViews);
DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostMojo);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_VIEWS_H_
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_MOJO_H_
......@@ -42,7 +42,7 @@
#include "chrome/browser/chromeos/login/signin/token_handle_util.h"
#include "chrome/browser/chromeos/login/startup_utils.h"
#include "chrome/browser/chromeos/login/ui/input_events_blocker.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_views.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_mojo.h"
#include "chrome/browser/chromeos/login/ui/login_display_webui.h"
#include "chrome/browser/chromeos/login/ui/webui_login_view.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
......@@ -204,7 +204,7 @@ void ShowLoginWizardFinish(
display_host = chromeos::LoginDisplayHost::default_host();
} else if (ash::switches::IsUsingViewsLogin() &&
ShouldShowSigninScreen(first_screen)) {
display_host = new chromeos::LoginDisplayHostViews();
display_host = new chromeos::LoginDisplayHostMojo();
} else {
display_host = new chromeos::LoginDisplayHostWebUI();
}
......
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/login/ui/login_display_views.h"
#include "chrome/browser/chromeos/login/ui/login_display_mojo.h"
#include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h"
#include "chrome/browser/chromeos/login/screens/user_selection_screen.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_views.h"
#include "chrome/browser/chromeos/login/user_selection_screen_proxy.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_mojo.h"
#include "chrome/browser/chromeos/login/user_board_view_mojo.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/ui/ash/login_screen_client.h"
#include "chromeos/dbus/dbus_thread_manager.h"
......@@ -20,25 +20,24 @@ namespace {
constexpr char kLoginDisplay[] = "login";
} // namespace
LoginDisplayViews::LoginDisplayViews(Delegate* delegate,
LoginDisplayHostViews* host)
LoginDisplayMojo::LoginDisplayMojo(Delegate* delegate,
LoginDisplayHostMojo* host)
: LoginDisplay(delegate),
host_(host),
user_selection_screen_proxy_(
std::make_unique<UserSelectionScreenProxy>()),
user_board_view_mojo_(std::make_unique<UserBoardViewMojo>()),
user_selection_screen_(
std::make_unique<ChromeUserSelectionScreen>(kLoginDisplay)) {
user_selection_screen_->SetView(user_selection_screen_proxy_.get());
user_selection_screen_->SetView(user_board_view_mojo_.get());
}
LoginDisplayViews::~LoginDisplayViews() = default;
LoginDisplayMojo::~LoginDisplayMojo() = default;
void LoginDisplayViews::ClearAndEnablePassword() {}
void LoginDisplayMojo::ClearAndEnablePassword() {}
void LoginDisplayViews::Init(const user_manager::UserList& filtered_users,
bool show_guest,
bool show_users,
bool show_new_user) {
void LoginDisplayMojo::Init(const user_manager::UserList& filtered_users,
bool show_guest,
bool show_users,
bool show_new_user) {
host_->SetUsers(filtered_users);
// Load the login screen.
......@@ -61,38 +60,38 @@ void LoginDisplayViews::Init(const user_manager::UserList& filtered_users,
user_selection_screen_->SetUsersLoaded(true /*loaded*/);
}
void LoginDisplayViews::OnPreferencesChanged() {
void LoginDisplayMojo::OnPreferencesChanged() {
NOTIMPLEMENTED();
}
void LoginDisplayViews::SetUIEnabled(bool is_enabled) {
void LoginDisplayMojo::SetUIEnabled(bool is_enabled) {
NOTIMPLEMENTED();
}
void LoginDisplayViews::ShowError(int error_msg_id,
int login_attempts,
HelpAppLauncher::HelpTopic help_topic_id) {
void LoginDisplayMojo::ShowError(int error_msg_id,
int login_attempts,
HelpAppLauncher::HelpTopic help_topic_id) {
NOTIMPLEMENTED();
}
void LoginDisplayViews::ShowErrorScreen(LoginDisplay::SigninError error_id) {
void LoginDisplayMojo::ShowErrorScreen(LoginDisplay::SigninError error_id) {
NOTIMPLEMENTED();
}
void LoginDisplayViews::ShowPasswordChangedDialog(bool show_password_error,
const std::string& email) {
void LoginDisplayMojo::ShowPasswordChangedDialog(bool show_password_error,
const std::string& email) {
NOTIMPLEMENTED();
}
void LoginDisplayViews::ShowSigninUI(const std::string& email) {
void LoginDisplayMojo::ShowSigninUI(const std::string& email) {
NOTIMPLEMENTED();
}
void LoginDisplayViews::ShowWhitelistCheckFailedError() {
void LoginDisplayMojo::ShowWhitelistCheckFailedError() {
NOTIMPLEMENTED();
}
void LoginDisplayViews::ShowUnrecoverableCrypthomeErrorDialog() {
void LoginDisplayMojo::ShowUnrecoverableCrypthomeErrorDialog() {
NOTIMPLEMENTED();
}
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_VIEWS_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_VIEWS_H_
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_MOJO_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_MOJO_H_
#include <memory>
......@@ -12,16 +12,16 @@
namespace chromeos {
class LoginDisplayHostViews;
class LoginDisplayHostMojo;
class UserBoardViewMojo;
class UserSelectionScreen;
class UserSelectionScreenProxy;
// Interface used by UI-agnostic code to send messages to views-based login
// screen.
class LoginDisplayViews : public LoginDisplay {
class LoginDisplayMojo : public LoginDisplay {
public:
LoginDisplayViews(Delegate* delegate, LoginDisplayHostViews* host);
~LoginDisplayViews() override;
LoginDisplayMojo(Delegate* delegate, LoginDisplayHostMojo* host);
~LoginDisplayMojo() override;
// LoginDisplay:
void ClearAndEnablePassword() override;
......@@ -42,13 +42,13 @@ class LoginDisplayViews : public LoginDisplay {
void ShowUnrecoverableCrypthomeErrorDialog() override;
private:
LoginDisplayHostViews* const host_ = nullptr;
std::unique_ptr<UserSelectionScreenProxy> user_selection_screen_proxy_;
LoginDisplayHostMojo* const host_ = nullptr;
std::unique_ptr<UserBoardViewMojo> user_board_view_mojo_;
std::unique_ptr<UserSelectionScreen> user_selection_screen_;
DISALLOW_COPY_AND_ASSIGN(LoginDisplayViews);
DISALLOW_COPY_AND_ASSIGN(LoginDisplayMojo);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_VIEWS_H_
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_MOJO_H_
......@@ -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/chromeos/login/user_selection_screen_proxy.h"
#include "chrome/browser/chromeos/login/user_board_view_mojo.h"
#include <utility>
......@@ -63,18 +63,18 @@ ash::mojom::EasyUnlockIconOptionsPtr ToEasyUnlockIconOptionsPtr(
} // namespace
UserSelectionScreenProxy::UserSelectionScreenProxy() = default;
UserBoardViewMojo::UserBoardViewMojo() : weak_factory_(this) {}
UserSelectionScreenProxy::~UserSelectionScreenProxy() = default;
UserBoardViewMojo::~UserBoardViewMojo() = default;
void UserSelectionScreenProxy::SetPublicSessionDisplayName(
void UserBoardViewMojo::SetPublicSessionDisplayName(
const AccountId& account_id,
const std::string& display_name) {
LoginScreenClient::Get()->login_screen()->SetPublicSessionDisplayName(
account_id, display_name);
}
void UserSelectionScreenProxy::SetPublicSessionLocales(
void UserBoardViewMojo::SetPublicSessionLocales(
const AccountId& account_id,
std::unique_ptr<base::ListValue> locales,
const std::string& default_locale,
......@@ -84,7 +84,7 @@ void UserSelectionScreenProxy::SetPublicSessionLocales(
multiple_recommended_locales);
}
void UserSelectionScreenProxy::ShowUserPodCustomIcon(
void UserBoardViewMojo::ShowUserPodCustomIcon(
const AccountId& account_id,
const proximity_auth::ScreenlockBridge::UserPodCustomIconOptions&
icon_options) {
......@@ -96,21 +96,19 @@ void UserSelectionScreenProxy::ShowUserPodCustomIcon(
account_id, std::move(icon));
}
void UserSelectionScreenProxy::HideUserPodCustomIcon(
const AccountId& account_id) {
void UserBoardViewMojo::HideUserPodCustomIcon(const AccountId& account_id) {
LoginScreenClient::Get()->login_screen()->HideUserPodCustomIcon(account_id);
}
void UserSelectionScreenProxy::SetAuthType(
const AccountId& account_id,
proximity_auth::mojom::AuthType auth_type,
const base::string16& initial_value) {
void UserBoardViewMojo::SetAuthType(const AccountId& account_id,
proximity_auth::mojom::AuthType auth_type,
const base::string16& initial_value) {
LoginScreenClient::Get()->login_screen()->SetAuthType(account_id, auth_type,
initial_value);
}
base::WeakPtr<chromeos::UserBoardView> UserSelectionScreenProxy::GetWeakPtr() {
return base::WeakPtr<chromeos::UserBoardView>();
base::WeakPtr<UserBoardView> UserBoardViewMojo::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
} // namespace chromeos
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_SELECTION_SCREEN_PROXY_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_USER_SELECTION_SCREEN_PROXY_H_
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_BOARD_VIEW_MOJO_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_USER_BOARD_VIEW_MOJO_H_
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
......@@ -11,12 +11,11 @@
namespace chromeos {
// This class is a proxy layer which handles calls from UserSelectionScreen and
// send them to ash.
class UserSelectionScreenProxy : public chromeos::UserBoardView {
// UserBoardView implementation that forwards calls to ash via mojo.
class UserBoardViewMojo : public UserBoardView {
public:
UserSelectionScreenProxy();
~UserSelectionScreenProxy() override;
UserBoardViewMojo();
~UserBoardViewMojo() override;
// UserBoardView:
void SetPublicSessionDisplayName(const AccountId& account_id,
......@@ -35,14 +34,16 @@ class UserSelectionScreenProxy : public chromeos::UserBoardView {
void SetAuthType(const AccountId& account_id,
proximity_auth::mojom::AuthType auth_type,
const base::string16& initial_value) override;
void Bind(chromeos::UserSelectionScreen* screen) override{};
void Bind(UserSelectionScreen* screen) override{};
void Unbind() override{};
base::WeakPtr<UserBoardView> GetWeakPtr() override;
private:
DISALLOW_COPY_AND_ASSIGN(UserSelectionScreenProxy);
base::WeakPtrFactory<UserBoardViewMojo> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(UserBoardViewMojo);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_SELECTION_SCREEN_PROXY_H_
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_BOARD_VIEW_MOJO_H_
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