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

Unified Diff: chrome/browser/browser_main.cc

Issue 3153029: Resubmit r56600 - Start/stop service process when browser starts and stop (Closed)
Patch Set: Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/remoting/remoting_resources_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 5f518a4812b8920d70e94d4630d8136c222e0e11..ea93ec4408aa48435439fffbe311b8ac5010b846 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -59,6 +59,8 @@
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
+#include "chrome/browser/service/service_process_control.h"
+#include "chrome/browser/service/service_process_control_manager.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/translate/translate_manager.h"
#include "chrome/common/child_process.h"
@@ -73,6 +75,7 @@
#include "chrome/common/net/net_resource_provider.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/result_codes.h"
+#include "chrome/common/service_process_type.h"
#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/master_preferences.h"
#include "grit/app_locale_settings.h"
@@ -1370,6 +1373,19 @@ int BrowserMain(const MainFunctionParams& parameters) {
ChildProcess::WaitForDebugger(L"Browser");
}
+ // If remoting or cloud print proxy is enabled and setup has been completed
+ // we start the service process here.
+ // The prerequisite for running the service process is that we have IO, UI
+ // and PROCESS_LAUNCHER threads up and running.
+ // TODO(hclam): Need to check for cloud print proxy too.
+ if (parsed_command_line.HasSwitch(switches::kEnableRemoting)) {
+ if (user_prefs->GetBoolean(prefs::kRemotingHasSetupCompleted)) {
+ ServiceProcessControl* control = ServiceProcessControlManager::instance()
+ ->GetProcessControl(profile, kServiceProcessRemoting);
+ control->Launch(NULL);
+ }
+ }
+
int result_code = ResultCodes::NORMAL_EXIT;
if (parameters.ui_task) {
// We are in test mode. Run one task and enter the main message loop.
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/remoting/remoting_resources_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698