Commit 9c07ab42 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Reland "Mash cleanup: remove kiosk related mojos, replace with interface"

This relands 4bace02d without includes
of stale header kiosk_app_info.mojom.h

TBR=derat@chromium.org,tsepez@chromium.org

Bug: 962631
Change-Id: I2c13a3453a12c6369431191dc53aed28b0595fcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610843Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659212}
parent ffd7185d
...@@ -485,16 +485,6 @@ void LoginScreenController::SetPublicSessionShowFullManagementDisclosure( ...@@ -485,16 +485,6 @@ void LoginScreenController::SetPublicSessionShowFullManagementDisclosure(
} }
} }
void LoginScreenController::SetKioskApps(
std::vector<mojom::KioskAppInfoPtr> kiosk_apps,
SetKioskAppsCallback callback) {
Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
->shelf_widget()
->login_shelf_view()
->SetKioskApps(std::move(kiosk_apps));
std::move(callback).Run(true);
}
void LoginScreenController::ShowKioskAppError(const std::string& message) { void LoginScreenController::ShowKioskAppError(const std::string& message) {
ToastData toast_data( ToastData toast_data(
"KioskAppError", base::UTF8ToUTF16(message), -1 /*duration_ms*/, "KioskAppError", base::UTF8ToUTF16(message), -1 /*duration_ms*/,
...@@ -552,6 +542,15 @@ void LoginScreenController::FocusLoginShelf(bool reverse) { ...@@ -552,6 +542,15 @@ void LoginScreenController::FocusLoginShelf(bool reverse) {
} }
} }
void LoginScreenController::SetKioskApps(
const std::vector<KioskAppMenuEntry>& kiosk_apps,
const base::RepeatingCallback<void(const KioskAppMenuEntry&)>& launch_app) {
Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
->shelf_widget()
->login_shelf_view()
->SetKioskApps(kiosk_apps, launch_app);
}
void LoginScreenController::SetAddUserButtonEnabled(bool enable) { void LoginScreenController::SetAddUserButtonEnabled(bool enable) {
Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow()) Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
->shelf_widget() ->shelf_widget()
...@@ -566,14 +565,6 @@ void LoginScreenController::SetShutdownButtonEnabled(bool enable) { ...@@ -566,14 +565,6 @@ void LoginScreenController::SetShutdownButtonEnabled(bool enable) {
->SetShutdownButtonEnabled(enable); ->SetShutdownButtonEnabled(enable);
} }
void LoginScreenController::LaunchKioskApp(const std::string& app_id) {
login_screen_client_->LaunchKioskApp(app_id);
}
void LoginScreenController::LaunchArcKioskApp(const AccountId& account_id) {
login_screen_client_->LaunchArcKioskApp(account_id);
}
void LoginScreenController::ShowResetScreen() { void LoginScreenController::ShowResetScreen() {
login_screen_client_->ShowResetScreen(); login_screen_client_->ShowResetScreen();
} }
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "ash/login/login_screen_controller_observer.h" #include "ash/login/login_screen_controller_observer.h"
#include "ash/public/cpp/kiosk_app_menu.h"
#include "ash/public/cpp/system_tray_focus_observer.h" #include "ash/public/cpp/system_tray_focus_observer.h"
#include "ash/public/interfaces/kiosk_app_info.mojom.h"
#include "ash/public/interfaces/login_screen.mojom.h" #include "ash/public/interfaces/login_screen.mojom.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/observer_list.h" #include "base/observer_list.h"
...@@ -30,6 +30,7 @@ class SystemTrayNotifier; ...@@ -30,6 +30,7 @@ class SystemTrayNotifier;
// This could send requests to LoginScreenClient and also handle requests from // This could send requests to LoginScreenClient and also handle requests from
// LoginScreenClient through mojo. // LoginScreenClient through mojo.
class ASH_EXPORT LoginScreenController : public mojom::LoginScreen, class ASH_EXPORT LoginScreenController : public mojom::LoginScreen,
public KioskAppMenu,
public SystemTrayFocusObserver { public SystemTrayFocusObserver {
public: public:
// The current authentication stage. Used to get more verbose logging. // The current authentication stage. Used to get more verbose logging.
...@@ -95,8 +96,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen, ...@@ -95,8 +96,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen,
void RequestPublicSessionKeyboardLayouts(const AccountId& account_id, void RequestPublicSessionKeyboardLayouts(const AccountId& account_id,
const std::string& locale); const std::string& locale);
void ShowFeedback(); void ShowFeedback();
void LaunchKioskApp(const std::string& app_id);
void LaunchArcKioskApp(const AccountId& account_id);
void ShowResetScreen(); void ShowResetScreen();
void ShowAccountAccessHelpApp(); void ShowAccountAccessHelpApp();
void FocusOobeDialog(); void FocusOobeDialog();
...@@ -160,8 +159,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen, ...@@ -160,8 +159,6 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen,
std::vector<mojom::InputMethodItemPtr> keyboard_layouts) override; std::vector<mojom::InputMethodItemPtr> keyboard_layouts) override;
void SetPublicSessionShowFullManagementDisclosure( void SetPublicSessionShowFullManagementDisclosure(
bool is_full_management_disclosure_needed) override; bool is_full_management_disclosure_needed) override;
void SetKioskApps(std::vector<mojom::KioskAppInfoPtr> kiosk_apps,
SetKioskAppsCallback callback) override;
void ShowKioskAppError(const std::string& message) override; void ShowKioskAppError(const std::string& message) override;
void NotifyOobeDialogState(mojom::OobeDialogState state) override; void NotifyOobeDialogState(mojom::OobeDialogState state) override;
void SetAddUserButtonEnabled(bool enable) override; void SetAddUserButtonEnabled(bool enable) override;
...@@ -172,6 +169,12 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen, ...@@ -172,6 +169,12 @@ class ASH_EXPORT LoginScreenController : public mojom::LoginScreen,
void SetShowParentAccessDialog(bool show) override; void SetShowParentAccessDialog(bool show) override;
void FocusLoginShelf(bool reverse) override; void FocusLoginShelf(bool reverse) override;
// KioskAppMenu:
void SetKioskApps(
const std::vector<KioskAppMenuEntry>& kiosk_apps,
const base::RepeatingCallback<void(const KioskAppMenuEntry&)>& launch_app)
override;
// Flushes the mojo pipes - to be used in tests. // Flushes the mojo pipes - to be used in tests.
void FlushForTesting(); void FlushForTesting();
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef ASH_LOGIN_MOCK_LOGIN_SCREEN_CLIENT_H_ #ifndef ASH_LOGIN_MOCK_LOGIN_SCREEN_CLIENT_H_
#define ASH_LOGIN_MOCK_LOGIN_SCREEN_CLIENT_H_ #define ASH_LOGIN_MOCK_LOGIN_SCREEN_CLIENT_H_
#include "ash/public/interfaces/kiosk_app_info.mojom.h"
#include "ash/public/interfaces/login_screen.mojom.h" #include "ash/public/interfaces/login_screen.mojom.h"
#include "components/password_manager/core/browser/hash_password_manager.h" #include "components/password_manager/core/browser/hash_password_manager.h"
#include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/binding_set.h"
...@@ -102,8 +101,6 @@ class MockLoginScreenClient : public mojom::LoginScreenClient { ...@@ -102,8 +101,6 @@ class MockLoginScreenClient : public mojom::LoginScreenClient {
MOCK_METHOD2(RequestPublicSessionKeyboardLayouts, MOCK_METHOD2(RequestPublicSessionKeyboardLayouts,
void(const AccountId& account_id, const std::string& locale)); void(const AccountId& account_id, const std::string& locale));
MOCK_METHOD0(ShowFeedback, void()); MOCK_METHOD0(ShowFeedback, void());
MOCK_METHOD1(LaunchKioskApp, void(const std::string& app_id));
MOCK_METHOD1(LaunchArcKioskApp, void(const AccountId& account_id));
MOCK_METHOD0(ShowResetScreen, void()); MOCK_METHOD0(ShowResetScreen, void());
MOCK_METHOD0(ShowAccountAccessHelpApp, void()); MOCK_METHOD0(ShowAccountAccessHelpApp, void());
MOCK_METHOD0(FocusOobeDialog, void()); MOCK_METHOD0(FocusOobeDialog, void());
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "ash/login/ui/login_detachable_base_model.h" #include "ash/login/ui/login_detachable_base_model.h"
#include "ash/login/ui/non_accessible_view.h" #include "ash/login/ui/non_accessible_view.h"
#include "ash/login/ui/views_utils.h" #include "ash/login/ui/views_utils.h"
#include "ash/public/interfaces/kiosk_app_info.mojom.h" #include "ash/public/cpp/kiosk_app_menu.h"
#include "ash/shelf/login_shelf_view.h" #include "ash/shelf/login_shelf_view.h"
#include "ash/shelf/shelf.h" #include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_widget.h" #include "ash/shelf/shelf_widget.h"
...@@ -414,19 +414,18 @@ class LockDebugView::DebugDataDispatcherTransformer ...@@ -414,19 +414,18 @@ class LockDebugView::DebugDataDispatcherTransformer
} }
void AddKioskApp(ShelfWidget* shelf_widget) { void AddKioskApp(ShelfWidget* shelf_widget) {
mojom::KioskAppInfoPtr app_info = mojom::KioskAppInfo::New(); KioskAppMenuEntry menu_item;
app_info->identifier = mojom::KioskAppIdentifier::New(); menu_item.app_id = kDebugKioskAppId;
app_info->identifier->set_app_id(kDebugKioskAppId); menu_item.name = base::UTF8ToUTF16(kDebugKioskAppName);
app_info->name = base::UTF8ToUTF16(kDebugKioskAppName); kiosk_apps_.push_back(std::move(menu_item));
kiosk_apps_.push_back(std::move(app_info)); shelf_widget->login_shelf_view()->SetKioskApps(kiosk_apps_, {});
shelf_widget->login_shelf_view()->SetKioskApps(mojo::Clone(kiosk_apps_));
} }
void RemoveKioskApp(ShelfWidget* shelf_widget) { void RemoveKioskApp(ShelfWidget* shelf_widget) {
if (kiosk_apps_.empty()) if (kiosk_apps_.empty())
return; return;
kiosk_apps_.pop_back(); kiosk_apps_.pop_back();
shelf_widget->login_shelf_view()->SetKioskApps(mojo::Clone(kiosk_apps_)); shelf_widget->login_shelf_view()->SetKioskApps(kiosk_apps_, {});
} }
void AddSystemInfo(const std::string& os_version, void AddSystemInfo(const std::string& os_version,
...@@ -522,7 +521,7 @@ class LockDebugView::DebugDataDispatcherTransformer ...@@ -522,7 +521,7 @@ class LockDebugView::DebugDataDispatcherTransformer
mojom::TrayActionState lock_screen_note_state_; mojom::TrayActionState lock_screen_note_state_;
// List of kiosk apps loaded. // List of kiosk apps loaded.
std::vector<mojom::KioskAppInfoPtr> kiosk_apps_; std::vector<KioskAppMenuEntry> kiosk_apps_;
// Called when a new user list has been received. // Called when a new user list has been received.
base::RepeatingClosure on_users_received_; base::RepeatingClosure on_users_received_;
......
...@@ -79,6 +79,8 @@ component("cpp") { ...@@ -79,6 +79,8 @@ component("cpp") {
"immersive/immersive_revealed_lock.cc", "immersive/immersive_revealed_lock.cc",
"immersive/immersive_revealed_lock.h", "immersive/immersive_revealed_lock.h",
"keyboard_shortcut_viewer.h", "keyboard_shortcut_viewer.h",
"kiosk_app_menu.cc",
"kiosk_app_menu.h",
"lock_screen_widget_factory.cc", "lock_screen_widget_factory.cc",
"lock_screen_widget_factory.h", "lock_screen_widget_factory.h",
"login_constants.h", "login_constants.h",
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/public/cpp/kiosk_app_menu.h"
namespace ash {
namespace {
KioskAppMenu* g_instance = nullptr;
}
KioskAppMenuEntry::KioskAppMenuEntry() = default;
KioskAppMenuEntry::KioskAppMenuEntry(const KioskAppMenuEntry& other) = default;
KioskAppMenuEntry::KioskAppMenuEntry(KioskAppMenuEntry&& other) = default;
KioskAppMenuEntry::~KioskAppMenuEntry() = default;
KioskAppMenuEntry& KioskAppMenuEntry::operator=(KioskAppMenuEntry&& other) =
default;
KioskAppMenuEntry& KioskAppMenuEntry::operator=(
const KioskAppMenuEntry& other) = default;
// static
KioskAppMenu* KioskAppMenu::Get() {
return g_instance;
}
KioskAppMenu::KioskAppMenu() {
DCHECK_EQ(nullptr, g_instance);
g_instance = this;
}
KioskAppMenu::~KioskAppMenu() {
DCHECK_EQ(this, g_instance);
g_instance = nullptr;
}
} // namespace ash
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_PUBLIC_CPP_KIOSK_APP_MENU_H_
#define ASH_PUBLIC_CPP_KIOSK_APP_MENU_H_
#include <string>
#include <vector>
#include "ash/public/cpp/ash_public_export.h"
#include "base/callback_forward.h"
#include "base/strings/string16.h"
#include "components/account_id/account_id.h"
#include "ui/gfx/image/image_skia.h"
namespace ash {
// Metadata about a kiosk app. Used for display in the kiosk app menu in the
// login screen shelf.
struct ASH_PUBLIC_EXPORT KioskAppMenuEntry {
KioskAppMenuEntry();
KioskAppMenuEntry(const KioskAppMenuEntry& other);
KioskAppMenuEntry(KioskAppMenuEntry&& other);
~KioskAppMenuEntry();
KioskAppMenuEntry& operator=(KioskAppMenuEntry&& other);
KioskAppMenuEntry& operator=(const KioskAppMenuEntry& other);
// For Chrome kiosk apps only, the extension app id.
std::string app_id;
// For ARC kiosk apps only, the account id for the app.
AccountId account_id;
base::string16 name;
gfx::ImageSkia icon;
};
// An interface implemented by Ash to allow Chrome to control the kiosk app
// menu, which appears in the login shelf.
class ASH_PUBLIC_EXPORT KioskAppMenu {
public:
// Returns the singleton instance.
static KioskAppMenu* Get();
// Update the kiosk app data. |launch_app| will be called if the user selects
// an item (app) from the menu.
virtual void SetKioskApps(
const std::vector<KioskAppMenuEntry>& kiosk_apps,
const base::RepeatingCallback<void(const KioskAppMenuEntry&)>&
launch_app) = 0;
protected:
KioskAppMenu();
virtual ~KioskAppMenu();
};
} // namespace ash
#endif // ASH_PUBLIC_CPP_KIOSK_APP_MENU_H_
...@@ -38,7 +38,6 @@ mojom("interfaces_internal") { ...@@ -38,7 +38,6 @@ mojom("interfaces_internal") {
"ime_controller.mojom", "ime_controller.mojom",
"ime_info.mojom", "ime_info.mojom",
"keyboard_controller.mojom", "keyboard_controller.mojom",
"kiosk_app_info.mojom",
"kiosk_next_shell.mojom", "kiosk_next_shell.mojom",
"locale.mojom", "locale.mojom",
"login_screen.mojom", "login_screen.mojom",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module ash.mojom;
import "components/account_id/interfaces/account_id.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "ui/gfx/image/mojo/image.mojom";
union KioskAppIdentifier {
// For chrome kiosk apps only, the extension app id.
string app_id;
// For ARC kiosk apps only, the account id for the app.
signin.mojom.AccountId account_id;
};
// Metadata about a kiosk app. Used for display in the kiosk app menu in the
// login screen shelf.
struct KioskAppInfo {
KioskAppIdentifier identifier;
mojo_base.mojom.String16 name;
gfx.mojom.ImageSkia icon;
};
\ No newline at end of file
...@@ -6,7 +6,6 @@ module ash.mojom; ...@@ -6,7 +6,6 @@ module ash.mojom;
import "ash/public/interfaces/user_info.mojom"; import "ash/public/interfaces/user_info.mojom";
import "ash/public/interfaces/login_user_info.mojom"; import "ash/public/interfaces/login_user_info.mojom";
import "ash/public/interfaces/kiosk_app_info.mojom";
import "chromeos/components/proximity_auth/public/interfaces/auth_type.mojom"; import "chromeos/components/proximity_auth/public/interfaces/auth_type.mojom";
import "components/account_id/interfaces/account_id.mojom"; import "components/account_id/interfaces/account_id.mojom";
import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/string16.mojom";
...@@ -218,10 +217,6 @@ interface LoginScreen { ...@@ -218,10 +217,6 @@ interface LoginScreen {
SetPublicSessionShowFullManagementDisclosure( SetPublicSessionShowFullManagementDisclosure(
bool show_full_management_disclosure); bool show_full_management_disclosure);
// Update the kiosk app data for the login screen.
// Returns true on success.
SetKioskApps(array<KioskAppInfo> kiosk_apps) => (bool success);
// Display a toast describing the latest kiosk app launch error. // Display a toast describing the latest kiosk app launch error.
ShowKioskAppError(string message); ShowKioskAppError(string message);
...@@ -365,12 +360,6 @@ interface LoginScreenClient { ...@@ -365,12 +360,6 @@ interface LoginScreenClient {
// Request to show a feedback report dialog in chrome. // Request to show a feedback report dialog in chrome.
ShowFeedback(); ShowFeedback();
// Launch the specific kiosk app.
LaunchKioskApp(string app_id);
// Launch the specific ARC++ kiosk app.
LaunchArcKioskApp(signin.mojom.AccountId account_id);
// Show the powerwash (device reset) dialog. // Show the powerwash (device reset) dialog.
ShowResetScreen(); ShowResetScreen();
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "ash/login/ui/lock_screen.h" #include "ash/login/ui/lock_screen.h"
#include "ash/public/cpp/ash_constants.h" #include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/login_constants.h" #include "ash/public/cpp/login_constants.h"
#include "ash/public/interfaces/kiosk_app_info.mojom.h"
#include "ash/resources/vector_icons/vector_icons.h" #include "ash/resources/vector_icons/vector_icons.h"
#include "ash/root_window_controller.h" #include "ash/root_window_controller.h"
#include "ash/session/session_controller_impl.h" #include "ash/session/session_controller_impl.h"
...@@ -265,25 +264,27 @@ class KioskAppsButton : public views::MenuButton, ...@@ -265,25 +264,27 @@ class KioskAppsButton : public views::MenuButton,
bool LaunchAppForTesting(const std::string& app_id) { bool LaunchAppForTesting(const std::string& app_id) {
for (size_t i = 0; i < kiosk_apps_.size(); ++i) { for (size_t i = 0; i < kiosk_apps_.size(); ++i) {
if (kiosk_apps_[i]->identifier->get_app_id() != app_id) if (kiosk_apps_[i].app_id == app_id) {
continue; ExecuteCommand(i, 0);
return true;
ExecuteCommand(i, 0); }
return true;
} }
return false; return false;
} }
// Replace the existing items list with a new list of kiosk app menu items. // Replace the existing items list with a new list of kiosk app menu items.
void SetApps(std::vector<mojom::KioskAppInfoPtr> kiosk_apps) { void SetApps(const std::vector<KioskAppMenuEntry>& kiosk_apps,
kiosk_apps_ = std::move(kiosk_apps); const base::RepeatingCallback<void(const KioskAppMenuEntry&)>&
launch_app) {
launch_app_callback_ = launch_app;
kiosk_apps_ = kiosk_apps;
Clear(); Clear();
const gfx::Size kAppIconSize(16, 16); const gfx::Size kAppIconSize(16, 16);
for (size_t i = 0; i < kiosk_apps_.size(); ++i) { for (size_t i = 0; i < kiosk_apps_.size(); ++i) {
gfx::ImageSkia icon = gfx::ImageSkiaOperations::CreateResizedImage( gfx::ImageSkia icon = gfx::ImageSkiaOperations::CreateResizedImage(
kiosk_apps_[i]->icon, skia::ImageOperations::RESIZE_GOOD, kiosk_apps_[i].icon, skia::ImageOperations::RESIZE_GOOD,
kAppIconSize); kAppIconSize);
AddItemWithIcon(i, kiosk_apps_[i]->name, icon); AddItemWithIcon(i, kiosk_apps_[i].name, icon);
} }
} }
...@@ -359,20 +360,7 @@ class KioskAppsButton : public views::MenuButton, ...@@ -359,20 +360,7 @@ class KioskAppsButton : public views::MenuButton,
// the state is reset (when login screen reappears). // the state is reset (when login screen reappears).
is_launch_enabled_ = false; is_launch_enabled_ = false;
const mojom::KioskAppInfoPtr& kiosk_app = kiosk_apps_[command_id]; launch_app_callback_.Run(kiosk_apps_[command_id]);
switch (kiosk_app->identifier->which()) {
case mojom::KioskAppIdentifier::Tag::ACCOUNT_ID:
Shell::Get()->login_screen_controller()->LaunchArcKioskApp(
kiosk_app->identifier->get_account_id());
return;
case mojom::KioskAppIdentifier::Tag::APP_ID:
Shell::Get()->login_screen_controller()->LaunchKioskApp(
kiosk_app->identifier->get_app_id());
return;
default:
NOTREACHED();
}
} }
bool IsCommandIdChecked(int command_id) const override { return false; } bool IsCommandIdChecked(int command_id) const override { return false; }
...@@ -380,8 +368,9 @@ class KioskAppsButton : public views::MenuButton, ...@@ -380,8 +368,9 @@ class KioskAppsButton : public views::MenuButton,
bool IsCommandIdEnabled(int command_id) const override { return true; } bool IsCommandIdEnabled(int command_id) const override { return true; }
private: private:
base::RepeatingCallback<void(const KioskAppMenuEntry&)> launch_app_callback_;
std::unique_ptr<views::MenuRunner> menu_runner_; std::unique_ptr<views::MenuRunner> menu_runner_;
std::vector<mojom::KioskAppInfoPtr> kiosk_apps_; std::vector<KioskAppMenuEntry> kiosk_apps_;
bool is_launch_enabled_ = true; bool is_launch_enabled_ = true;
DISALLOW_COPY_AND_ASSIGN(KioskAppsButton); DISALLOW_COPY_AND_ASSIGN(KioskAppsButton);
...@@ -548,8 +537,9 @@ void LoginShelfView::InstallTestUiUpdateDelegate( ...@@ -548,8 +537,9 @@ void LoginShelfView::InstallTestUiUpdateDelegate(
} }
void LoginShelfView::SetKioskApps( void LoginShelfView::SetKioskApps(
std::vector<mojom::KioskAppInfoPtr> kiosk_apps) { const std::vector<KioskAppMenuEntry>& kiosk_apps,
kiosk_apps_button_->SetApps(std::move(kiosk_apps)); const base::RepeatingCallback<void(const KioskAppMenuEntry&)>& launch_app) {
kiosk_apps_button_->SetApps(kiosk_apps, launch_app);
UpdateUi(); UpdateUi();
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "ash/lock_screen_action/lock_screen_action_background_observer.h" #include "ash/lock_screen_action/lock_screen_action_background_observer.h"
#include "ash/login/login_screen_controller_observer.h" #include "ash/login/login_screen_controller_observer.h"
#include "ash/login/ui/login_data_dispatcher.h" #include "ash/login/ui/login_data_dispatcher.h"
#include "ash/public/interfaces/kiosk_app_info.mojom.h" #include "ash/public/cpp/kiosk_app_menu.h"
#include "ash/public/interfaces/login_screen.mojom.h" #include "ash/public/interfaces/login_screen.mojom.h"
#include "ash/shutdown_controller.h" #include "ash/shutdown_controller.h"
#include "ash/system/locale/locale_update_controller.h" #include "ash/system/locale/locale_update_controller.h"
...@@ -80,8 +80,12 @@ class ASH_EXPORT LoginShelfView : public views::View, ...@@ -80,8 +80,12 @@ class ASH_EXPORT LoginShelfView : public views::View,
// then notifies LoginShelfView to update its own UI. // then notifies LoginShelfView to update its own UI.
void UpdateAfterSessionChange(); void UpdateAfterSessionChange();
// Sets the list of kiosk apps that can be launched from the login shelf. // Sets the contents of the kiosk app menu, as well as the callback used when
void SetKioskApps(std::vector<mojom::KioskAppInfoPtr> kiosk_apps); // a menu item is selected.
void SetKioskApps(
const std::vector<KioskAppMenuEntry>& kiosk_apps,
const base::RepeatingCallback<void(const KioskAppMenuEntry&)>&
launch_app);
// Sets the state of the login dialog. // Sets the state of the login dialog.
void SetLoginDialogState(mojom::OobeDialogState state); void SetLoginDialogState(mojom::OobeDialogState state);
...@@ -188,7 +192,9 @@ class ASH_EXPORT LoginShelfView : public views::View, ...@@ -188,7 +192,9 @@ class ASH_EXPORT LoginShelfView : public views::View,
ScopedObserver<LocaleUpdateController, LocaleChangeObserver> ScopedObserver<LocaleUpdateController, LocaleChangeObserver>
locale_change_observer_{this}; locale_change_observer_{this};
KioskAppsButton* kiosk_apps_button_ = nullptr; // Owned by view hierarchy // The kiosk app button will only be created for the primary display's login
// shelf.
KioskAppsButton* kiosk_apps_button_ = nullptr;
// This is used in tests to wait until UI is updated. // This is used in tests to wait until UI is updated.
std::unique_ptr<TestUiUpdateDelegate> test_ui_update_delegate_; std::unique_ptr<TestUiUpdateDelegate> test_ui_update_delegate_;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "ash/login/mock_login_screen_client.h" #include "ash/login/mock_login_screen_client.h"
#include "ash/login/ui/login_test_base.h" #include "ash/login/ui/login_test_base.h"
#include "ash/login/ui/views_utils.h" #include "ash/login/ui/views_utils.h"
#include "ash/public/interfaces/kiosk_app_info.mojom.h" #include "ash/public/cpp/kiosk_app_menu.h"
#include "ash/root_window_controller.h" #include "ash/root_window_controller.h"
#include "ash/session/session_controller_impl.h" #include "ash/session/session_controller_impl.h"
#include "ash/session/test_session_controller_client.h" #include "ash/session/test_session_controller_client.h"
...@@ -264,15 +264,13 @@ TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterKioskAppsLoaded) { ...@@ -264,15 +264,13 @@ TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterKioskAppsLoaded) {
LoginShelfView::kBrowseAsGuest, LoginShelfView::kBrowseAsGuest,
LoginShelfView::kAddUser})); LoginShelfView::kAddUser}));
std::vector<mojom::KioskAppInfoPtr> kiosk_apps; std::vector<KioskAppMenuEntry> kiosk_apps(2);
kiosk_apps.push_back(mojom::KioskAppInfo::New()); login_shelf_view_->SetKioskApps(kiosk_apps, {});
kiosk_apps.push_back(mojom::KioskAppInfo::New());
login_shelf_view_->SetKioskApps(std::move(kiosk_apps));
EXPECT_TRUE(ShowsShelfButtons( EXPECT_TRUE(ShowsShelfButtons(
{LoginShelfView::kShutdown, LoginShelfView::kBrowseAsGuest, {LoginShelfView::kShutdown, LoginShelfView::kBrowseAsGuest,
LoginShelfView::kAddUser, LoginShelfView::kApps})); LoginShelfView::kAddUser, LoginShelfView::kApps}));
login_shelf_view_->SetKioskApps(std::vector<mojom::KioskAppInfoPtr>()); login_shelf_view_->SetKioskApps({}, {});
EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown, EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown,
LoginShelfView::kBrowseAsGuest, LoginShelfView::kBrowseAsGuest,
LoginShelfView::kAddUser})); LoginShelfView::kAddUser}));
...@@ -349,9 +347,8 @@ TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterDialogStateChange) { ...@@ -349,9 +347,8 @@ TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterDialogStateChange) {
// Kiosk app button is visible when dialog state == OobeDialogState::HIDDEN // Kiosk app button is visible when dialog state == OobeDialogState::HIDDEN
// or GAIA_SIGNIN. // or GAIA_SIGNIN.
login_shelf_view_->SetLoginDialogState(mojom::OobeDialogState::GAIA_SIGNIN); login_shelf_view_->SetLoginDialogState(mojom::OobeDialogState::GAIA_SIGNIN);
std::vector<mojom::KioskAppInfoPtr> kiosk_apps; std::vector<KioskAppMenuEntry> kiosk_apps(1);
kiosk_apps.push_back(mojom::KioskAppInfo::New()); login_shelf_view_->SetKioskApps(kiosk_apps, {});
login_shelf_view_->SetKioskApps(std::move(kiosk_apps));
EXPECT_TRUE( EXPECT_TRUE(
ShowsShelfButtons({LoginShelfView::kShutdown, LoginShelfView::kApps})); ShowsShelfButtons({LoginShelfView::kShutdown, LoginShelfView::kApps}));
...@@ -365,7 +362,7 @@ TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterDialogStateChange) { ...@@ -365,7 +362,7 @@ TEST_F(LoginShelfViewTest, ShouldUpdateUiAfterDialogStateChange) {
LoginShelfView::kApps})); LoginShelfView::kApps}));
// Kiosk app button is hidden when no app exists. // Kiosk app button is hidden when no app exists.
login_shelf_view_->SetKioskApps(std::vector<mojom::KioskAppInfoPtr>()); login_shelf_view_->SetKioskApps({}, {});
EXPECT_TRUE( EXPECT_TRUE(
ShowsShelfButtons({LoginShelfView::kShutdown, LoginShelfView::kAddUser})); ShowsShelfButtons({LoginShelfView::kShutdown, LoginShelfView::kAddUser}));
} }
......
...@@ -1373,8 +1373,8 @@ source_set("chromeos") { ...@@ -1373,8 +1373,8 @@ source_set("chromeos") {
"login/ui/captive_portal_window_proxy.h", "login/ui/captive_portal_window_proxy.h",
"login/ui/input_events_blocker.cc", "login/ui/input_events_blocker.cc",
"login/ui/input_events_blocker.h", "login/ui/input_events_blocker.h",
"login/ui/kiosk_app_menu_updater.cc", "login/ui/kiosk_app_menu_controller.cc",
"login/ui/kiosk_app_menu_updater.h", "login/ui/kiosk_app_menu_controller.h",
"login/ui/login_display.cc", "login/ui/login_display.cc",
"login/ui/login_display.h", "login/ui/login_display.h",
"login/ui/login_display_host.cc", "login/ui/login_display_host.cc",
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/chromeos/login/ui/kiosk_app_menu_updater.h" #include "chrome/browser/chromeos/login/ui/kiosk_app_menu_controller.h"
#include <utility> #include <utility>
#include "ash/public/interfaces/kiosk_app_info.mojom.h" #include "ash/public/cpp/kiosk_app_menu.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_data.h" #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_data.h"
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h"
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
#include "chrome/browser/ui/ash/login_screen_client.h" #include "chrome/browser/ui/ash/login_screen_client.h"
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
#include "extensions/grit/extensions_browser_resources.h" #include "extensions/grit/extensions_browser_resources.h"
...@@ -22,82 +23,74 @@ ...@@ -22,82 +23,74 @@
namespace chromeos { namespace chromeos {
KioskAppMenuUpdater::KioskAppMenuUpdater() KioskAppMenuController::KioskAppMenuController() {
: kiosk_observer_(this), arc_kiosk_observer_(this) {
kiosk_observer_.Add(KioskAppManager::Get()); kiosk_observer_.Add(KioskAppManager::Get());
arc_kiosk_observer_.Add(ArcKioskAppManager::Get()); arc_kiosk_observer_.Add(ArcKioskAppManager::Get());
} }
KioskAppMenuUpdater::~KioskAppMenuUpdater() = default; KioskAppMenuController::~KioskAppMenuController() = default;
void KioskAppMenuUpdater::OnKioskAppDataChanged(const std::string& app_id) { void KioskAppMenuController::OnKioskAppDataChanged(const std::string& app_id) {
SendKioskApps(); SendKioskApps();
} }
void KioskAppMenuUpdater::OnKioskAppDataLoadFailure(const std::string& app_id) { void KioskAppMenuController::OnKioskAppDataLoadFailure(
const std::string& app_id) {
SendKioskApps(); SendKioskApps();
} }
void KioskAppMenuUpdater::OnKioskAppsSettingsChanged() { void KioskAppMenuController::OnKioskAppsSettingsChanged() {
SendKioskApps(); SendKioskApps();
} }
void KioskAppMenuUpdater::OnArcKioskAppsChanged() { void KioskAppMenuController::OnArcKioskAppsChanged() {
SendKioskApps(); SendKioskApps();
} }
void KioskAppMenuUpdater::OnKioskAppsSet(bool success) { void KioskAppMenuController::SendKioskApps() {
if (!success)
return;
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_KIOSK_APPS_LOADED,
content::NotificationService::AllSources(),
content::NotificationService::NoDetails());
}
void KioskAppMenuUpdater::SendKioskApps() {
if (!LoginScreenClient::HasInstance()) if (!LoginScreenClient::HasInstance())
return; return;
std::vector<ash::mojom::KioskAppInfoPtr> output; std::vector<ash::KioskAppMenuEntry> output;
std::vector<KioskAppManager::App> apps; std::vector<KioskAppManager::App> apps;
KioskAppManager::Get()->GetApps(&apps); KioskAppManager::Get()->GetApps(&apps);
for (const auto& app : apps) { for (const auto& app : apps) {
auto mojo_app = ash::mojom::KioskAppInfo::New(); ash::KioskAppMenuEntry menu_entry;
mojo_app->identifier = ash::mojom::KioskAppIdentifier::New(); menu_entry.app_id = app.app_id;
mojo_app->identifier->set_app_id(app.app_id); menu_entry.name = base::UTF8ToUTF16(app.name);
mojo_app->name = base::UTF8ToUTF16(app.name);
if (app.icon.isNull()) { if (app.icon.isNull()) {
mojo_app->icon = *ui::ResourceBundle::GetSharedInstance() menu_entry.icon = *ui::ResourceBundle::GetSharedInstance()
.GetImageNamed(IDR_APP_DEFAULT_ICON) .GetImageNamed(IDR_APP_DEFAULT_ICON)
.ToImageSkia(); .ToImageSkia();
} else { } else {
mojo_app->icon = gfx::ImageSkia(app.icon); menu_entry.icon = app.icon;
} }
output.push_back(std::move(mojo_app)); output.push_back(std::move(menu_entry));
} }
std::vector<ArcKioskAppData*> arc_apps; std::vector<ArcKioskAppData*> arc_apps;
ArcKioskAppManager::Get()->GetAllApps(&arc_apps); ArcKioskAppManager::Get()->GetAllApps(&arc_apps);
for (ArcKioskAppData* app : arc_apps) { for (ArcKioskAppData* app : arc_apps) {
auto mojo_app = ash::mojom::KioskAppInfo::New(); ash::KioskAppMenuEntry menu_entry;
mojo_app->identifier = ash::mojom::KioskAppIdentifier::New(); menu_entry.account_id = app->account_id();
mojo_app->identifier->set_account_id(app->account_id()); menu_entry.name = base::UTF8ToUTF16(app->name());
mojo_app->name = base::UTF8ToUTF16(app->name());
if (app->icon().isNull()) { if (app->icon().isNull()) {
mojo_app->icon = *ui::ResourceBundle::GetSharedInstance() menu_entry.icon = *ui::ResourceBundle::GetSharedInstance()
.GetImageNamed(IDR_APP_DEFAULT_ICON) .GetImageNamed(IDR_APP_DEFAULT_ICON)
.ToImageSkia(); .ToImageSkia();
} else { } else {
mojo_app->icon = gfx::ImageSkia(app->icon()); menu_entry.icon = app->icon();
} }
output.push_back(std::move(mojo_app)); output.push_back(std::move(menu_entry));
} }
LoginScreenClient::Get()->login_screen()->SetKioskApps( ash::KioskAppMenu::Get()->SetKioskApps(
std::move(output), base::BindOnce(&KioskAppMenuUpdater::OnKioskAppsSet, output, base::BindRepeating(&KioskAppMenuController::LaunchApp,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_KIOSK_APPS_LOADED,
content::NotificationService::AllSources(),
content::NotificationService::NoDetails());
KioskAppLaunchError::Error error = KioskAppLaunchError::Get(); KioskAppLaunchError::Error error = KioskAppLaunchError::Get();
if (error == KioskAppLaunchError::NONE) if (error == KioskAppLaunchError::NONE)
...@@ -110,4 +103,14 @@ void KioskAppMenuUpdater::SendKioskApps() { ...@@ -110,4 +103,14 @@ void KioskAppMenuUpdater::SendKioskApps() {
KioskAppLaunchError::GetErrorMessage(error)); KioskAppLaunchError::GetErrorMessage(error));
} }
void KioskAppMenuController::LaunchApp(const ash::KioskAppMenuEntry& app) {
auto* host = chromeos::LoginDisplayHost::default_host();
if (!app.app_id.empty())
host->StartAppLaunch(app.app_id, false, false);
else if (app.account_id.is_valid())
host->StartArcKiosk(app.account_id);
else
NOTREACHED();
}
} // namespace chromeos } // namespace chromeos
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_KIOSK_APP_MENU_UPDATER_H_ #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_KIOSK_APP_MENU_CONTROLLER_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_UI_KIOSK_APP_MENU_UPDATER_H_ #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_KIOSK_APP_MENU_CONTROLLER_H_
#include "ash/public/cpp/kiosk_app_menu.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/scoped_observer.h" #include "base/scoped_observer.h"
...@@ -15,12 +16,12 @@ ...@@ -15,12 +16,12 @@
namespace chromeos { namespace chromeos {
// Observer class to update the Kiosk app menu when Kiosk app data is changed. // Observer class to update the Kiosk app menu when Kiosk app data is changed.
class KioskAppMenuUpdater class KioskAppMenuController
: public KioskAppManagerObserver, : public KioskAppManagerObserver,
public ArcKioskAppManager::ArcKioskAppManagerObserver { public ArcKioskAppManager::ArcKioskAppManagerObserver {
public: public:
KioskAppMenuUpdater(); KioskAppMenuController();
~KioskAppMenuUpdater() override; ~KioskAppMenuController() override;
// Manually dispatch kiosk app data to Ash. // Manually dispatch kiosk app data to Ash.
void SendKioskApps(); void SendKioskApps();
...@@ -34,17 +35,17 @@ class KioskAppMenuUpdater ...@@ -34,17 +35,17 @@ class KioskAppMenuUpdater
void OnArcKioskAppsChanged() override; void OnArcKioskAppsChanged() override;
private: private:
// Mojo SendKioskApps() callback. void LaunchApp(const ash::KioskAppMenuEntry& app);
void OnKioskAppsSet(bool success);
ScopedObserver<KioskAppManager, KioskAppMenuUpdater> kiosk_observer_; ScopedObserver<KioskAppManager, KioskAppMenuController> kiosk_observer_{this};
ScopedObserver<ArcKioskAppManager, KioskAppMenuUpdater> arc_kiosk_observer_; ScopedObserver<ArcKioskAppManager, KioskAppMenuController>
arc_kiosk_observer_{this};
base::WeakPtrFactory<KioskAppMenuUpdater> weak_factory_{this}; base::WeakPtrFactory<KioskAppMenuController> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(KioskAppMenuUpdater); DISALLOW_COPY_AND_ASSIGN(KioskAppMenuController);
}; };
} // namespace chromeos } // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_KIOSK_APP_MENU_UPDATER_H_ #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_KIOSK_APP_MENU_CONTROLLER_H_
...@@ -269,7 +269,7 @@ void LoginDisplayHostCommon::ShutdownDisplayHost() { ...@@ -269,7 +269,7 @@ void LoginDisplayHostCommon::ShutdownDisplayHost() {
} }
void LoginDisplayHostCommon::OnStartSignInScreenCommon() { void LoginDisplayHostCommon::OnStartSignInScreenCommon() {
kiosk_updater_.SendKioskApps(); kiosk_app_menu_controller_.SendKioskApps();
} }
void LoginDisplayHostCommon::ShowGaiaDialogCommon( void LoginDisplayHostCommon::ShowGaiaDialogCommon(
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "chrome/browser/chromeos/login/ui/kiosk_app_menu_updater.h" #include "chrome/browser/chromeos/login/ui/kiosk_app_menu_controller.h"
#include "chrome/browser/chromeos/login/ui/login_display_host.h" #include "chrome/browser/chromeos/login/ui/login_display_host.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"
...@@ -113,7 +113,7 @@ class LoginDisplayHostCommon : public LoginDisplayHost, ...@@ -113,7 +113,7 @@ class LoginDisplayHostCommon : public LoginDisplayHost,
// Called after host deletion. // Called after host deletion.
std::vector<base::OnceClosure> completion_callbacks_; std::vector<base::OnceClosure> completion_callbacks_;
KioskAppMenuUpdater kiosk_updater_; KioskAppMenuController kiosk_app_menu_controller_;
base::WeakPtrFactory<LoginDisplayHostCommon> weak_factory_; base::WeakPtrFactory<LoginDisplayHostCommon> weak_factory_;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h" #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
#include "chrome/browser/chromeos/base/locale_util.h" #include "chrome/browser/chromeos/base/locale_util.h"
#include "chrome/browser/chromeos/boot_times_recorder.h" #include "chrome/browser/chromeos/boot_times_recorder.h"
#include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h"
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "chrome/browser/chromeos/login/existing_user_controller.h" #include "chrome/browser/chromeos/login/existing_user_controller.h"
#include "chrome/browser/chromeos/login/oobe_configuration.h" #include "chrome/browser/chromeos/login/oobe_configuration.h"
#include "chrome/browser/chromeos/login/signin_screen_controller.h" #include "chrome/browser/chromeos/login/signin_screen_controller.h"
#include "chrome/browser/chromeos/login/ui/kiosk_app_menu_updater.h"
#include "chrome/browser/chromeos/login/ui/login_display.h" #include "chrome/browser/chromeos/login/ui/login_display.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_common.h" #include "chrome/browser/chromeos/login/ui/login_display_host_common.h"
#include "chrome/browser/chromeos/login/wizard_controller.h" #include "chrome/browser/chromeos/login/wizard_controller.h"
...@@ -273,9 +272,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon, ...@@ -273,9 +272,6 @@ class LoginDisplayHostWebUI : public LoginDisplayHostCommon,
// True if we need to play startup sound when audio device becomes available. // True if we need to play startup sound when audio device becomes available.
bool need_to_play_startup_sound_ = false; bool need_to_play_startup_sound_ = false;
// Updates shelf kiosk app list.
KioskAppMenuUpdater kiosk_updater_;
base::WeakPtrFactory<LoginDisplayHostWebUI> weak_factory_; base::WeakPtrFactory<LoginDisplayHostWebUI> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostWebUI); DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostWebUI);
......
...@@ -218,15 +218,6 @@ void LoginScreenClient::ShowFeedback() { ...@@ -218,15 +218,6 @@ void LoginScreenClient::ShowFeedback() {
chromeos::LoginDisplayHost::default_host()->ShowFeedback(); chromeos::LoginDisplayHost::default_host()->ShowFeedback();
} }
void LoginScreenClient::LaunchKioskApp(const std::string& app_id) {
chromeos::LoginDisplayHost::default_host()->StartAppLaunch(app_id, false,
false);
}
void LoginScreenClient::LaunchArcKioskApp(const AccountId& account_id) {
chromeos::LoginDisplayHost::default_host()->StartArcKiosk(account_id);
}
void LoginScreenClient::ShowResetScreen() { void LoginScreenClient::ShowResetScreen() {
chromeos::LoginDisplayHost::default_host()->ShowResetScreen(); chromeos::LoginDisplayHost::default_host()->ShowResetScreen();
} }
......
...@@ -125,8 +125,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient { ...@@ -125,8 +125,6 @@ class LoginScreenClient : public ash::mojom::LoginScreenClient {
void RequestPublicSessionKeyboardLayouts(const AccountId& account_id, void RequestPublicSessionKeyboardLayouts(const AccountId& account_id,
const std::string& locale) override; const std::string& locale) override;
void ShowFeedback() override; void ShowFeedback() override;
void LaunchKioskApp(const std::string& app_id) override;
void LaunchArcKioskApp(const AccountId& account_id) override;
void ShowResetScreen() override; void ShowResetScreen() override;
void ShowAccountAccessHelpApp() override; void ShowAccountAccessHelpApp() override;
void OnFocusLeavingSystemTray(bool reverse) override; void OnFocusLeavingSystemTray(bool reverse) override;
......
...@@ -113,10 +113,6 @@ void TestLoginScreen::SetPublicSessionKeyboardLayouts( ...@@ -113,10 +113,6 @@ void TestLoginScreen::SetPublicSessionKeyboardLayouts(
void TestLoginScreen::SetPublicSessionShowFullManagementDisclosure( void TestLoginScreen::SetPublicSessionShowFullManagementDisclosure(
bool show_full_management_disclosure) {} bool show_full_management_disclosure) {}
void TestLoginScreen::SetKioskApps(
std::vector<::ash::mojom::KioskAppInfoPtr> kiosk_apps,
SetKioskAppsCallback callback) {}
void TestLoginScreen::ShowKioskAppError(const std::string& message) {} void TestLoginScreen::ShowKioskAppError(const std::string& message) {}
void TestLoginScreen::NotifyOobeDialogState(ash::mojom::OobeDialogState state) { void TestLoginScreen::NotifyOobeDialogState(ash::mojom::OobeDialogState state) {
......
...@@ -74,8 +74,6 @@ class TestLoginScreen : public ash::mojom::LoginScreen { ...@@ -74,8 +74,6 @@ class TestLoginScreen : public ash::mojom::LoginScreen {
std::vector<::ash::mojom::InputMethodItemPtr> keyboard_layouts) override; std::vector<::ash::mojom::InputMethodItemPtr> keyboard_layouts) override;
void SetPublicSessionShowFullManagementDisclosure( void SetPublicSessionShowFullManagementDisclosure(
bool show_full_management_disclosure) override; bool show_full_management_disclosure) override;
void SetKioskApps(std::vector<::ash::mojom::KioskAppInfoPtr> kiosk_apps,
SetKioskAppsCallback callback) override;
void ShowKioskAppError(const std::string& message) override; void ShowKioskAppError(const std::string& message) override;
void NotifyOobeDialogState(ash::mojom::OobeDialogState state) override; void NotifyOobeDialogState(ash::mojom::OobeDialogState state) override;
void SetAddUserButtonEnabled(bool enable) override; void SetAddUserButtonEnabled(bool enable) override;
......
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