| Index: chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h
|
| diff --git a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h
|
| index 879daa85aebb8a3fe537661f8d393d0f654ecd62..bbfdb5936f472789b375acb046afd288f39f3416 100644
|
| --- a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h
|
| +++ b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h
|
| @@ -5,9 +5,13 @@
|
| #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_CORE_OOBE_HANDLER_H_
|
| #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_CORE_OOBE_HANDLER_H_
|
|
|
| +#include <memory>
|
| #include <string>
|
| +#include <vector>
|
|
|
| +#include "base/callback.h"
|
| #include "base/macros.h"
|
| +#include "base/values.h"
|
| #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
|
| #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h"
|
| #include "chrome/browser/chromeos/login/version_info_updater.h"
|
| @@ -70,6 +74,23 @@ class CoreOobeHandler : public BaseScreenHandler,
|
| void UpdateShutdownAndRebootVisibility(bool reboot_on_shutdown);
|
|
|
| private:
|
| + // Calls javascript method.
|
| + //
|
| + // Note that the Args template parameter pack should consist of types
|
| + // convertible to base::Value.
|
| + template <typename... Args>
|
| + void ExecuteDeferredJSCall(const std::string& function_name,
|
| + std::unique_ptr<Args>... args);
|
| +
|
| + // Calls javascript method if the instance is already initialized, or defers
|
| + // the call until it gets initialized.
|
| + template <typename... Args>
|
| + void CallJSOrDefer(const std::string& function_name, const Args&... args);
|
| +
|
| + // Executes javascript calls that were deferred while the instance was not
|
| + // initialized yet.
|
| + void ExecuteDeferredJSCalls();
|
| +
|
| // CoreOobeActor implementation:
|
| void ShowSignInError(int login_attempts,
|
| const std::string& error_text,
|
| @@ -135,6 +156,16 @@ class CoreOobeHandler : public BaseScreenHandler,
|
| void OnAccessibilityStatusChanged(
|
| const AccessibilityStatusEventDetails& details);
|
|
|
| + // Whether the instance is initialized.
|
| + //
|
| + // The instance becomes initialized after the corresponding message is
|
| + // received from javascript side.
|
| + bool is_initialized_;
|
| +
|
| + // Javascript calls that have been deferred while the instance was not
|
| + // initialized yet.
|
| + std::vector<base::Closure> deferred_js_calls_;
|
| +
|
| // Owner of this handler.
|
| OobeUI* oobe_ui_;
|
|
|
|
|