Commit 39e7489d authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Add |AllowsBrowserWindows| CHECK to browser constructor

Static |Browser::Create| function calls |CanCreateBrowserForProfile| to
make sure the passed profile can be used to create browser.
Different items in this function are individually checked again in
browser constructor to return proper crash message if constructor is
called directly with a wrong profile, but |AllowsBrowserWindows| was
missing before and is now added.

Bug: 1033903
Change-Id: Iae710ed21243fddea3b54426eccae0077aba56c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1984317
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780283}
parent 25d1710b
......@@ -467,14 +467,7 @@ Browser::Browser(const CreateParams& params)
CHECK(g_browser_process);
CHECK(!g_browser_process->IsShuttingDown());
// If this causes a crash then a window is being opened using a profile type
// that is disallowed by policy. The crash prevents the disabled window type
// from opening at all, but the path that triggered it should be fixed.
CHECK(IncognitoModePrefs::CanOpenBrowser(profile_));
CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord())
<< "Only off the record browser may be opened in guest mode";
CHECK(!profile_->IsSystemProfile())
<< "The system profile should never have a real browser.";
CHECK(CanCreateBrowserForProfile(profile_));
tab_strip_model_->AddObserver(this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment