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

Unified Diff: chrome/browser/remoting/remoting_setup_flow.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
Index: chrome/browser/remoting/remoting_setup_flow.cc
diff --git a/chrome/browser/remoting/remoting_setup_flow.cc b/chrome/browser/remoting/remoting_setup_flow.cc
index 5bf1a23ea4a16d40c54a796ad3d2969691ad7f56..85e94ed23de4bee07d14752d5914668ffe899976 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);
« no previous file with comments | « chrome/browser/remoting/remoting_resources_source.cc ('k') | chrome/browser/remoting/resources/setup_done.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698