OLD | NEW |
---|---|
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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
532 // because the page load can happen in parallel to this UI thread | 532 // because the page load can happen in parallel to this UI thread |
533 // and IO thread may access the NetworkStateNotifier. | 533 // and IO thread may access the NetworkStateNotifier. |
534 chromeos::CrosLibrary::Get()->GetNetworkLibrary() | 534 chromeos::CrosLibrary::Get()->GetNetworkLibrary() |
535 ->AddNetworkManagerObserver( | 535 ->AddNetworkManagerObserver( |
536 chromeos::NetworkStateNotifier::GetInstance()); | 536 chromeos::NetworkStateNotifier::GetInstance()); |
537 } | 537 } |
538 #endif | 538 #endif |
539 | 539 |
540 // Continue with the incognito profile from here on if --incognito | 540 // Continue with the incognito profile from here on if --incognito |
541 if ((command_line.HasSwitch(switches::kIncognito) || | 541 if ((command_line.HasSwitch(switches::kIncognito) || |
542 profile->GetPrefs()->GetBoolean(prefs::kIncognitoForced)) && | 542 profile->GetPrefs()->GetBoolean(prefs::kIncognitoForced))) { |
543 profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)) { | 543 if (profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)) { |
544 profile = profile->GetOffTheRecordProfile(); | 544 profile = profile->GetOffTheRecordProfile(); |
545 } else { | |
546 LOG(ERROR) << "Incognito mode disabled by policy, launching a normal " | |
sky
2011/08/08 14:01:50
At best this should be a warning, not an error.
Joao da Silva
2011/08/08 17:34:40
Done.
| |
547 << "browser session."; | |
548 } | |
545 } | 549 } |
546 | 550 |
547 BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this); | 551 BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this); |
548 std::vector<GURL> urls_to_launch = BrowserInit::GetURLsFromCommandLine( | 552 std::vector<GURL> urls_to_launch = BrowserInit::GetURLsFromCommandLine( |
549 command_line, cur_dir, profile); | 553 command_line, cur_dir, profile); |
550 bool launched = lwp.Launch(profile, urls_to_launch, process_startup); | 554 bool launched = lwp.Launch(profile, urls_to_launch, process_startup); |
551 in_startup = false; | 555 in_startup = false; |
552 | 556 |
553 if (!launched) { | 557 if (!launched) { |
554 LOG(ERROR) << "launch error"; | 558 LOG(ERROR) << "launch error"; |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1442 return false; | 1446 return false; |
1443 automation->SetExpectedTabCount(expected_tabs); | 1447 automation->SetExpectedTabCount(expected_tabs); |
1444 | 1448 |
1445 AutomationProviderList* list = | 1449 AutomationProviderList* list = |
1446 g_browser_process->InitAutomationProviderList(); | 1450 g_browser_process->InitAutomationProviderList(); |
1447 DCHECK(list); | 1451 DCHECK(list); |
1448 list->AddProvider(automation); | 1452 list->AddProvider(automation); |
1449 | 1453 |
1450 return true; | 1454 return true; |
1451 } | 1455 } |
OLD | NEW |