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

Unified Diff: remoting/host/event_executor_win.cc

Issue 10795053: Remove EventExecutor dependency on VideoFrameCapturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment. Created 8 years, 5 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/host/event_executor_mac.cc ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/event_executor_win.cc
diff --git a/remoting/host/event_executor_win.cc b/remoting/host/event_executor_win.cc
index 0f2ac00783fe22f2d97b6f4b6e57680c9481ff46..ce854f54e5ebe09b9802a2994d8d7377ce4aeabb 100644
--- a/remoting/host/event_executor_win.cc
+++ b/remoting/host/event_executor_win.cc
@@ -10,9 +10,11 @@
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/single_thread_task_runner.h"
-#include "remoting/host/video_frame_capturer.h"
#include "remoting/host/clipboard.h"
#include "remoting/proto/event.pb.h"
+// SkSize.h assumes that stdint.h-style types are already defined.
+#include "third_party/skia/include/core/SkTypes.h"
+#include "third_party/skia/include/core/SkSize.h"
namespace remoting {
@@ -31,8 +33,7 @@ using protocol::MouseEvent;
class EventExecutorWin : public EventExecutor {
public:
EventExecutorWin(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
- VideoFrameCapturer* capturer);
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
virtual ~EventExecutorWin() {}
// ClipboardStub interface.
@@ -54,7 +55,6 @@ class EventExecutorWin : public EventExecutor {
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
- VideoFrameCapturer* capturer_;
scoped_ptr<Clipboard> clipboard_;
DISALLOW_COPY_AND_ASSIGN(EventExecutorWin);
@@ -62,11 +62,9 @@ class EventExecutorWin : public EventExecutor {
EventExecutorWin::EventExecutorWin(
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
- VideoFrameCapturer* capturer)
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
: main_task_runner_(main_task_runner),
ui_task_runner_(ui_task_runner),
- capturer_(capturer),
clipboard_(Clipboard::Create()) {
}
@@ -221,8 +219,11 @@ void EventExecutorWin::HandleMouse(const MouseEvent& event) {
INPUT input;
input.type = INPUT_MOUSE;
input.mi.time = 0;
- SkISize screen_size = capturer_->size_most_recent();
+ SkISize screen_size(SkISize::Make(GetSystemMetrics(SM_CXVIRTUALSCREEN),
+ GetSystemMetrics(SM_CYVIRTUALSCREEN)));
if ((screen_size.width() > 1) && (screen_size.height() > 1)) {
+ x = std::max(0, std::min(screen_size.width(), x));
+ y = std::max(0, std::min(screen_size.height(), y));
input.mi.dx = static_cast<int>((x * 65535) / (screen_size.width() - 1));
input.mi.dy = static_cast<int>((y * 65535) / (screen_size.height() - 1));
input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
@@ -289,10 +290,9 @@ void EventExecutorWin::HandleMouse(const MouseEvent& event) {
scoped_ptr<EventExecutor> EventExecutor::Create(
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
- VideoFrameCapturer* capturer) {
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
return scoped_ptr<EventExecutor>(
- new EventExecutorWin(main_task_runner, ui_task_runner, capturer));
+ new EventExecutorWin(main_task_runner, ui_task_runner));
}
} // namespace remoting
« no previous file with comments | « remoting/host/event_executor_mac.cc ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698