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 << "The system profile should never have a real browser."; |
| 370 // TODO(mlerman): After this hits stable channel, see if there are counts |
| 371 // for this metric. If not, change the DCHECK above to a CHECK. |
| 372 if (profile_->IsSystemProfile()) |
| 373 content::RecordAction(base::UserMetricsAction("BrowserForSystemProfile")); |
368 | 374 |
369 // TODO(jeremy): Move to initializer list once flag is removed. | 375 // TODO(jeremy): Move to initializer list once flag is removed. |
370 if (IsFastTabUnloadEnabled()) | 376 if (IsFastTabUnloadEnabled()) |
371 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); | 377 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); |
372 else | 378 else |
373 unload_controller_.reset(new chrome::UnloadController(this)); | 379 unload_controller_.reset(new chrome::UnloadController(this)); |
374 | 380 |
375 tab_strip_model_->AddObserver(this); | 381 tab_strip_model_->AddObserver(this); |
376 | 382 |
377 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); | 383 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) { | 2609 if (contents && !allow_js_access) { |
2604 contents->web_contents()->GetController().LoadURL( | 2610 contents->web_contents()->GetController().LoadURL( |
2605 target_url, | 2611 target_url, |
2606 content::Referrer(), | 2612 content::Referrer(), |
2607 ui::PAGE_TRANSITION_LINK, | 2613 ui::PAGE_TRANSITION_LINK, |
2608 std::string()); // No extra headers. | 2614 std::string()); // No extra headers. |
2609 } | 2615 } |
2610 | 2616 |
2611 return contents != NULL; | 2617 return contents != NULL; |
2612 } | 2618 } |
OLD | NEW |