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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 weak_factory_(this), 338 weak_factory_(this),
339 content_setting_bubble_model_delegate_( 339 content_setting_bubble_model_delegate_(
340 new BrowserContentSettingBubbleModelDelegate(this)), 340 new BrowserContentSettingBubbleModelDelegate(this)),
341 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)), 341 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)),
342 tab_restore_service_delegate_(new BrowserTabRestoreServiceDelegate(this)), 342 tab_restore_service_delegate_(new BrowserTabRestoreServiceDelegate(this)),
343 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), 343 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)),
344 bookmark_bar_state_(BookmarkBar::HIDDEN), 344 bookmark_bar_state_(BookmarkBar::HIDDEN),
345 command_controller_(new chrome::BrowserCommandController( 345 command_controller_(new chrome::BrowserCommandController(
346 this, g_browser_process->profile_manager())), 346 this, g_browser_process->profile_manager())),
347 window_has_shown_(false) { 347 window_has_shown_(false) {
348 // If this causes a crash then a window is being opened using a profile type
349 // that is disallowed by policy. The crash prevents the disabled window type
350 // from opening at all, but the path that triggered it should be fixed.
351 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_));
352
348 if (!app_name_.empty()) 353 if (!app_name_.empty())
349 chrome::RegisterAppPrefs(app_name_, profile_); 354 chrome::RegisterAppPrefs(app_name_, profile_);
350 tab_strip_model_->AddObserver(this); 355 tab_strip_model_->AddObserver(this);
351 356
352 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); 357 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get()));
353 search_model_.reset(new SearchModel()); 358 search_model_.reset(new SearchModel());
354 search_delegate_.reset( 359 search_delegate_.reset(
355 new SearchDelegate(search_model_.get(), toolbar_model_.get())); 360 new SearchDelegate(search_model_.get(), toolbar_model_.get()));
356 361
357 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 362 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 if (contents && !allow_js_access) { 2215 if (contents && !allow_js_access) {
2211 contents->web_contents()->GetController().LoadURL( 2216 contents->web_contents()->GetController().LoadURL(
2212 target_url, 2217 target_url,
2213 content::Referrer(), 2218 content::Referrer(),
2214 content::PAGE_TRANSITION_LINK, 2219 content::PAGE_TRANSITION_LINK,
2215 std::string()); // No extra headers. 2220 std::string()); // No extra headers.
2216 } 2221 }
2217 2222
2218 return contents != NULL; 2223 return contents != NULL;
2219 } 2224 }
OLDNEW
« 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