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

Unified Diff: chrome/browser/ui/webui/welcome_handler.cc

Issue 2431543003: WelcomeHandler sometimes has browser_ null in ctor (Closed)
Patch Set: Fix WelcomeHandler crash when signin link is clicked. 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/welcome_handler.cc
diff --git a/chrome/browser/ui/webui/welcome_handler.cc b/chrome/browser/ui/webui/welcome_handler.cc
index f23d092abea7153cdd0a8f17eaad2eb1b8817692..b06ea2bd3d9e8ddabc356fdf3ce930e56904d5d7 100644
--- a/chrome/browser/ui/webui/welcome_handler.cc
+++ b/chrome/browser/ui/webui/welcome_handler.cc
@@ -46,6 +46,11 @@ void WelcomeHandler::HandleActivateSignIn(const base::ListValue* args) {
// them away to the NTP instead.
GoToNewTabPage();
} else {
+ // browser_ does not always properly initialize in the constructor.
+ // https://crbug.com/656153
dpapad 2016/10/18 18:17:02 +dbeam who might know more about WebUI lifetime re
+ if (browser_ == nullptr) {
+ browser_ = chrome::FindBrowserWithWebContents(web_ui()->GetWebContents());
+ }
browser_->ShowModalSigninWindow(
profiles::BubbleViewMode::BUBBLE_VIEW_MODE_GAIA_SIGNIN,
signin_metrics::AccessPoint::ACCESS_POINT_START_PAGE);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698