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

Unified Diff: remoting/client/plugin/chromoting_instance.h

Issue 12518027: Protocol / client plugin changes to support interactively asking for a PIN (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix comments Created 7 years, 9 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/client/client_config.h ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/chromoting_instance.h
diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h
index 9765f9688b5449bfa7d752524c18d663df1c7c5d..e814eaf396fe4ba00af9849047406bf4c55fb41f 100644
--- a/remoting/client/plugin/chromoting_instance.h
+++ b/remoting/client/plugin/chromoting_instance.h
@@ -39,6 +39,7 @@
#include "remoting/protocol/cursor_shape_stub.h"
#include "remoting/protocol/input_event_tracker.h"
#include "remoting/protocol/mouse_input_filter.h"
+#include "remoting/protocol/negotiating_authenticator.h"
namespace base {
class DictionaryValue;
@@ -120,20 +121,6 @@ class ChromotingInstance :
void SetDesktopSize(const SkISize& size, const SkIPoint& dpi);
void OnFirstFrameReceived();
- // Message handlers for messages that come from JavaScript. Called
- // from HandleMessage().
- void Connect(const ClientConfig& config);
- void Disconnect();
- void OnIncomingIq(const std::string& iq);
- void ReleaseAllKeys();
- void InjectKeyEvent(const protocol::KeyEvent& event);
- void RemapKey(uint32 in_usb_keycode, uint32 out_usb_keycode);
- void TrapKey(uint32 usb_keycode, bool trap);
- void SendClipboardItem(const std::string& mime_type, const std::string& item);
- void NotifyClientResolution(int width, int height, int x_dpi, int y_dpi);
- void PauseVideo(bool pause);
- void PauseAudio(bool pause);
-
// Return statistics record by ChromotingClient.
// If no connection is currently active then NULL will be returned.
ChromotingStats* GetStats();
@@ -163,6 +150,27 @@ class ChromotingInstance :
private:
FRIEND_TEST_ALL_PREFIXES(ChromotingInstanceTest, TestCaseSetup);
+ // Used as the |FetchSecretCallback| for IT2Me (or Me2Me from old webapps).
+ // Immediately calls |secret_fetched_callback| with |shared_secret|.
+ static void FetchSecretFromString(
+ const std::string& shared_secret,
+ const protocol::SecretFetchedCallback& secret_fetched_callback);
+
+ // Message handlers for messages that come from JavaScript. Called
+ // from HandleMessage().
+ void Connect(const ClientConfig& config);
+ void Disconnect();
+ void OnIncomingIq(const std::string& iq);
+ void ReleaseAllKeys();
+ void InjectKeyEvent(const protocol::KeyEvent& event);
+ void RemapKey(uint32 in_usb_keycode, uint32 out_usb_keycode);
+ void TrapKey(uint32 usb_keycode, bool trap);
+ void SendClipboardItem(const std::string& mime_type, const std::string& item);
+ void NotifyClientResolution(int width, int height, int x_dpi, int y_dpi);
+ void PauseVideo(bool pause);
+ void PauseAudio(bool pause);
+ void OnPinFetched(const std::string& pin);
+
// Helper method to post messages to the webapp.
void PostChromotingMessage(const std::string& method,
scoped_ptr<base::DictionaryValue> data);
@@ -183,6 +191,11 @@ class ChromotingInstance :
// Returns true if there is a ConnectionToHost and it is connected.
bool IsConnected();
+ // Used as the |FetchSecretCallback| for Me2Me connections.
+ // Uses the PIN request dialog in the webapp to obtain the shared secret.
+ void FetchSecretFromDialog(
+ const protocol::SecretFetchedCallback& secret_fetched_callback);
+
bool initialized_;
PepperPluginThreadDelegate plugin_thread_delegate_;
@@ -210,6 +223,10 @@ class ChromotingInstance :
// connection.
scoped_refptr<PepperXmppProxy> xmpp_proxy_;
+ // PIN Fetcher.
+ bool use_async_pin_dialog_;
+ protocol::SecretFetchedCallback secret_fetched_callback_;
+
base::WeakPtrFactory<ChromotingInstance> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ChromotingInstance);
« no previous file with comments | « remoting/client/client_config.h ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698