| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser_init.h" | 5 #include "chrome/browser/browser_init.h" |
| 6 | 6 |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 } | 661 } |
| 662 return true; | 662 return true; |
| 663 } | 663 } |
| 664 | 664 |
| 665 bool BrowserInit::LaunchBrowser(const CommandLine& parsed_command_line, | 665 bool BrowserInit::LaunchBrowser(const CommandLine& parsed_command_line, |
| 666 Profile* profile, | 666 Profile* profile, |
| 667 int show_command, const std::wstring& cur_dir, | 667 int show_command, const std::wstring& cur_dir, |
| 668 bool process_startup, int* return_code) { | 668 bool process_startup, int* return_code) { |
| 669 DCHECK(profile); | 669 DCHECK(profile); |
| 670 | 670 |
| 671 // Continue with the off-the-record profile from here on if --incognito |
| 672 if (parsed_command_line.HasSwitch(switches::kIncognito)) |
| 673 profile = profile->GetOffTheRecordProfile(); |
| 674 |
| 671 // Are we starting an application? | 675 // Are we starting an application? |
| 672 std::wstring app_url = parsed_command_line.GetSwitchValue(switches::kApp); | 676 std::wstring app_url = parsed_command_line.GetSwitchValue(switches::kApp); |
| 673 if (!app_url.empty()) { | 677 if (!app_url.empty()) { |
| 674 GURL url(app_url); | 678 GURL url(app_url); |
| 675 // If the application is started for a mailto:url, this machine has some | 679 // If the application is started for a mailto:url, this machine has some |
| 676 // old configuration that we should ignore. This hack saves us from some | 680 // old configuration that we should ignore. This hack saves us from some |
| 677 // infinite loops where we keep forwarding mailto: to the system, resulting | 681 // infinite loops where we keep forwarding mailto: to the system, resulting |
| 678 // in the system asking us to open the mailto app. | 682 // in the system asking us to open the mailto app. |
| 679 if (url.SchemeIs("mailto")) | 683 if (url.SchemeIs("mailto")) |
| 680 url = GURL("about:blank"); | 684 url = GURL("about:blank"); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 705 new AutomationProviderClass(profile); | 709 new AutomationProviderClass(profile); |
| 706 automation->ConnectToChannel(channel_id); | 710 automation->ConnectToChannel(channel_id); |
| 707 automation->SetExpectedTabCount(expected_tabs); | 711 automation->SetExpectedTabCount(expected_tabs); |
| 708 | 712 |
| 709 AutomationProviderList* list = | 713 AutomationProviderList* list = |
| 710 g_browser_process->InitAutomationProviderList(); | 714 g_browser_process->InitAutomationProviderList(); |
| 711 DCHECK(list); | 715 DCHECK(list); |
| 712 list->AddProvider(automation); | 716 list->AddProvider(automation); |
| 713 } | 717 } |
| 714 | 718 |
| OLD | NEW |