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

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

Issue 15670011: Prevent new Browser windows from violating the IncognitoModeAvailability policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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 | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index b0db2f10ed44c15240092c10419977f07e2316c1..0ca48d26da783636e7dbbf8eae2221af65fcfae6 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -345,6 +345,11 @@ Browser::Browser(const CreateParams& params)
command_controller_(new chrome::BrowserCommandController(
this, g_browser_process->profile_manager())),
window_has_shown_(false) {
+ // 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_));
+
if (!app_name_.empty())
chrome::RegisterAppPrefs(app_name_, profile_);
tab_strip_model_->AddObserver(this);
« no previous file with comments | « no previous file | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698