| 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "chrome/common/chrome_constants.h" | 38 #include "chrome/common/chrome_constants.h" |
| 39 #include "chrome/common/chrome_paths.h" | 39 #include "chrome/common/chrome_paths.h" |
| 40 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
| 41 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
| 42 #include "chrome/common/pref_service.h" | 42 #include "chrome/common/pref_service.h" |
| 43 #include "chrome/common/result_codes.h" | 43 #include "chrome/common/result_codes.h" |
| 44 #include "grit/chromium_strings.h" | 44 #include "grit/chromium_strings.h" |
| 45 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
| 46 #include "grit/locale_settings.h" | 46 #include "grit/locale_settings.h" |
| 47 #include "grit/theme_resources.h" | 47 #include "grit/theme_resources.h" |
| 48 #include "net/base/cookie_monster.h" | |
| 49 #include "webkit/glue/webkit_glue.h" | 48 #include "webkit/glue/webkit_glue.h" |
| 50 | 49 |
| 51 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 52 #include "base/win_util.h" | 51 #include "base/win_util.h" |
| 53 #endif | 52 #endif |
| 54 | 53 |
| 55 #ifdef FRAME_WINDOW | 54 #ifdef FRAME_WINDOW |
| 56 #include "frame_window/frame_window.h" | 55 #include "frame_window/frame_window.h" |
| 57 #endif | 56 #endif |
| 58 | 57 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 command_line_.GetSwitchValue(switches::kRemoteShellPort); | 396 command_line_.GetSwitchValue(switches::kRemoteShellPort); |
| 398 int64 port = StringToInt64(WideToUTF16Hack(port_str)); | 397 int64 port = StringToInt64(WideToUTF16Hack(port_str)); |
| 399 if (port > 0 && port < 65535) { | 398 if (port > 0 && port < 65535) { |
| 400 g_browser_process->InitDebuggerWrapper(static_cast<int>(port)); | 399 g_browser_process->InitDebuggerWrapper(static_cast<int>(port)); |
| 401 } else { | 400 } else { |
| 402 DLOG(WARNING) << "Invalid port number " << port; | 401 DLOG(WARNING) << "Invalid port number " << port; |
| 403 } | 402 } |
| 404 } | 403 } |
| 405 } | 404 } |
| 406 | 405 |
| 407 if (command_line_.HasSwitch(switches::kEnableFileCookies)) | |
| 408 net::CookieMonster::EnableFileScheme(); | |
| 409 | |
| 410 if (command_line_.HasSwitch(switches::kUserAgent)) { | 406 if (command_line_.HasSwitch(switches::kUserAgent)) { |
| 411 webkit_glue::SetUserAgent(WideToUTF8( | 407 webkit_glue::SetUserAgent(WideToUTF8( |
| 412 command_line_.GetSwitchValue(switches::kUserAgent))); | 408 command_line_.GetSwitchValue(switches::kUserAgent))); |
| 413 } | 409 } |
| 414 | 410 |
| 415 // Open the required browser windows and tabs. | 411 // Open the required browser windows and tabs. |
| 416 // First, see if we're being run as a web application (thin frame window). | 412 // First, see if we're being run as a web application (thin frame window). |
| 417 if (!OpenApplicationURL(profile)) { | 413 if (!OpenApplicationURL(profile)) { |
| 418 std::vector<GURL> urls_to_open = GetURLsFromCommandLine(profile_); | 414 std::vector<GURL> urls_to_open = GetURLsFromCommandLine(profile_); |
| 419 RecordLaunchModeHistogram(urls_to_open.empty()? | 415 RecordLaunchModeHistogram(urls_to_open.empty()? |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 scoped_refptr<AutomationProviderClass> automation = | 725 scoped_refptr<AutomationProviderClass> automation = |
| 730 new AutomationProviderClass(profile); | 726 new AutomationProviderClass(profile); |
| 731 automation->ConnectToChannel(channel_id); | 727 automation->ConnectToChannel(channel_id); |
| 732 automation->SetExpectedTabCount(expected_tabs); | 728 automation->SetExpectedTabCount(expected_tabs); |
| 733 | 729 |
| 734 AutomationProviderList* list = | 730 AutomationProviderList* list = |
| 735 g_browser_process->InitAutomationProviderList(); | 731 g_browser_process->InitAutomationProviderList(); |
| 736 DCHECK(list); | 732 DCHECK(list); |
| 737 list->AddProvider(automation); | 733 list->AddProvider(automation); |
| 738 } | 734 } |
| OLD | NEW |