Index: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
index 2516925aca9ae7e0e81c00db4ef1f9db33316843..50d6c646d2631b354f60126337c93a07db943a86 100644 |
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
@@ -113,6 +113,9 @@ const int kMaxGaiaReloadForProxyAuthDialog = 3; |
const char kSourceGaiaSignin[] = "gaia-signin"; |
const char kSourceAccountPicker[] = "account-picker"; |
+base::LazyInstance<base::Closure> g_ui_shown_callback_for_testing_ = |
+ LAZY_INSTANCE_INITIALIZER; |
stevenjb
2016/10/14 17:31:55
No trailing _ in file local variables.
If this is
Primiano Tucci (use gerrit)
2016/10/14 17:42:56
I am not sure I follow, how do you expect the g_cl
|
+ |
static bool Contains(const std::vector<std::string>& container, |
const std::string& value) { |
return std::find(container.begin(), container.end(), value) != |
@@ -364,6 +367,13 @@ void SigninScreenHandler::SetUserInputMethod( |
} |
} |
+// static |
+void SigninScreenHandler::SetCallbackOnUiShownForTesting( |
+ base::Closure callback) { |
+ DCHECK(g_ui_shown_callback_for_testing_.Get().is_null()); |
+ g_ui_shown_callback_for_testing_.Get() = callback; |
+} |
+ |
void SigninScreenHandler::DeclareLocalizedValues( |
::login::LocalizedValuesBuilder* builder) { |
// Format numbers to be used on the pin keyboard. |
@@ -1256,6 +1266,8 @@ void SigninScreenHandler::HandleLoginVisible(const std::string& source) { |
content::NotificationService::NoDetails()); |
TRACE_EVENT_ASYNC_END0( |
"ui", "ShowLoginWebUI", LoginDisplayHostImpl::kShowLoginWebUIid); |
+ if (!g_ui_shown_callback_for_testing_.Get().is_null()) |
+ g_ui_shown_callback_for_testing_.Get().Run(); |
} |
webui_visible_ = true; |
if (preferences_changed_delayed_) |