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

Unified Diff: chrome/browser/ui/webui/chromeos/login/oobe_ui.h

Issue 2713513009: cros: Break BaseScreenHandler into two classes. (Closed)
Patch Set: Add comments, fix compile Created 3 years, 10 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/chromeos/login/oobe_ui.h
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h
index 73748fe32a00ae6897cc912fc16073cee20450c3..b7d9be0a03f86bcaaccdf98dea436efe586c65b8 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h
@@ -16,6 +16,7 @@
#include "base/observer_list.h"
#include "chrome/browser/chromeos/login/oobe_screen.h"
#include "chrome/browser/chromeos/settings/shutdown_policy_handler.h"
+#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h"
#include "content/public/browser/web_ui_controller.h"
@@ -40,9 +41,7 @@ class EnableDebuggingScreenView;
class EnrollmentScreenView;
class EulaView;
class ErrorScreen;
-class ErrorScreenHandler;
class GaiaView;
-class GaiaScreenHandler;
class HIDDetectionView;
class HostPairingScreenView;
class KioskAppMenuHandler;
@@ -58,7 +57,6 @@ class SigninScreenHandlerDelegate;
class SupervisedUserCreationScreenHandler;
class ResetView;
class TermsOfServiceScreenView;
-class UserBoardScreenHandler;
class UserBoardView;
class UserImageView;
class UpdateView;
@@ -169,6 +167,21 @@ class OobeUI : public content::WebUIController,
void UpdateLocalizedStringsIfNeeded();
private:
+ // Lookup a view by its statically registered OobeScreen.
+ template <typename TView>
+ TView* GetView() {
+ OobeScreen expected_screen = TView::kScreenId;
+ for (BaseScreenHandler* handler : screen_handlers_) {
+ if (expected_screen == handler->oobe_screen())
+ return static_cast<TView*>(handler);
+ }
+
+ NOTREACHED() << "Unable to find handler for screen "
+ << GetOobeScreenName(expected_screen);
+ return nullptr;
+ }
+
+ void AddWebUIHandler(std::unique_ptr<BaseWebUIHandler> handler);
void AddScreenHandler(std::unique_ptr<BaseScreenHandler> handler);
// CoreOobeHandler::Delegate implementation:
@@ -188,47 +201,14 @@ class OobeUI : public content::WebUIController,
// network dropdown.
NetworkDropdownHandler* network_dropdown_handler_ = nullptr;
- // Screens views. Note, OobeUI owns them via |handlers_|, not directly here.
- UpdateView* update_view_ = nullptr;
- NetworkView* network_view_ = nullptr;
- EnableDebuggingScreenView* debugging_screen_view_ = nullptr;
- EulaView* eula_view_ = nullptr;
- EnrollmentScreenView* enrollment_screen_view_ = nullptr;
- ResetView* reset_view_ = nullptr;
- HIDDetectionView* hid_detection_view_ = nullptr;
- KioskAutolaunchScreenView* autolaunch_screen_view_ = nullptr;
- KioskEnableScreenView* kiosk_enable_screen_view_ = nullptr;
- WrongHWIDScreenView* wrong_hwid_screen_view_ = nullptr;
- AutoEnrollmentCheckScreenView* auto_enrollment_check_screen_view_ = nullptr;
SupervisedUserCreationScreenHandler* supervised_user_creation_screen_view_ =
nullptr;
- AppLaunchSplashScreenView* app_launch_splash_screen_view_ = nullptr;
- ArcKioskSplashScreenView* arc_kiosk_splash_screen_view_ = nullptr;
- ControllerPairingScreenView* controller_pairing_screen_view_ = nullptr;
- HostPairingScreenView* host_pairing_screen_view_ = nullptr;
- DeviceDisabledScreenView* device_disabled_screen_view_ = nullptr;
-
- // Reference to ErrorScreenHandler that handles error screen
- // requests and forward calls from native code to JS side.
- ErrorScreenHandler* error_screen_handler_ = nullptr;
-
- // Reference to GaiaScreenHandler that handles gaia screen requests and
- // forwards calls from native code to JS side.
- GaiaScreenHandler* gaia_screen_handler_ = nullptr;
-
- // Reference to UserBoardScreenHandler, that allows to pick user on device
- // and attempt authentication.
- UserBoardScreenHandler* user_board_screen_handler_ = nullptr;
-
// Reference to SigninScreenHandler that handles sign-in screen requests and
// forwards calls from native code to JS side.
SigninScreenHandler* signin_screen_handler_ = nullptr;
- TermsOfServiceScreenView* terms_of_service_screen_view_ = nullptr;
- ArcTermsOfServiceScreenView* arc_terms_of_service_screen_view_ = nullptr;
- UserImageView* user_image_view_ = nullptr;
-
- std::vector<BaseScreenHandler*> handlers_; // Non-owning pointers.
+ std::vector<BaseWebUIHandler*> webui_handlers_; // Non-owning pointers.
+ std::vector<BaseScreenHandler*> screen_handlers_; // Non-owning pointers.
KioskAppMenuHandler* kiosk_app_menu_handler_ =
nullptr; // Non-owning pointers.
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc ('k') | chrome/browser/ui/webui/chromeos/login/oobe_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698