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

Unified Diff: remoting/host/plugin/host_script_object.cc

Issue 11886051: Turned UiStrings into a singleton so that the continue window does not depend on ChromotingHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 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 | « remoting/host/it2me_host_user_interface.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/plugin/host_script_object.cc
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index 2133b60a691f5e5e485abbc3d31c44a3b8801eb8..b5c3618286950ca5cef44bcc6ff864f6d5a26f23 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -86,15 +86,15 @@ class HostNPScriptObject::It2MeImpl
It2MeImpl(
scoped_ptr<ChromotingHostContext> context,
scoped_refptr<base::SingleThreadTaskRunner> plugin_task_runner,
- base::WeakPtr<HostNPScriptObject> script_object,
- const UiStrings& ui_strings);
+ base::WeakPtr<HostNPScriptObject> script_object);
// Methods called by the script object, from the plugin thread.
// Creates It2Me host structures and starts the host.
void Connect(const std::string& uid,
const std::string& auth_token,
- const std::string& auth_service);
+ const std::string& auth_service,
+ const UiStrings& ui_strings);
// Disconnects the host, ready for tear-down.
// Also called internally, from the network thread.
@@ -148,7 +148,6 @@ class HostNPScriptObject::It2MeImpl
scoped_ptr<ChromotingHostContext> host_context_;
scoped_refptr<base::SingleThreadTaskRunner> plugin_task_runner_;
base::WeakPtr<HostNPScriptObject> script_object_;
- UiStrings ui_strings_;
State state_;
@@ -188,12 +187,10 @@ class HostNPScriptObject::It2MeImpl
HostNPScriptObject::It2MeImpl::It2MeImpl(
scoped_ptr<ChromotingHostContext> host_context,
scoped_refptr<base::SingleThreadTaskRunner> plugin_task_runner,
- base::WeakPtr<HostNPScriptObject> script_object,
- const UiStrings& ui_strings)
+ base::WeakPtr<HostNPScriptObject> script_object)
: host_context_(host_context.Pass()),
plugin_task_runner_(plugin_task_runner),
script_object_(script_object),
- ui_strings_(ui_strings),
state_(kDisconnected),
failed_login_attempts_(0),
nat_traversal_enabled_(false),
@@ -204,12 +201,14 @@ HostNPScriptObject::It2MeImpl::It2MeImpl(
void HostNPScriptObject::It2MeImpl::Connect(
const std::string& uid,
const std::string& auth_token,
- const std::string& auth_service) {
+ const std::string& auth_service,
+ const UiStrings& ui_strings) {
if (!host_context_->ui_task_runner()->BelongsToCurrentThread()) {
DCHECK(plugin_task_runner_->BelongsToCurrentThread());
host_context_->ui_task_runner()->PostTask(
FROM_HERE,
- base::Bind(&It2MeImpl::Connect, this, uid, auth_token, auth_service));
+ base::Bind(&It2MeImpl::Connect, this, uid, auth_token, auth_service,
+ ui_strings));
return;
}
@@ -225,7 +224,7 @@ void HostNPScriptObject::It2MeImpl::Connect(
// The UserInterface object needs to be created on the UI thread.
it2me_host_user_interface_.reset(
new It2MeHostUserInterface(host_context_->network_task_runner(),
- host_context_->ui_task_runner()));
+ host_context_->ui_task_runner(), ui_strings));
it2me_host_user_interface_->Init();
// Switch to the network thread to start the actual connection.
@@ -381,9 +380,6 @@ void HostNPScriptObject::It2MeImpl::FinishConnect(
protocol::CandidateSessionConfig::DisableAudioChannel(protocol_config.get());
host_->set_protocol_config(protocol_config.Pass());
- // Provide localization strings to the host.
- host_->SetUiStrings(ui_strings_);
-
// Create user interface.
it2me_host_user_interface_->Start(host_.get(),
base::Bind(&It2MeImpl::Disconnect, this));
@@ -954,8 +950,8 @@ bool HostNPScriptObject::Connect(const NPVariant* args,
// Create the It2Me host implementation and start connecting.
it2me_impl_ = new It2MeImpl(
- host_context.Pass(), plugin_task_runner_, weak_ptr_, ui_strings_);
- it2me_impl_->Connect(uid, auth_token, auth_service);
+ host_context.Pass(), plugin_task_runner_, weak_ptr_);
+ it2me_impl_->Connect(uid, auth_token, auth_service, ui_strings_);
return true;
}
« no previous file with comments | « remoting/host/it2me_host_user_interface.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698