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

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

Issue 7562009: Print an error when trying to launch an incognito browser and incognito is disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed ERROR to WARNING, rebased Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_init.h" 5 #include "chrome/browser/ui/browser_init.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 chromeos::CrosLibrary::Get()->GetNetworkLibrary() 542 chromeos::CrosLibrary::Get()->GetNetworkLibrary()
543 ->AddNetworkManagerObserver( 543 ->AddNetworkManagerObserver(
544 chromeos::NetworkStateNotifier::GetInstance()); 544 chromeos::NetworkStateNotifier::GetInstance());
545 } 545 }
546 #endif 546 #endif
547 547
548 // Continue with the incognito profile from here on if Incognito mode 548 // Continue with the incognito profile from here on if Incognito mode
549 // is forced. 549 // is forced.
550 if (IncognitoIsForced(command_line, profile->GetPrefs())) { 550 if (IncognitoIsForced(command_line, profile->GetPrefs())) {
551 profile = profile->GetOffTheRecordProfile(); 551 profile = profile->GetOffTheRecordProfile();
552 } else if (command_line.HasSwitch(switches::kIncognito)) {
553 LOG(WARNING) << "Incognito mode disabled by policy, launching a normal "
554 << "browser session.";
552 } 555 }
553 556
554 BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this); 557 BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this);
555 std::vector<GURL> urls_to_launch = BrowserInit::GetURLsFromCommandLine( 558 std::vector<GURL> urls_to_launch = BrowserInit::GetURLsFromCommandLine(
556 command_line, cur_dir, profile); 559 command_line, cur_dir, profile);
557 bool launched = lwp.Launch(profile, urls_to_launch, process_startup); 560 bool launched = lwp.Launch(profile, urls_to_launch, process_startup);
558 in_startup = false; 561 in_startup = false;
559 562
560 if (!launched) { 563 if (!launched) {
561 LOG(ERROR) << "launch error"; 564 LOG(ERROR) << "launch error";
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 return false; 1452 return false;
1450 automation->SetExpectedTabCount(expected_tabs); 1453 automation->SetExpectedTabCount(expected_tabs);
1451 1454
1452 AutomationProviderList* list = 1455 AutomationProviderList* list =
1453 g_browser_process->InitAutomationProviderList(); 1456 g_browser_process->InitAutomationProviderList();
1454 DCHECK(list); 1457 DCHECK(list);
1455 list->AddProvider(automation); 1458 list->AddProvider(automation);
1456 1459
1457 return true; 1460 return true;
1458 } 1461 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698