Index: remoting/host/plugin/host_script_object.h |
diff --git a/remoting/host/plugin/host_script_object.h b/remoting/host/plugin/host_script_object.h |
index 03d14c32c32540bb39b95a67ab367cd0bba428af..f0ad69b7037d5b760e936678c61f7cf60e70cc46 100644 |
--- a/remoting/host/plugin/host_script_object.h |
+++ b/remoting/host/plugin/host_script_object.h |
@@ -17,6 +17,7 @@ |
#include "base/time.h" |
#include "remoting/host/chromoting_host_context.h" |
#include "remoting/host/host_status_observer.h" |
+#include "remoting/host/plugin/host_plugin_utils.h" |
#include "third_party/npapi/bindings/npapi.h" |
#include "third_party/npapi/bindings/npfunctions.h" |
#include "third_party/npapi/bindings/npruntime.h" |
@@ -75,6 +76,7 @@ class HostNPScriptObject : public HostStatusObserver { |
// base/logging.h. |
static bool LogToUI(int severity, const char* file, int line, |
size_t message_start, const std::string& str); |
+ |
private: |
enum State { |
kDisconnected, |
@@ -115,6 +117,12 @@ class HostNPScriptObject : public HostStatusObserver { |
// Callback for ChromotingHost::Shutdown(). |
void OnShutdownFinished(); |
+ // Helper function for executing InvokeDefault on an NPObject that performs |
+ // a string->string mapping with one optional substitution parameter. Stores |
+ // the translation in |result| and returns true on success, or leaves it |
+ // unchanged and returns false on failure. |
+ bool Localize(const char* tag, const char* parameter, std::string* result); |
+ |
// Helper function for executing InvokeDefault on an NPObject, and ignoring |
// the return value. |
bool InvokeAndIgnoreResult(NPObject* func, |
@@ -137,8 +145,9 @@ class HostNPScriptObject : public HostStatusObserver { |
std::string access_code_; |
std::string client_username_; |
base::TimeDelta access_code_lifetime_; |
- NPObject* log_debug_info_func_; |
- NPObject* on_state_changed_func_; |
+ scoped_NPObject localize_func_; |
+ scoped_NPObject log_debug_info_func_; |
+ scoped_NPObject on_state_changed_func_; |
base::PlatformThreadId np_thread_id_; |
scoped_ptr<RegisterSupportHostRequest> register_request_; |