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

Side by Side Diff: remoting/client/desktop_viewport.h

Issue 2862893003: [CRD iOS] Inject mouse events to the host (Closed)
Patch Set: Fix Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_CLIENT_DESKTOP_VIEWPORT_H_ 5 #ifndef REMOTING_CLIENT_DESKTOP_VIEWPORT_H_
6 #define REMOTING_CLIENT_DESKTOP_VIEWPORT_H_ 6 #define REMOTING_CLIENT_DESKTOP_VIEWPORT_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "remoting/client/view_matrix.h" 9 #include "remoting/client/view_matrix.h"
10 10
(...skipping 30 matching lines...) Expand all
41 // Sets the |surface_size_| and initializes the viewport when necessary. 41 // Sets the |surface_size_| and initializes the viewport when necessary.
42 void SetSurfaceSize(int surface_width, int surface_height); 42 void SetSurfaceSize(int surface_width, int surface_height);
43 43
44 // Translates the desktop on the surface's reference frame by <dx, dy>. 44 // Translates the desktop on the surface's reference frame by <dx, dy>.
45 void MoveDesktop(float dx, float dy); 45 void MoveDesktop(float dx, float dy);
46 46
47 // Scales the desktop on the surface's reference frame at pivot point (px, py) 47 // Scales the desktop on the surface's reference frame at pivot point (px, py)
48 // by |scale|. 48 // by |scale|.
49 void ScaleDesktop(float px, float py, float scale); 49 void ScaleDesktop(float px, float py, float scale);
50 50
51 // Moves the viewport center by <x, y> on the desktop's coordinate.
52 void MoveViewportCenter(float dx, float dy);
nicholss 2017/05/08 15:34:18 I don't think "center" matters here, this method s
Yuwei 2017/05/08 20:45:26 Done. Also renamed MoveViewportcenterWithoutUpdate
53
51 // Sets the viewport center to (x, y) on the desktop's coordinate. 54 // Sets the viewport center to (x, y) on the desktop's coordinate.
52 void SetViewportCenter(float x, float y); 55 void SetViewportCenter(float x, float y);
53 56
54 // Registers the callback to be called once the transformation has changed. 57 // Registers the callback to be called once the transformation has changed.
55 // run_immediately: If true and the viewport is ready to be used, the callback 58 // run_immediately: If true and the viewport is ready to be used, the callback
56 // will be called immedately with the transformation matrix. 59 // will be called immedately with the transformation matrix.
57 void RegisterOnTransformationChangedCallback( 60 void RegisterOnTransformationChangedCallback(
58 const TransformationCallback& callback, 61 const TransformationCallback& callback,
59 bool run_immediately); 62 bool run_immediately);
60 63
64 // Returns the reference to the desktop-to-surface transformation.
65 const ViewMatrix& GetTransformation() const;
66
61 private: 67 private:
62 struct Bounds { 68 struct Bounds {
63 float left; 69 float left;
64 float right; 70 float right;
65 float top; 71 float top;
66 float bottom; 72 float bottom;
67 }; 73 };
68 74
69 // Resizes the desktop such that the image is displayed without borders in 75 // Resizes the desktop such that the image is displayed without borders in
70 // minimum possible zoom-level. This will be called once both the desktop 76 // minimum possible zoom-level. This will be called once both the desktop
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 111
106 TransformationCallback on_transformation_changed_; 112 TransformationCallback on_transformation_changed_;
107 113
108 // DesktopViewport is neither copyable nor movable. 114 // DesktopViewport is neither copyable nor movable.
109 DesktopViewport(const DesktopViewport&) = delete; 115 DesktopViewport(const DesktopViewport&) = delete;
110 DesktopViewport& operator=(const DesktopViewport&) = delete; 116 DesktopViewport& operator=(const DesktopViewport&) = delete;
111 }; 117 };
112 118
113 } // namespace remoting 119 } // namespace remoting
114 #endif // REMOTING_CLIENT_DESKTOP_VIEWPORT_H_ 120 #endif // REMOTING_CLIENT_DESKTOP_VIEWPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698