OLD | NEW |
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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 command_controller_(new chrome::BrowserCommandController( | 348 command_controller_(new chrome::BrowserCommandController( |
349 this, g_browser_process->profile_manager())), | 349 this, g_browser_process->profile_manager())), |
350 window_has_shown_(false), | 350 window_has_shown_(false), |
351 chrome_updater_factory_(this), | 351 chrome_updater_factory_(this), |
352 weak_factory_(this), | 352 weak_factory_(this), |
353 language_state_observer_(new BrowserLanguageStateObserver(this)) { | 353 language_state_observer_(new BrowserLanguageStateObserver(this)) { |
354 // If this causes a crash then a window is being opened using a profile type | 354 // If this causes a crash then a window is being opened using a profile type |
355 // that is disallowed by policy. The crash prevents the disabled window type | 355 // that is disallowed by policy. The crash prevents the disabled window type |
356 // from opening at all, but the path that triggered it should be fixed. | 356 // from opening at all, but the path that triggered it should be fixed. |
357 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); | 357 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); |
| 358 CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) |
| 359 << "Only off the record browser may be opened in guest mode"; |
358 | 360 |
359 // TODO(jeremy): Move to initializer list once flag is removed. | 361 // TODO(jeremy): Move to initializer list once flag is removed. |
360 if (IsFastTabUnloadEnabled()) | 362 if (IsFastTabUnloadEnabled()) |
361 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); | 363 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); |
362 else | 364 else |
363 unload_controller_.reset(new chrome::UnloadController(this)); | 365 unload_controller_.reset(new chrome::UnloadController(this)); |
364 | 366 |
365 if (!app_name_.empty()) | 367 if (!app_name_.empty()) |
366 chrome::RegisterAppPrefs(app_name_, profile_); | 368 chrome::RegisterAppPrefs(app_name_, profile_); |
367 tab_strip_model_->AddObserver(this); | 369 tab_strip_model_->AddObserver(this); |
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2289 if (contents && !allow_js_access) { | 2291 if (contents && !allow_js_access) { |
2290 contents->web_contents()->GetController().LoadURL( | 2292 contents->web_contents()->GetController().LoadURL( |
2291 target_url, | 2293 target_url, |
2292 content::Referrer(), | 2294 content::Referrer(), |
2293 content::PAGE_TRANSITION_LINK, | 2295 content::PAGE_TRANSITION_LINK, |
2294 std::string()); // No extra headers. | 2296 std::string()); // No extra headers. |
2295 } | 2297 } |
2296 | 2298 |
2297 return contents != NULL; | 2299 return contents != NULL; |
2298 } | 2300 } |
OLD | NEW |