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

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

Issue 7792011: Run LocalizeStrings() on plugin thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove attribute and add localize() method. Created 9 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: 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 9172ada94d6d48e908c7b1b1c48aa15e7e5f3ec7..6884ff23166d2965ccfde4c46fea116d25ce208c 100644
--- a/remoting/host/plugin/host_script_object.h
+++ b/remoting/host/plugin/host_script_object.h
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/synchronization/cancellation_flag.h"
+#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "base/string16.h"
#include "base/threading/platform_thread.h"
@@ -20,6 +21,7 @@
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/host_status_observer.h"
#include "remoting/host/plugin/host_plugin_utils.h"
+#include "remoting/host/ui_strings.h"
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/npfunctions.h"
#include "third_party/npapi/bindings/npruntime.h"
@@ -102,6 +104,12 @@ class HostNPScriptObject : public HostStatusObserver {
// Disconnect. No arguments or result.
bool Disconnect(const NPVariant* args, uint32_t argCount, NPVariant* result);
+ // Localize strings. args are:
+ // localize_func - a callback function which returns a localized string for
+ // a given tag name.
+ // No result.
+ bool Localize(const NPVariant* args, uint32_t argCount, NPVariant* result);
+
// Call OnStateChanged handler if there is one.
void OnStateChanged(State state);
@@ -167,6 +175,9 @@ class HostNPScriptObject : public HostStatusObserver {
scoped_refptr<ChromotingHost> host_;
int failed_login_attempts_;
+ UiStrings ui_strings_;
+ base::Lock ui_strings_lock_;
+
base::WaitableEvent disconnected_event_;
scoped_ptr<policy_hack::NatPolicy> nat_policy_;
« no previous file with comments | « no previous file | remoting/host/plugin/host_script_object.cc » ('j') | remoting/host/plugin/host_script_object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698