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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 command_controller_(new chrome::BrowserCommandController(this)), | 358 command_controller_(new chrome::BrowserCommandController(this)), |
359 window_has_shown_(false), | 359 window_has_shown_(false), |
360 chrome_updater_factory_(this), | 360 chrome_updater_factory_(this), |
361 weak_factory_(this) { | 361 weak_factory_(this) { |
362 // If this causes a crash then a window is being opened using a profile type | 362 // If this causes a crash then a window is being opened using a profile type |
363 // that is disallowed by policy. The crash prevents the disabled window type | 363 // that is disallowed by policy. The crash prevents the disabled window type |
364 // from opening at all, but the path that triggered it should be fixed. | 364 // from opening at all, but the path that triggered it should be fixed. |
365 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); | 365 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); |
366 CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) | 366 CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) |
367 << "Only off the record browser may be opened in guest mode"; | 367 << "Only off the record browser may be opened in guest mode"; |
368 DCHECK(!profile_->IsSystemProfile()) | |
369 << "System profile should never have a real browser."; | |
msw
2015/05/21 17:48:12
nit: "The system profile"
Mike Lerman
2015/05/21 19:24:33
Done.
| |
370 // The SystemProfile should never open a real Browser. | |
msw
2015/05/21 17:48:12
nit: remove this comment, in lieu of the printed w
Mike Lerman
2015/05/21 19:24:33
Done.
| |
371 if (profile_->IsSystemProfile()) | |
372 content::RecordAction(base::UserMetricsAction("BrowserForSystemProfile")); | |
368 | 373 |
369 // TODO(jeremy): Move to initializer list once flag is removed. | 374 // TODO(jeremy): Move to initializer list once flag is removed. |
370 if (IsFastTabUnloadEnabled()) | 375 if (IsFastTabUnloadEnabled()) |
371 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); | 376 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); |
372 else | 377 else |
373 unload_controller_.reset(new chrome::UnloadController(this)); | 378 unload_controller_.reset(new chrome::UnloadController(this)); |
374 | 379 |
375 tab_strip_model_->AddObserver(this); | 380 tab_strip_model_->AddObserver(this); |
376 | 381 |
377 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); | 382 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); |
(...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2603 if (contents && !allow_js_access) { | 2608 if (contents && !allow_js_access) { |
2604 contents->web_contents()->GetController().LoadURL( | 2609 contents->web_contents()->GetController().LoadURL( |
2605 target_url, | 2610 target_url, |
2606 content::Referrer(), | 2611 content::Referrer(), |
2607 ui::PAGE_TRANSITION_LINK, | 2612 ui::PAGE_TRANSITION_LINK, |
2608 std::string()); // No extra headers. | 2613 std::string()); // No extra headers. |
2609 } | 2614 } |
2610 | 2615 |
2611 return contents != NULL; | 2616 return contents != NULL; |
2612 } | 2617 } |
OLD | NEW |