summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser.cc1
-rw-r--r--chrome/browser/browser_main.cc16
-rw-r--r--chrome/browser/remoting/remoting_resources_source.cc4
-rw-r--r--chrome/browser/remoting/remoting_setup_flow.cc25
-rw-r--r--chrome/browser/remoting/resources/setup_done.html6
-rw-r--r--chrome/browser/service/service_process_control.cc13
-rw-r--r--chrome/browser/service/service_process_control_manager.cc6
-rw-r--r--chrome/common/pref_names.cc5
-rw-r--r--chrome/common/pref_names.h3
-rw-r--r--chrome/service/remoting/remoting_directory_service.cc4
-rw-r--r--chrome/service/service_process.cc19
-rw-r--r--remoting/host/chromoting_host.cc5
12 files changed, 24 insertions, 83 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 3f10c59..ac91d86 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1965,7 +1965,6 @@ void Browser::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
prefs->RegisterBooleanPref(prefs::kUseVerticalTabs, false);
prefs->RegisterBooleanPref(prefs::kEnableTranslate, true);
- prefs->RegisterBooleanPref(prefs::kRemotingHasSetupCompleted, false);
}
// static
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 108f6f1..b5fa926 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -59,8 +59,6 @@
#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"
@@ -75,7 +73,6 @@
#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"
@@ -1369,19 +1366,6 @@ 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.
diff --git a/chrome/browser/remoting/remoting_resources_source.cc b/chrome/browser/remoting/remoting_resources_source.cc
index 984bc53..f49e335 100644
--- a/chrome/browser/remoting/remoting_resources_source.cc
+++ b/chrome/browser/remoting/remoting_resources_source.cc
@@ -51,7 +51,9 @@ 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", "");
+ localized_strings.SetString("introduction",
+ ASCIIToUTF16("Remoting ") +
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
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 1f4411b..27deaff 100644
--- a/chrome/browser/remoting/remoting_setup_flow.cc
+++ b/chrome/browser/remoting/remoting_setup_flow.cc
@@ -68,6 +68,14 @@ 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.
@@ -160,24 +168,13 @@ 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;
- 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");
- }
-
+ GetArgsForGaiaLogin(&args);
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
@@ -197,7 +194,7 @@ void OpenRemotingSetupDialog(Profile* profile) {
RemotingSetupFlow::Run(profile->GetOriginalProfile());
}
-// TODO(hclam): Need to refcount RemotingSetupFlow. I need to fix
-// lifetime of objects.
+// TODO(hclam): Need to refcount RemotingSetupFlow. I need to lifetime of
+// objects are all correct.
DISABLE_RUNNABLE_METHOD_REFCOUNT(RemotingSetupFlow);
DISABLE_RUNNABLE_METHOD_REFCOUNT(RemotingSetupMessageHandler);
diff --git a/chrome/browser/remoting/resources/setup_done.html b/chrome/browser/remoting/resources/setup_done.html
index 70311f8..88a365c 100644
--- a/chrome/browser/remoting/resources/setup_done.html
+++ b/chrome/browser/remoting/resources/setup_done.html
@@ -44,7 +44,8 @@ html[os='mac'] input[type='submit'] {
</style>
<script>
function setShowFirstTimeSetupSummary() {
- // TODO(hclam): Show the information for the first time setup.
+ document.getElementById("summary").innerHTML =
+ templateData['firsttimesetupsummary'];
}
function setMessage(msg) {
document.getElementById('msgContent').innerHTML = msg;
@@ -56,7 +57,8 @@ html[os='mac'] input[type='submit'] {
</head>
<body i18n-values=".style.fontFamily:fontfamily">
<div class="remoting-header" i18n-content="success"></div>
- <div id="msgContent">Setup completed.</div>
+ <div id="msgContent"></div>
+ <div id="summary" i18n-content="setupsummary"></div>
<div class="remoting-footer">
<input id="close" type="submit" i18n-values="value:okay"
onclick='chrome.send("DialogClose", [""])' />
diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc
index 5979084..9b76dc7 100644
--- a/chrome/browser/service/service_process_control.cc
+++ b/chrome/browser/service/service_process_control.cc
@@ -109,7 +109,6 @@ void ServiceProcessControl::ConnectInternal() {
base::Thread* io_thread = g_browser_process->io_thread();
// TODO(hclam): Determine the the channel id from profile and type.
- // TODO(hclam): Handle error connecting to channel.
const std::string channel_id = GetServiceProcessChannelName(type_);
channel_.reset(
new IPC::SyncChannel(channel_id, IPC::Channel::MODE_CLIENT, this, NULL,
@@ -121,10 +120,8 @@ void ServiceProcessControl::ConnectInternal() {
void ServiceProcessControl::Launch(Task* task) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
if (channel_.get()) {
- if (task) {
- task->Run();
- delete task;
- }
+ task->Run();
+ delete task;
return;
}
@@ -165,7 +162,7 @@ void ServiceProcessControl::OnProcessLaunched(Task* task) {
// After we have successfully created the service process we try to connect
// to it. The launch task is transfered to a connect task.
ConnectInternal();
- } else if (task) {
+ } else {
// If we don't have process handle that means launching the service process
// has failed.
task->Run();
@@ -186,8 +183,6 @@ void ServiceProcessControl::OnMessageReceived(const IPC::Message& message) {
void ServiceProcessControl::OnChannelConnected(int32 peer_pid) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- if (!connect_done_task_.get())
- return;
connect_done_task_->Run();
connect_done_task_.reset();
}
@@ -195,8 +190,6 @@ void ServiceProcessControl::OnChannelConnected(int32 peer_pid) {
void ServiceProcessControl::OnChannelError() {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
channel_.reset();
- if (!connect_done_task_.get())
- return;
connect_done_task_->Run();
connect_done_task_.reset();
}
diff --git a/chrome/browser/service/service_process_control_manager.cc b/chrome/browser/service/service_process_control_manager.cc
index 6c946b4..821de9a 100644
--- a/chrome/browser/service/service_process_control_manager.cc
+++ b/chrome/browser/service/service_process_control_manager.cc
@@ -36,12 +36,6 @@ ServiceProcessControl* ServiceProcessControlManager::GetProcessControl(
}
void ServiceProcessControlManager::Shutdown() {
- // TODO(hclam): Normally we should just delete the list but for simplicity
- // we also shutdown the service processes.
- for (ServiceProcessControlList::iterator i = process_control_list_.begin();
- i != process_control_list_.end(); ++i) {
- (*i)->Shutdown();
- }
STLDeleteElements(&process_control_list_);
}
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 16aa70e..02f92424 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -914,8 +914,6 @@ const char kLoginDatabaseMigrated[] = "login_database.migrated";
// The root URL of the cloud print service.
const char kCloudPrintServiceURL[] = "cloud_print.service_url";
-const char kRemotingHasSetupCompleted[] = "remoting.has_setup_completed";
-
// The list of BackgroundContents that should be loaded when the browser
// launches.
const char kRegisteredBackgroundContents[] = "background_contents.registered";
@@ -937,9 +935,6 @@ extern const char kCloudPrintEmail[] = "cloud_print.email";
extern const char kCloudPrintPrintSystemSettings[] =
"cloud_print.print_system_settings";
-// Used by the service process to determine if the remoting host is enabled.
-const char kRemotingHostEnabled[] = "remoting.host_enabled";
-
// Boolean to disable proxy altogether. If true, other proxy
// preferences are ignored.
const char kNoProxyServer[] = "proxy.disabled";
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 58d5741..18503a0 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -353,9 +353,6 @@ extern const char kCloudPrintXMPPAuthToken[];
extern const char kCloudPrintEmail[];
extern const char kCloudPrintPrintSystemSettings[];
-extern const char kRemotingHasSetupCompleted[];
-extern const char kRemotingHostEnabled[];
-
extern const char kNoProxyServer[];
extern const char kProxyAutoDetect[];
extern const char kProxyServer[];
diff --git a/chrome/service/remoting/remoting_directory_service.cc b/chrome/service/remoting/remoting_directory_service.cc
index 8bc6b0a0..697a576 100644
--- a/chrome/service/remoting/remoting_directory_service.cc
+++ b/chrome/service/remoting/remoting_directory_service.cc
@@ -75,7 +75,9 @@ void RemotingDirectoryService::OnURLFetchComplete(
// Destroy the fetcher after the response has been received.
fetcher_.reset();
- // TODO(hclam): Simply checking 200 status is not enough.
+ LOG(INFO) << "Remoting directory response: \n" << data.c_str();
+
+ // TODO(hclam): Simply checking 200 status is not ennough.
if (response_code == 200) {
client_->OnRemotingHostAdded();
} else {
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc
index 13979e7..f6d38e6 100644
--- a/chrome/service/service_process.cc
+++ b/chrome/service/service_process.cc
@@ -11,7 +11,6 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/json_pref_store.h"
-#include "chrome/common/pref_names.h"
#include "chrome/common/service_process_type.h"
#include "chrome/common/service_process_util.h"
#include "chrome/service/cloud_print/cloud_print_proxy.h"
@@ -66,16 +65,6 @@ bool ServiceProcess::Initialize(MessageLoop* message_loop) {
file_thread_->message_loop_proxy()));
service_prefs_->ReadPrefs();
- DictionaryValue* values = service_prefs_->prefs();
- bool remoting_host_enabled = false;
-
- // Check if remoting host is already enabled.
- if (values->GetBoolean(prefs::kRemotingHostEnabled, &remoting_host_enabled) &&
- remoting_host_enabled) {
- // If true then we start the host.
- StartChromotingHost();
- }
-
// TODO(hclam): Each type of service process should has it own instance of
// process and thus channel, but now we have only one process for all types
// so the type parameter doesn't matter now.
@@ -143,8 +132,6 @@ bool ServiceProcess::EnableChromotingHostWithTokens(
talk_token_ = talk_token;
// Use the remoting directory to register the host.
- if (remoting_directory_.get())
- remoting_directory_->CancelRequest();
remoting_directory_.reset(new RemotingDirectoryService(this));
remoting_directory_->AddHost(remoting_token);
return true;
@@ -220,12 +207,6 @@ void ServiceProcess::OnRemotingHostAdded() {
remoting_token_ = "";
talk_token_ = "";
- // Save the preference that we have enabled the remoting host.
- service_prefs_->prefs()->SetBoolean(prefs::kRemotingHostEnabled, true);
-
- // Force writing prefs to the disk.
- service_prefs_->WritePrefs();
-
// TODO(hclam): If we have a problem we need to send an IPC message back
// to the client that started this.
bool ret = StartChromotingHost();
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 1bc7b98..3e47f54 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -255,11 +255,6 @@ void ChromotingHost::DoShutdown() {
jingle_client_->Close();
}
- // Stop the heartbeat sender.
- if (heartbeat_sender_) {
- heartbeat_sender_->Stop();
- }
-
// Lastly call the shutdown task.
if (shutdown_task_.get()) {
shutdown_task_->Run();