summaryrefslogtreecommitdiff
path: root/remoting/host
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2013-07-30 15:19:42 +0100
committerBen Murdoch <benm@google.com>2013-07-30 15:19:42 +0100
commit558790d6acca3451cf3a6b497803a5f07d0bec58 (patch)
treefcc36c3da74559ee6015cb5e9f596105cdc9f56e /remoting/host
parent8643c35ec8e6546ae6e04c51e08c4d57d40e88da (diff)
downloadchromium_org-558790d6acca3451cf3a6b497803a5f07d0bec58.tar.gz
Merge from Chromium at DEPS revision r214332
This commit was generated by merge_to_master.py. Change-Id: I82a7c38de906244dc882493568013be659aa65d1
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/desktop_resizer_mac.cc42
-rw-r--r--remoting/host/input_injector_linux.cc15
-rw-r--r--remoting/host/setup/host_starter.h2
-rw-r--r--remoting/host/setup/service_client.cc (renamed from remoting/host/service_client.cc)4
-rw-r--r--remoting/host/setup/service_client.h (renamed from remoting/host/service_client.h)8
5 files changed, 43 insertions, 28 deletions
diff --git a/remoting/host/desktop_resizer_mac.cc b/remoting/host/desktop_resizer_mac.cc
index 22cc67e2ca..57f01eed37 100644
--- a/remoting/host/desktop_resizer_mac.cc
+++ b/remoting/host/desktop_resizer_mac.cc
@@ -111,24 +111,30 @@ void DesktopResizerMac::GetSupportedModesAndSizes(
base::ScopedCFTypeRef<CFMutableArrayRef>* modes,
std::list<SkISize>* sizes) {
CGDirectDisplayID display;
- if (GetSoleDisplayId(&display)) {
- base::ScopedCFTypeRef<CFArrayRef> all_modes(
- CGDisplayCopyAllDisplayModes(display, NULL));
- modes->reset(CFArrayCreateMutableCopy(NULL, 0, all_modes));
- CFIndex count = CFArrayGetCount(*modes);
- for (CFIndex i = 0; i < count; ++i) {
- CGDisplayModeRef mode = const_cast<CGDisplayModeRef>(
- static_cast<const CGDisplayMode*>(
- CFArrayGetValueAtIndex(*modes, i)));
- if (CGDisplayModeIsUsableForDesktopGUI(mode)) {
- SkISize size = SkISize::Make(CGDisplayModeGetWidth(mode),
- CGDisplayModeGetHeight(mode));
- sizes->push_back(size);
- } else {
- CFArrayRemoveValueAtIndex(*modes, i);
- --count;
- --i;
- }
+ if (!GetSoleDisplayId(&display)) {
+ return;
+ }
+
+ base::ScopedCFTypeRef<CFArrayRef> all_modes(
+ CGDisplayCopyAllDisplayModes(display, NULL));
+ if (!all_modes) {
+ return;
+ }
+
+ modes->reset(CFArrayCreateMutableCopy(NULL, 0, all_modes));
+ CFIndex count = CFArrayGetCount(*modes);
+ for (CFIndex i = 0; i < count; ++i) {
+ CGDisplayModeRef mode = const_cast<CGDisplayModeRef>(
+ static_cast<const CGDisplayMode*>(
+ CFArrayGetValueAtIndex(*modes, i)));
+ if (CGDisplayModeIsUsableForDesktopGUI(mode)) {
+ SkISize size = SkISize::Make(CGDisplayModeGetWidth(mode),
+ CGDisplayModeGetHeight(mode));
+ sizes->push_back(size);
+ } else {
+ CFArrayRemoveValueAtIndex(*modes, i);
+ --count;
+ --i;
}
}
}
diff --git a/remoting/host/input_injector_linux.cc b/remoting/host/input_injector_linux.cc
index 45221d1225..c22c5005c2 100644
--- a/remoting/host/input_injector_linux.cc
+++ b/remoting/host/input_injector_linux.cc
@@ -34,7 +34,7 @@ using protocol::MouseEvent;
#undef USB_KEYMAP
// Pixel-to-wheel-ticks conversion ratio used by GTK.
-// From Source/WebKit/chromium/src/gtk/WebInputFactory.cc.
+// From third_party/WebKit/Source/web/gtk/WebInputEventFactory.cpp .
const float kWheelTicksPerPixel = 3.0f / 160.0f;
// A class to generate events on Linux.
@@ -340,8 +340,15 @@ void InputInjectorLinux::Core::InjectMouseEvent(const MouseEvent& event) {
CurrentTime);
}
+ // Older client plugins always send scroll events in pixels, which
+ // must be accumulated host-side. Recent client plugins send both
+ // pixels and ticks with every scroll event, allowing the host to
+ // choose the best model on a per-platform basis. Since we can only
+ // inject ticks on Linux, use them if available.
int ticks_y = 0;
- if (event.has_wheel_delta_y()) {
+ if (event.has_wheel_ticks_y()) {
+ ticks_y = event.wheel_ticks_y();
+ } else if (event.has_wheel_delta_y()) {
wheel_ticks_y_ += event.wheel_delta_y() * kWheelTicksPerPixel;
ticks_y = static_cast<int>(wheel_ticks_y_);
wheel_ticks_y_ -= ticks_y;
@@ -352,7 +359,9 @@ void InputInjectorLinux::Core::InjectMouseEvent(const MouseEvent& event) {
}
int ticks_x = 0;
- if (event.has_wheel_delta_x()) {
+ if (event.has_wheel_ticks_x()) {
+ ticks_x = event.wheel_ticks_x();
+ } else if (event.has_wheel_delta_x()) {
wheel_ticks_x_ += event.wheel_delta_x() * kWheelTicksPerPixel;
ticks_x = static_cast<int>(wheel_ticks_x_);
wheel_ticks_x_ -= ticks_x;
diff --git a/remoting/host/setup/host_starter.h b/remoting/host/setup/host_starter.h
index 606ef4ba4d..a51f299f13 100644
--- a/remoting/host/setup/host_starter.h
+++ b/remoting/host/setup/host_starter.h
@@ -11,8 +11,8 @@
#include "google_apis/gaia/gaia_oauth_client.h"
#include "remoting/base/rsa_key_pair.h"
#include "remoting/base/url_request_context.h"
-#include "remoting/host/service_client.h"
#include "remoting/host/setup/daemon_controller.h"
+#include "remoting/host/setup/service_client.h"
namespace remoting {
diff --git a/remoting/host/service_client.cc b/remoting/host/setup/service_client.cc
index fbad41b002..c7bc22eb9f 100644
--- a/remoting/host/service_client.cc
+++ b/remoting/host/setup/service_client.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/service_client.h"
+#include "remoting/host/setup/service_client.h"
#include "base/json/json_writer.h"
#include "base/memory/scoped_ptr.h"
diff --git a/remoting/host/service_client.h b/remoting/host/setup/service_client.h
index 9085680d8d..5ae2144507 100644
--- a/remoting/host/service_client.h
+++ b/remoting/host/setup/service_client.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_HOST_SERVICE_CLIENT_H_
-#define REMOTING_HOST_SERVICE_CLIENT_H_
+#ifndef REMOTING_HOST_SETUP_SERVICE_CLIENT_H_
+#define REMOTING_HOST_SETUP_SERVICE_CLIENT_H_
#include <string>
@@ -58,4 +58,4 @@ class ServiceClient {
} // namespace remoting
-#endif // REMOTING_HOST_SERVICE_CLIENT_H_
+#endif // REMOTING_HOST_SETUP_SERVICE_CLIENT_H_