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

Unified Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 2420123002: Remove dependency from SignInBrowsertest on tracing events watching (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_)
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698