diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 23:20:57 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 23:20:57 +0000 |
commit | e96bf0c56566457022d20682ee278cd135d7c681 (patch) | |
tree | 16aae1f02aa4ca3948343ffb75f6010f9d1da125 /chrome/browser/browser_main.cc | |
parent | 4232100ca0d42e558e75a728b69abca4b28499bf (diff) | |
download | chromium_src-e96bf0c56566457022d20682ee278cd135d7c681.zip chromium_src-e96bf0c56566457022d20682ee278cd135d7c681.tar.gz chromium_src-e96bf0c56566457022d20682ee278cd135d7c681.tar.bz2 |
Resubmit r56600 - Start/stop service process when browser starts and stop
Save the information that the setup of remoting has completed.
After setup has been completed we start and stop service process when
--enable-remoting presents when browser starts.
Also save the information in the service process that host is registered
and ready to be used. Again start chromoting host automatically once
the host registration is done.
BUG=50244, 50242, 50243, 50249
Review URL: http://codereview.chromium.org/3153029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r-- | chrome/browser/browser_main.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index bf299bd..7fb3dcc 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" @@ -1363,6 +1366,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. |