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

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

Issue 176032: Adding commandline option to override bans on certain port numbers through a ... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 3 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 | chrome/common/chrome_switches.h » ('j') | net/url_request/url_request_http_job.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 "webkit/glue/webkit_glue.h" 61 #include "webkit/glue/webkit_glue.h"
61 62
62 #if defined(OS_WIN) 63 #if defined(OS_WIN)
63 #include "base/win_util.h" 64 #include "base/win_util.h"
64 #endif 65 #endif
65 66
66 #if defined(OS_CHROMEOS) 67 #if defined(OS_CHROMEOS)
67 #include "chrome/browser/views/tabs/tab_overview_message_listener.h" 68 #include "chrome/browser/views/tabs/tab_overview_message_listener.h"
68 #endif 69 #endif
69 70
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 std::wstring path_string = 821 std::wstring path_string =
821 command_line.GetSwitchValue(switches::kInstallExtension); 822 command_line.GetSwitchValue(switches::kInstallExtension);
822 FilePath path = FilePath::FromWStringHack(path_string); 823 FilePath path = FilePath::FromWStringHack(path_string);
823 profile->GetExtensionsService()->InstallExtension(path); 824 profile->GetExtensionsService()->InstallExtension(path);
824 825
825 // If the chrome process was already running, install the extension without 826 // If the chrome process was already running, install the extension without
826 // popping up another browser window. 827 // popping up another browser window.
827 silent_launch = !process_startup; 828 silent_launch = !process_startup;
828 } 829 }
829 830
831 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) {
832 std::wstring allowed_ports =
833 command_line.GetSwitchValue(switches::kExplicitlyAllowedPorts);
834 URLRequestHttpJob::SetExplicitlyAllowedPorts(allowed_ports);
835 }
836
830 // 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
831 // of an automation request), we are done here. 838 // of an automation request), we are done here.
832 if (!silent_launch) { 839 if (!silent_launch) {
833 return LaunchBrowser(command_line, profile, cur_dir, process_startup, 840 return LaunchBrowser(command_line, profile, cur_dir, process_startup,
834 return_code, browser_init); 841 return_code, browser_init);
835 } 842 }
836 return true; 843 return true;
837 } 844 }
838 845
839 template <class AutomationProviderClass> 846 template <class AutomationProviderClass>
840 void BrowserInit::CreateAutomationProvider(const std::string& channel_id, 847 void BrowserInit::CreateAutomationProvider(const std::string& channel_id,
841 Profile* profile, 848 Profile* profile,
842 size_t expected_tabs) { 849 size_t expected_tabs) {
843 scoped_refptr<AutomationProviderClass> automation = 850 scoped_refptr<AutomationProviderClass> automation =
844 new AutomationProviderClass(profile); 851 new AutomationProviderClass(profile);
845 automation->ConnectToChannel(channel_id); 852 automation->ConnectToChannel(channel_id);
846 automation->SetExpectedTabCount(expected_tabs); 853 automation->SetExpectedTabCount(expected_tabs);
847 854
848 AutomationProviderList* list = 855 AutomationProviderList* list =
849 g_browser_process->InitAutomationProviderList(); 856 g_browser_process->InitAutomationProviderList();
850 DCHECK(list); 857 DCHECK(list);
851 list->AddProvider(automation); 858 list->AddProvider(automation);
852 } 859 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | net/url_request/url_request_http_job.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698