| 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 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), | 361 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), |
| 362 bookmark_bar_state_(BookmarkBar::HIDDEN), | 362 bookmark_bar_state_(BookmarkBar::HIDDEN), |
| 363 command_controller_(new chrome::BrowserCommandController(this)), | 363 command_controller_(new chrome::BrowserCommandController(this)), |
| 364 window_has_shown_(false), | 364 window_has_shown_(false), |
| 365 chrome_updater_factory_(this), | 365 chrome_updater_factory_(this), |
| 366 weak_factory_(this) { | 366 weak_factory_(this) { |
| 367 // If this causes a crash then a window is being opened using a profile type | 367 // If this causes a crash then a window is being opened using a profile type |
| 368 // that is disallowed by policy. The crash prevents the disabled window type | 368 // that is disallowed by policy. The crash prevents the disabled window type |
| 369 // from opening at all, but the path that triggered it should be fixed. | 369 // from opening at all, but the path that triggered it should be fixed. |
| 370 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); | 370 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); |
| 371 CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) | 371 // Only off the record browser may be opened in guest mode |
| 372 << "Only off the record browser may be opened in guest mode"; | 372 CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()); |
| 373 DCHECK(!profile_->IsSystemProfile()) | 373 DCHECK(!profile_->IsSystemProfile()) |
| 374 << "The system profile should never have a real browser."; | 374 << "The system profile should never have a real browser."; |
| 375 // TODO(mlerman): After this hits stable channel, see if there are counts | 375 // TODO(mlerman): After this hits stable channel, see if there are counts |
| 376 // for this metric. If not, change the DCHECK above to a CHECK. | 376 // for this metric. If not, change the DCHECK above to a CHECK. |
| 377 if (profile_->IsSystemProfile()) | 377 if (profile_->IsSystemProfile()) |
| 378 content::RecordAction(base::UserMetricsAction("BrowserForSystemProfile")); | 378 content::RecordAction(base::UserMetricsAction("BrowserForSystemProfile")); |
| 379 | 379 |
| 380 // TODO(jeremy): Move to initializer list once flag is removed. | 380 // TODO(jeremy): Move to initializer list once flag is removed. |
| 381 if (IsFastTabUnloadEnabled()) | 381 if (IsFastTabUnloadEnabled()) |
| 382 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); | 382 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); |
| (...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2600 // new window later, thus we need to navigate the window now. | 2600 // new window later, thus we need to navigate the window now. |
| 2601 if (contents) { | 2601 if (contents) { |
| 2602 contents->web_contents()->GetController().LoadURL( | 2602 contents->web_contents()->GetController().LoadURL( |
| 2603 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, | 2603 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, |
| 2604 std::string()); // No extra headers. | 2604 std::string()); // No extra headers. |
| 2605 } | 2605 } |
| 2606 } | 2606 } |
| 2607 | 2607 |
| 2608 return contents != NULL; | 2608 return contents != NULL; |
| 2609 } | 2609 } |
| OLD | NEW |