summaryrefslogtreecommitdiffstats
path: root/chrome/browser/remoting
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-23 23:20:57 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-23 23:20:57 +0000
commite96bf0c56566457022d20682ee278cd135d7c681 (patch)
tree16aae1f02aa4ca3948343ffb75f6010f9d1da125 /chrome/browser/remoting
parent4232100ca0d42e558e75a728b69abca4b28499bf (diff)
downloadchromium_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/remoting')
-rw-r--r--chrome/browser/remoting/remoting_resources_source.cc4
-rw-r--r--chrome/browser/remoting/remoting_setup_flow.cc25
2 files changed, 15 insertions, 14 deletions
diff --git a/chrome/browser/remoting/remoting_resources_source.cc b/chrome/browser/remoting/remoting_resources_source.cc
index 4c18089..a57596a 100644
--- a/chrome/browser/remoting/remoting_resources_source.cc
+++ b/chrome/browser/remoting/remoting_resources_source.cc
@@ -52,9 +52,7 @@ void RemotingResourcesSource::StartDataRequest(const std::string& path_raw,
localized_strings.SetString("settingupsync",
l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SETTING_UP_SYNC));
- localized_strings.SetString("introduction",
- ASCIIToUTF16("Remoting ") +
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
+ localized_strings.SetString("introduction", "");
localized_strings.SetString("signinprefix",
l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SIGNIN_PREFIX));
localized_strings.SetString("signinsuffix",
diff --git a/chrome/browser/remoting/remoting_setup_flow.cc b/chrome/browser/remoting/remoting_setup_flow.cc
index 5bf1a23..85e94ed 100644
--- a/chrome/browser/remoting/remoting_setup_flow.cc
+++ b/chrome/browser/remoting/remoting_setup_flow.cc
@@ -68,14 +68,6 @@ void RemotingSetupFlow::OnDialogClosed(const std::string& json_retval) {
delete this;
}
-// static
-void RemotingSetupFlow::GetArgsForGaiaLogin(DictionaryValue* args) {
- args->SetString("iframeToShow", "login");
- args->SetString("user", "");
- args->SetInteger("error", 0);
- args->SetBoolean("editable_user", true);
-}
-
void RemotingSetupFlow::GetDOMMessageHandlers(
std::vector<DOMMessageHandler*>* handlers) const {
// Create the message handler only after we are asked.
@@ -168,13 +160,24 @@ void RemotingSetupFlow::OnProcessLaunched() {
process_control_->EnableRemotingWithTokens(login_, remoting_token_,
sync_token_);
message_handler_->ShowSetupDone();
+
+ // Save the preference that we have completed the setup of remoting.
+ profile_->GetPrefs()->SetBoolean(prefs::kRemotingHasSetupCompleted, true);
}
// static
RemotingSetupFlow* RemotingSetupFlow::Run(Profile* profile) {
// Set the arguments for showing the gaia login page.
DictionaryValue args;
- GetArgsForGaiaLogin(&args);
+ args.SetString("iframeToShow", "login");
+ args.SetString("user", "");
+ args.SetInteger("error", 0);
+ args.SetBoolean("editable_user", true);
+
+ if (profile->GetPrefs()->GetBoolean(prefs::kRemotingHasSetupCompleted)) {
+ args.SetString("iframeToShow", "done");
+ }
+
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
@@ -194,7 +197,7 @@ void OpenRemotingSetupDialog(Profile* profile) {
RemotingSetupFlow::Run(profile->GetOriginalProfile());
}
-// TODO(hclam): Need to refcount RemotingSetupFlow. I need to lifetime of
-// objects are all correct.
+// TODO(hclam): Need to refcount RemotingSetupFlow. I need to fix
+// lifetime of objects.
DISABLE_RUNNABLE_METHOD_REFCOUNT(RemotingSetupFlow);
DISABLE_RUNNABLE_METHOD_REFCOUNT(RemotingSetupMessageHandler);