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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 1129293002: Fix the System Profile with extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: and a few fewer unnecessary checks Created 5 years, 7 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
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
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());
msw 2015/05/21 04:34:43 nit: maybe use CHECK instead of DCHECK? Then elimi
Mike Lerman 2015/05/21 15:27:31 I'm glad you brought this up. We talked about this
msw 2015/05/21 17:48:12 Hmm, that sounds ok, I hope we find some way forwa
Mike Lerman 2015/05/21 19:24:33 I hope so - knowing how many users there are will
369 // The SystemProfile should never open a real Browser.
msw 2015/05/21 04:34:43 nit: maybe print this comment as a warning with th
Mike Lerman 2015/05/21 15:27:31 Done.
370 if (profile_->IsSystemProfile())
371 content::RecordAction(base::UserMetricsAction("BrowserForSystemProfile"));
368 372
369 // TODO(jeremy): Move to initializer list once flag is removed. 373 // TODO(jeremy): Move to initializer list once flag is removed.
370 if (IsFastTabUnloadEnabled()) 374 if (IsFastTabUnloadEnabled())
371 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); 375 fast_unload_controller_.reset(new chrome::FastUnloadController(this));
372 else 376 else
373 unload_controller_.reset(new chrome::UnloadController(this)); 377 unload_controller_.reset(new chrome::UnloadController(this));
374 378
375 tab_strip_model_->AddObserver(this); 379 tab_strip_model_->AddObserver(this);
376 380
377 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); 381 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get()));
(...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after
2603 if (contents && !allow_js_access) { 2607 if (contents && !allow_js_access) {
2604 contents->web_contents()->GetController().LoadURL( 2608 contents->web_contents()->GetController().LoadURL(
2605 target_url, 2609 target_url,
2606 content::Referrer(), 2610 content::Referrer(),
2607 ui::PAGE_TRANSITION_LINK, 2611 ui::PAGE_TRANSITION_LINK,
2608 std::string()); // No extra headers. 2612 std::string()); // No extra headers.
2609 } 2613 }
2610 2614
2611 return contents != NULL; 2615 return contents != NULL;
2612 } 2616 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698