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

Unified Diff: remoting/client/ios/session/remoting_client.mm

Issue 2856933007: [Remoting iOS] Basic viewport manipulation support (Closed)
Patch Set: Move the delegate getter/setting to the bottom Created 3 years, 8 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/ios/session/remoting_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ios/session/remoting_client.mm
diff --git a/remoting/client/ios/session/remoting_client.mm b/remoting/client/ios/session/remoting_client.mm
index bf0ce370f951d0705bd673a90cac4679ad8eb289..c56275bd169ae27c17f54269db7d6fba9ab39a3a 100644
--- a/remoting/client/ios/session/remoting_client.mm
+++ b/remoting/client/ios/session/remoting_client.mm
@@ -8,6 +8,8 @@
#import "remoting/client/ios/session/remoting_client.h"
+#include <memory>
+
#import "base/mac/bind_objc_block.h"
#import "ios/third_party/material_components_ios/src/components/Dialogs/src/MaterialDialogs.h"
#import "remoting/client/ios/display/gl_display_handler.h"
@@ -18,6 +20,7 @@
#include "remoting/client/chromoting_client_runtime.h"
#include "remoting/client/chromoting_session.h"
#include "remoting/client/connect_to_host_info.h"
+#include "remoting/client/gesture_interpreter.h"
#include "remoting/client/ios/session/remoting_client_session_delegate.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/video_renderer.h"
@@ -36,6 +39,7 @@ NSString* const kHostSessionPin = @"kHostSessionPin";
ClientSessionDetails* _sessionDetails;
// Call _secretFetchedCallback on the network thread.
remoting::protocol::SecretFetchedCallback _secretFetchedCallback;
+ std::unique_ptr<remoting::GestureInterpreter> _gestureInterpreter;
}
@end
@@ -108,6 +112,12 @@ NSString* const kHostSessionPin = @"kHostSessionPin";
base::WeakPtr<remoting::protocol::AudioStub> audioPlayer = nullptr;
_displayHandler = [[GlDisplayHandler alloc] init];
+ _displayHandler.delegate = self;
+ __weak GlDisplayHandler* weakDisplayHandler = _displayHandler;
+ _gestureInterpreter.reset(new remoting::GestureInterpreter(
+ base::BindBlockArc(^(const remoting::ViewMatrix& matrix) {
+ [weakDisplayHandler onPixelTransformationChanged:matrix];
+ })));
_runtime->ui_task_runner()->PostTask(
FROM_HERE, base::BindBlockArc(^{
@@ -138,6 +148,10 @@ NSString* const kHostSessionPin = @"kHostSessionPin";
return _sessionDetails.hostInfo;
}
+- (remoting::GestureInterpreter*)gestureInterpreter {
+ return _gestureInterpreter.get();
+}
+
#pragma mark - ChromotingSession::Delegate
- (void)onConnectionState:(remoting::protocol::ConnectionToHost::State)state
@@ -201,4 +215,18 @@ NSString* const kHostSessionPin = @"kHostSessionPin";
type, message);
}
+- (void)surfaceChanged:(const CGRect&)frame {
+ [_displayHandler onSurfaceChanged:frame];
+ _gestureInterpreter->OnSurfaceSizeChanged(frame.size.width,
+ frame.size.height);
+}
+
+#pragma mark - GlDisplayHandlerDelegate
+
+- (void)canvasSizeChanged:(CGSize)size {
+ if (_gestureInterpreter) {
+ _gestureInterpreter->OnDesktopSizeChanged(size.width, size.height);
+ }
+}
+
@end
« no previous file with comments | « remoting/client/ios/session/remoting_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698