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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include "app/win_util.h" | 10 #include "app/win_util.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "chrome/common/chrome_paths.h" | 50 #include "chrome/common/chrome_paths.h" |
51 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
52 #include "chrome/common/pref_names.h" | 52 #include "chrome/common/pref_names.h" |
53 #include "chrome/common/pref_service.h" | 53 #include "chrome/common/pref_service.h" |
54 #include "chrome/common/result_codes.h" | 54 #include "chrome/common/result_codes.h" |
55 #include "chrome/common/url_constants.h" | 55 #include "chrome/common/url_constants.h" |
56 #include "grit/chromium_strings.h" | 56 #include "grit/chromium_strings.h" |
57 #include "grit/generated_resources.h" | 57 #include "grit/generated_resources.h" |
58 #include "grit/locale_settings.h" | 58 #include "grit/locale_settings.h" |
59 #include "grit/theme_resources.h" | 59 #include "grit/theme_resources.h" |
60 #include "net/url_request/url_request_http_job.h" | 60 #include "net/base/net_util.h" |
61 #include "webkit/glue/webkit_glue.h" | 61 #include "webkit/glue/webkit_glue.h" |
62 | 62 |
63 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
64 #include "base/win_util.h" | 64 #include "base/win_util.h" |
65 #endif | 65 #endif |
66 | 66 |
67 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
68 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 68 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
69 #include "chrome/browser/views/tabs/tab_overview_message_listener.h" | 69 #include "chrome/browser/views/tabs/tab_overview_message_listener.h" |
70 #endif | 70 #endif |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 FilePath path = FilePath::FromWStringHack(path_string); | 823 FilePath path = FilePath::FromWStringHack(path_string); |
824 profile->GetExtensionsService()->InstallExtension(path); | 824 profile->GetExtensionsService()->InstallExtension(path); |
825 | 825 |
826 // If the chrome process was already running, install the extension without | 826 // If the chrome process was already running, install the extension without |
827 // popping up another browser window. | 827 // popping up another browser window. |
828 silent_launch = !process_startup; | 828 silent_launch = !process_startup; |
829 } | 829 } |
830 | 830 |
831 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { | 831 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { |
832 std::wstring allowed_ports = | 832 std::wstring allowed_ports = |
833 command_line.GetSwitchValue(switches::kExplicitlyAllowedPorts); | 833 command_line.GetSwitchValue(switches::kExplicitlyAllowedPorts); |
834 URLRequestHttpJob::SetExplicitlyAllowedPorts(allowed_ports); | 834 net::SetExplicitlyAllowedPorts(allowed_ports); |
835 } | 835 } |
836 | 836 |
837 // If we don't want to launch a new browser window or tab (in the case | 837 // If we don't want to launch a new browser window or tab (in the case |
838 // of an automation request), we are done here. | 838 // of an automation request), we are done here. |
839 if (!silent_launch) { | 839 if (!silent_launch) { |
840 return LaunchBrowser(command_line, profile, cur_dir, process_startup, | 840 return LaunchBrowser(command_line, profile, cur_dir, process_startup, |
841 return_code, browser_init); | 841 return_code, browser_init); |
842 } | 842 } |
843 return true; | 843 return true; |
844 } | 844 } |
845 | 845 |
846 template <class AutomationProviderClass> | 846 template <class AutomationProviderClass> |
847 void BrowserInit::CreateAutomationProvider(const std::string& channel_id, | 847 void BrowserInit::CreateAutomationProvider(const std::string& channel_id, |
848 Profile* profile, | 848 Profile* profile, |
849 size_t expected_tabs) { | 849 size_t expected_tabs) { |
850 scoped_refptr<AutomationProviderClass> automation = | 850 scoped_refptr<AutomationProviderClass> automation = |
851 new AutomationProviderClass(profile); | 851 new AutomationProviderClass(profile); |
852 automation->ConnectToChannel(channel_id); | 852 automation->ConnectToChannel(channel_id); |
853 automation->SetExpectedTabCount(expected_tabs); | 853 automation->SetExpectedTabCount(expected_tabs); |
854 | 854 |
855 AutomationProviderList* list = | 855 AutomationProviderList* list = |
856 g_browser_process->InitAutomationProviderList(); | 856 g_browser_process->InitAutomationProviderList(); |
857 DCHECK(list); | 857 DCHECK(list); |
858 list->AddProvider(automation); | 858 list->AddProvider(automation); |
859 } | 859 } |
OLD | NEW |