Index: chrome/browser/chromeos/login/screens/core_oobe_view.h |
diff --git a/chrome/browser/chromeos/login/screens/core_oobe_view.h b/chrome/browser/chromeos/login/screens/core_oobe_view.h |
index 4b5a0f96c0ee9b33786758eda47a967ab1ee6f9b..5d167da11e719a3db465058256fbf64d7fc72d67 100644 |
--- a/chrome/browser/chromeos/login/screens/core_oobe_view.h |
+++ b/chrome/browser/chromeos/login/screens/core_oobe_view.h |
@@ -8,6 +8,7 @@ |
#include <string> |
#include "chrome/browser/chromeos/login/help_app_launcher.h" |
+#include "chrome/browser/chromeos/login/oobe_screen.h" |
namespace base { |
class DictionaryValue; |
@@ -15,36 +16,70 @@ class DictionaryValue; |
namespace chromeos { |
+// CoreOobeView contains the API and general interface between the UI specific |
+// (Handlers) and the non-UI specific (Model) classes. |
+// |
+// The Model -> Handler API is declared inside of CoreOobeView, ie, Model |
+// classes invoke these methods which are defined inside of the Handlers. |
+// |
+// The Handler -> Model API is declared inside of CoreOobeView::Delegate, ie, |
+// Handler classes invoke these methods which are defined inside of the Models. |
+// |
+// Moving all of the existing Views and View::Delegates into this one class will |
+// help decouple the current Model/View/Handler setup, which will enable the |
+// UI-agnostic code to diverge from the UI implementation as it no longer needs |
+// a 1-1 association. Further, the entire API will be visible from one spot; |
+// this will enable significant deduplication. |
class CoreOobeView { |
public: |
- virtual ~CoreOobeView() {} |
+ class Delegate { |
+ public: |
+ virtual ~Delegate(); |
+ // Called when enable debugging screen has exited. |
+ virtual void OnEnableDebuggingScreenViewExit(bool success); |
+ |
+ // Called when the |view| has been destroyed and should no longer be used. |
+ virtual void OnViewDestroyed(CoreOobeView* view); |
+ }; |
+ |
+ virtual ~CoreOobeView(); |
+ |
+ // Set the CoreOobeView::Delegate instance so that derived CoreOobeView types |
+ // (aka JS Handlers) can call into generic login code (aka Models). |
+ virtual void SetDelegate(Delegate* delegate); |
+ |
+ // Called when the given |screen| should be shown. |
+ virtual void Show(OobeScreen screen); |
+ virtual void Hide(OobeScreen screen); |
+ |
+ // Associated with CoreOobeView: |
virtual void ShowSignInError(int login_attempts, |
const std::string& error_text, |
const std::string& help_link_text, |
- HelpAppLauncher::HelpTopic help_topic_id) = 0; |
- virtual void ShowTpmError() = 0; |
- virtual void ShowSignInUI(const std::string& email) = 0; |
- virtual void ResetSignInUI(bool force_online) = 0; |
- virtual void ClearUserPodPassword() = 0; |
- virtual void RefocusCurrentPod() = 0; |
+ HelpAppLauncher::HelpTopic help_topic_id); |
+ virtual void ShowTpmError(); |
+ virtual void ShowSignInUI(const std::string& email); |
+ virtual void ResetSignInUI(bool force_online); |
+ virtual void ClearUserPodPassword(); |
+ virtual void RefocusCurrentPod(); |
virtual void ShowPasswordChangedScreen(bool show_password_error, |
- const std::string& email) = 0; |
- virtual void SetUsageStats(bool checked) = 0; |
- virtual void SetOemEulaUrl(const std::string& oem_eula_url) = 0; |
- virtual void SetTpmPassword(const std::string& tmp_password) = 0; |
- virtual void ClearErrors() = 0; |
- virtual void ReloadContent(const base::DictionaryValue& dictionary) = 0; |
- virtual void ShowControlBar(bool show) = 0; |
- virtual void ShowPinKeyboard(bool show) = 0; |
- virtual void SetClientAreaSize(int width, int height) = 0; |
- virtual void ShowDeviceResetScreen() = 0; |
- virtual void ShowEnableDebuggingScreen() = 0; |
- virtual void InitDemoModeDetection() = 0; |
- virtual void StopDemoModeDetection() = 0; |
- virtual void UpdateKeyboardState() = 0; |
+ const std::string& email); |
+ virtual void SetUsageStats(bool checked); |
+ virtual void SetOemEulaUrl(const std::string& oem_eula_url); |
+ virtual void SetTpmPassword(const std::string& tmp_password); |
+ virtual void ClearErrors(); |
+ virtual void ReloadContent(const base::DictionaryValue& dictionary); |
+ virtual void ShowControlBar(bool show); |
+ virtual void ShowPinKeyboard(bool show); |
+ virtual void SetClientAreaSize(int width, int height); |
+ virtual void ShowDeviceResetScreen(); |
+ virtual void ShowEnableDebuggingScreen(); |
+ virtual void InitDemoModeDetection(); |
+ virtual void StopDemoModeDetection(); |
+ virtual void UpdateKeyboardState(); |
virtual void ShowActiveDirectoryPasswordChangeScreen( |
- const std::string& username) = 0; |
+ const std::string& username); |
}; |
} // namespace chromeos |