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

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

Issue 1078213004: Remove --check-cloud-print-connector-policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sat Apr 11 02:29:11 PDT 2015 Created 5 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/printing/cloud_print/cloud_print_proxy_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 #if !defined(OS_ANDROID) 1174 #if !defined(OS_ANDROID)
1175 // If the command line specifies --pack-extension, attempt the pack extension 1175 // If the command line specifies --pack-extension, attempt the pack extension
1176 // startup action and exit. 1176 // startup action and exit.
1177 if (parsed_command_line().HasSwitch(switches::kPackExtension)) { 1177 if (parsed_command_line().HasSwitch(switches::kPackExtension)) {
1178 extensions::StartupHelper extension_startup_helper; 1178 extensions::StartupHelper extension_startup_helper;
1179 if (extension_startup_helper.PackExtension(parsed_command_line())) 1179 if (extension_startup_helper.PackExtension(parsed_command_line()))
1180 return content::RESULT_CODE_NORMAL_EXIT; 1180 return content::RESULT_CODE_NORMAL_EXIT;
1181 return chrome::RESULT_CODE_PACK_EXTENSION_ERROR; 1181 return chrome::RESULT_CODE_PACK_EXTENSION_ERROR;
1182 } 1182 }
1183 1183
1184 // If we're being launched just to check the connector policy, we are 1184 // When another process is running, use that process instead of starting a
1185 // short-lived and don't want to be passing that switch off. 1185 // new one. NotifyOtherProcess will currently give the other process up to
1186 bool pass_command_line = !parsed_command_line().HasSwitch( 1186 // 20 seconds to respond. Note that this needs to be done before we attempt
1187 switches::kCheckCloudPrintConnectorPolicy); 1187 // to read the profile.
1188 notify_result_ = process_singleton_->NotifyOtherProcessOrCreate();
1189 switch (notify_result_) {
1190 case ProcessSingleton::PROCESS_NONE:
1191 // No process already running, fall through to starting a new one.
1192 break;
1188 1193
1189 if (pass_command_line) { 1194 case ProcessSingleton::PROCESS_NOTIFIED:
1190 // When another process is running, use that process instead of starting a
1191 // new one. NotifyOtherProcess will currently give the other process up to
1192 // 20 seconds to respond. Note that this needs to be done before we attempt
1193 // to read the profile.
1194 notify_result_ = process_singleton_->NotifyOtherProcessOrCreate();
1195 switch (notify_result_) {
1196 case ProcessSingleton::PROCESS_NONE:
1197 // No process already running, fall through to starting a new one.
1198 break;
1199
1200 case ProcessSingleton::PROCESS_NOTIFIED:
1201 #if defined(OS_POSIX) && !defined(OS_MACOSX) 1195 #if defined(OS_POSIX) && !defined(OS_MACOSX)
1202 // On POSIX systems, print a message notifying the process is running. 1196 // On POSIX systems, print a message notifying the process is running.
1203 printf("%s\n", base::SysWideToNativeMB(base::UTF16ToWide( 1197 printf("%s\n", base::SysWideToNativeMB(base::UTF16ToWide(
1204 l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); 1198 l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str());
1205 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) 1199 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
1206 1200
1207 // Having a differentiated return type for testing allows for tests to 1201 // Having a differentiated return type for testing allows for tests to
1208 // verify proper handling of some switches. When not testing, stick to 1202 // verify proper handling of some switches. When not testing, stick to
1209 // the standard Unix convention of returning zero when things went as 1203 // the standard Unix convention of returning zero when things went as
1210 // expected. 1204 // expected.
1211 if (parsed_command_line().HasSwitch(switches::kTestType)) 1205 if (parsed_command_line().HasSwitch(switches::kTestType))
1212 return chrome::RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED; 1206 return chrome::RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED;
1213 return content::RESULT_CODE_NORMAL_EXIT; 1207 return content::RESULT_CODE_NORMAL_EXIT;
1214 1208
1215 case ProcessSingleton::PROFILE_IN_USE: 1209 case ProcessSingleton::PROFILE_IN_USE:
1216 return chrome::RESULT_CODE_PROFILE_IN_USE; 1210 return chrome::RESULT_CODE_PROFILE_IN_USE;
1217 1211
1218 case ProcessSingleton::LOCK_ERROR: 1212 case ProcessSingleton::LOCK_ERROR:
1219 LOG(ERROR) << "Failed to create a ProcessSingleton for your profile " 1213 LOG(ERROR) << "Failed to create a ProcessSingleton for your profile "
1220 "directory. This means that running multiple instances " 1214 "directory. This means that running multiple instances "
1221 "would start multiple browser processes rather than " 1215 "would start multiple browser processes rather than "
1222 "opening a new window in the existing process. Aborting " 1216 "opening a new window in the existing process. Aborting "
1223 "now to avoid profile corruption."; 1217 "now to avoid profile corruption.";
1224 return chrome::RESULT_CODE_PROFILE_IN_USE; 1218 return chrome::RESULT_CODE_PROFILE_IN_USE;
1225 1219
1226 default: 1220 default:
1227 NOTREACHED(); 1221 NOTREACHED();
1228 }
1229 } 1222 }
1230 #endif // !defined(OS_ANDROID) 1223 #endif // !defined(OS_ANDROID)
1231 1224
1232 // Handle special early return paths (which couldn't be processed even earlier 1225 // Handle special early return paths (which couldn't be processed even earlier
1233 // as they require the process singleton to be held) first. 1226 // as they require the process singleton to be held) first.
1234 1227
1235 std::string try_chrome = 1228 std::string try_chrome =
1236 parsed_command_line().GetSwitchValueASCII(switches::kTryChromeAgain); 1229 parsed_command_line().GetSwitchValueASCII(switches::kTryChromeAgain);
1237 if (!try_chrome.empty()) { 1230 if (!try_chrome.empty()) {
1238 #if defined(OS_WIN) 1231 #if defined(OS_WIN)
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 chromeos::CrosSettings::Shutdown(); 1723 chromeos::CrosSettings::Shutdown();
1731 #endif // defined(OS_CHROMEOS) 1724 #endif // defined(OS_CHROMEOS)
1732 #endif // defined(OS_ANDROID) 1725 #endif // defined(OS_ANDROID)
1733 } 1726 }
1734 1727
1735 // Public members: 1728 // Public members:
1736 1729
1737 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1730 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1738 chrome_extra_parts_.push_back(parts); 1731 chrome_extra_parts_.push_back(parts);
1739 } 1732 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/cloud_print/cloud_print_proxy_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698