OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> // For max(). | 7 #include <algorithm> // For max(). |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/defaults.h" | 28 #include "chrome/browser/defaults.h" |
29 #include "chrome/browser/extensions/extension_creator.h" | 29 #include "chrome/browser/extensions/extension_creator.h" |
30 #include "chrome/browser/extensions/extensions_service.h" | 30 #include "chrome/browser/extensions/extensions_service.h" |
31 #include "chrome/browser/extensions/pack_extension_job.h" | 31 #include "chrome/browser/extensions/pack_extension_job.h" |
32 #include "chrome/browser/first_run/first_run.h" | 32 #include "chrome/browser/first_run/first_run.h" |
33 #include "chrome/browser/net/predictor_api.h" | 33 #include "chrome/browser/net/predictor_api.h" |
34 #include "chrome/browser/net/url_fixer_upper.h" | 34 #include "chrome/browser/net/url_fixer_upper.h" |
35 #include "chrome/browser/notifications/desktop_notification_service.h" | 35 #include "chrome/browser/notifications/desktop_notification_service.h" |
36 #include "chrome/browser/prefs/pref_service.h" | 36 #include "chrome/browser/prefs/pref_service.h" |
37 #include "chrome/browser/prefs/session_startup_pref.h" | 37 #include "chrome/browser/prefs/session_startup_pref.h" |
| 38 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
38 #include "chrome/browser/profile.h" | 39 #include "chrome/browser/profile.h" |
39 #include "chrome/browser/renderer_host/render_process_host.h" | 40 #include "chrome/browser/renderer_host/render_process_host.h" |
40 #include "chrome/browser/search_engines/template_url.h" | 41 #include "chrome/browser/search_engines/template_url.h" |
41 #include "chrome/browser/search_engines/template_url_model.h" | 42 #include "chrome/browser/search_engines/template_url_model.h" |
42 #include "chrome/browser/sessions/session_restore.h" | 43 #include "chrome/browser/sessions/session_restore.h" |
43 #include "chrome/browser/sessions/session_service.h" | 44 #include "chrome/browser/sessions/session_service.h" |
44 #include "chrome/browser/shell_integration.h" | 45 #include "chrome/browser/shell_integration.h" |
45 #include "chrome/browser/tab_contents/infobar_delegate.h" | 46 #include "chrome/browser/tab_contents/infobar_delegate.h" |
46 #include "chrome/browser/tab_contents/navigation_controller.h" | 47 #include "chrome/browser/tab_contents/navigation_controller.h" |
47 #include "chrome/browser/tab_contents/tab_contents.h" | 48 #include "chrome/browser/tab_contents/tab_contents.h" |
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 | 1042 |
1042 if (command_line.HasSwitch(switches::kChromeFrame)) { | 1043 if (command_line.HasSwitch(switches::kChromeFrame)) { |
1043 CreateAutomationProvider<ChromeFrameAutomationProvider>( | 1044 CreateAutomationProvider<ChromeFrameAutomationProvider>( |
1044 automation_channel_id, profile, expected_tabs); | 1045 automation_channel_id, profile, expected_tabs); |
1045 } else { | 1046 } else { |
1046 CreateAutomationProvider<AutomationProvider>(automation_channel_id, | 1047 CreateAutomationProvider<AutomationProvider>(automation_channel_id, |
1047 profile, expected_tabs); | 1048 profile, expected_tabs); |
1048 } | 1049 } |
1049 } | 1050 } |
1050 | 1051 |
| 1052 // If we have been invoked to display a desktop notification on behalf of |
| 1053 // the service process, we do not want to open any browser windows. |
| 1054 if (command_line.HasSwitch(switches::kNotifyCloudPrintTokenExpired)) { |
| 1055 silent_launch = true; |
| 1056 profile->GetCloudPrintProxyService()->ShowTokenExpiredNotification(); |
| 1057 } |
| 1058 |
1051 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { | 1059 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { |
1052 std::string allowed_ports = | 1060 std::string allowed_ports = |
1053 command_line.GetSwitchValueASCII(switches::kExplicitlyAllowedPorts); | 1061 command_line.GetSwitchValueASCII(switches::kExplicitlyAllowedPorts); |
1054 net::SetExplicitlyAllowedPorts(allowed_ports); | 1062 net::SetExplicitlyAllowedPorts(allowed_ports); |
1055 } | 1063 } |
1056 | 1064 |
1057 #if defined(OS_CHROMEOS) | 1065 #if defined(OS_CHROMEOS) |
1058 // The browser will be launched after the user logs in. | 1066 // The browser will be launched after the user logs in. |
1059 if (command_line.HasSwitch(switches::kLoginManager) || | 1067 if (command_line.HasSwitch(switches::kLoginManager) || |
1060 command_line.HasSwitch(switches::kLoginPassword)) { | 1068 command_line.HasSwitch(switches::kLoginPassword)) { |
(...skipping 17 matching lines...) Expand all Loading... |
1078 scoped_refptr<AutomationProviderClass> automation = | 1086 scoped_refptr<AutomationProviderClass> automation = |
1079 new AutomationProviderClass(profile); | 1087 new AutomationProviderClass(profile); |
1080 automation->ConnectToChannel(channel_id); | 1088 automation->ConnectToChannel(channel_id); |
1081 automation->SetExpectedTabCount(expected_tabs); | 1089 automation->SetExpectedTabCount(expected_tabs); |
1082 | 1090 |
1083 AutomationProviderList* list = | 1091 AutomationProviderList* list = |
1084 g_browser_process->InitAutomationProviderList(); | 1092 g_browser_process->InitAutomationProviderList(); |
1085 DCHECK(list); | 1093 DCHECK(list); |
1086 list->AddProvider(automation); | 1094 list->AddProvider(automation); |
1087 } | 1095 } |
OLD | NEW |