summaryrefslogtreecommitdiff
path: root/remoting/host
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2013-09-26 13:24:57 +0100
committerTorne (Richard Coles) <torne@google.com>2013-09-26 13:24:57 +0100
commit68043e1e95eeb07d5cae7aca370b26518b0867d6 (patch)
treecc6a216bce6aa9319a216327b73a07f49200dab5 /remoting/host
parentcede44592cfb9ec370925d10c2df733349a94a82 (diff)
downloadchromium_org-68043e1e95eeb07d5cae7aca370b26518b0867d6.tar.gz
Merge from Chromium at DEPS revision 225410
This commit was generated by merge_to_master.py. Change-Id: Ifa1539ca216abb163295ee7a77f81bb67f52e178
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/DEPS1
-rw-r--r--remoting/host/OWNERS1
-rw-r--r--remoting/host/config_file_watcher.cc2
-rw-r--r--remoting/host/constants_mac.cc4
-rw-r--r--remoting/host/input_injector_linux.cc11
-rw-r--r--remoting/host/input_injector_mac.cc11
-rw-r--r--remoting/host/input_injector_win.cc72
-rw-r--r--remoting/host/mac/me2me_preference_pane.mm13
-rw-r--r--remoting/host/plugin/host_script_object.cc9
-rw-r--r--remoting/host/register_support_host_request_unittest.cc1
-rw-r--r--remoting/host/remoting_me2me_host.cc10
-rw-r--r--remoting/host/server_log_entry.cc12
-rw-r--r--remoting/host/service_urls.cc6
-rw-r--r--remoting/host/win/elevated_controller.cc14
14 files changed, 63 insertions, 104 deletions
diff --git a/remoting/host/DEPS b/remoting/host/DEPS
index 6a826365ae..70b8379628 100644
--- a/remoting/host/DEPS
+++ b/remoting/host/DEPS
@@ -1,5 +1,4 @@
include_rules = [
- "+jingle/glue",
"+net",
"+remoting/codec",
"+remoting/jingle_glue",
diff --git a/remoting/host/OWNERS b/remoting/host/OWNERS
index fbe7a20d52..176a54eb9a 100644
--- a/remoting/host/OWNERS
+++ b/remoting/host/OWNERS
@@ -5,5 +5,4 @@ per-file *_messages*.h=cdn@chromium.org
per-file *_messages*.h=cevans@chromium.org
per-file *_messages*.h=jln@chromium.org
per-file *_messages*.h=jschuh@chromium.org
-per-file *_messages*.h=palmer@chromium.org
per-file *_messages*.h=tsepez@chromium.org
diff --git a/remoting/host/config_file_watcher.cc b/remoting/host/config_file_watcher.cc
index 9b95ed9cbf..a261017f48 100644
--- a/remoting/host/config_file_watcher.cc
+++ b/remoting/host/config_file_watcher.cc
@@ -24,9 +24,11 @@ const char kHostConfigSwitchName[] = "host-config";
const base::FilePath::CharType kDefaultHostConfigFile[] =
FILE_PATH_LITERAL("host.json");
+#if defined(OS_WIN)
// Maximum number of times to try reading the configuration file before
// reporting an error.
const int kMaxRetries = 3;
+#endif // defined(OS_WIN)
class ConfigFileWatcherImpl
: public base::RefCountedThreadSafe<ConfigFileWatcherImpl> {
diff --git a/remoting/host/constants_mac.cc b/remoting/host/constants_mac.cc
index 3b48ca0f93..7491414ebe 100644
--- a/remoting/host/constants_mac.cc
+++ b/remoting/host/constants_mac.cc
@@ -17,10 +17,6 @@ namespace remoting {
const char kServiceName[] = SERVICE_NAME;
-const char kUpdateSucceededNotificationName[] =
- SERVICE_NAME ".update_succeeded";
-const char kUpdateFailedNotificationName[] = SERVICE_NAME ".update_failed";
-
const char kPrefPaneFileName[] = SERVICE_NAME ".prefPane";
const char kPrefPaneFilePath[] = PREFERENCE_PANES_DIR SERVICE_NAME ".prefPane";
diff --git a/remoting/host/input_injector_linux.cc b/remoting/host/input_injector_linux.cc
index d61d8f2072..b109b7798f 100644
--- a/remoting/host/input_injector_linux.cc
+++ b/remoting/host/input_injector_linux.cc
@@ -19,6 +19,7 @@
#include "remoting/host/clipboard.h"
#include "remoting/proto/internal.pb.h"
#include "third_party/skia/include/core/SkPoint.h"
+#include "ui/base/keycodes/keycode_converter.h"
namespace remoting {
@@ -28,11 +29,6 @@ using protocol::ClipboardEvent;
using protocol::KeyEvent;
using protocol::MouseEvent;
-// USB to XKB keycode map table.
-#define USB_KEYMAP(usb, xkb, win, mac, code) {usb, xkb, code}
-#include "ui/base/keycodes/usb_keycode_map.h"
-#undef USB_KEYMAP
-
// Pixel-to-wheel-ticks conversion ratio used by GTK.
// From third_party/WebKit/Source/web/gtk/WebInputEventFactory.cpp .
const float kWheelTicksPerPixel = 3.0f / 160.0f;
@@ -219,13 +215,14 @@ void InputInjectorLinux::Core::InjectKeyEvent(const KeyEvent& event) {
return;
}
- int keycode = UsbKeycodeToNativeKeycode(event.usb_keycode());
+ ui::KeycodeConverter* key_converter = ui::KeycodeConverter::GetInstance();
+ int keycode = key_converter->UsbKeycodeToNativeKeycode(event.usb_keycode());
VLOG(3) << "Converting USB keycode: " << std::hex << event.usb_keycode()
<< " to keycode: " << keycode << std::dec;
// Ignore events which can't be mapped.
- if (keycode == InvalidNativeKeycode())
+ if (keycode == key_converter->InvalidNativeKeycode())
return;
if (event.pressed()) {
diff --git a/remoting/host/input_injector_mac.cc b/remoting/host/input_injector_mac.cc
index 145db227b9..ac687614e9 100644
--- a/remoting/host/input_injector_mac.cc
+++ b/remoting/host/input_injector_mac.cc
@@ -22,6 +22,7 @@
#include "third_party/skia/include/core/SkPoint.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/webrtc/modules/desktop_capture/mac/desktop_configuration.h"
+#include "ui/base/keycodes/keycode_converter.h"
namespace remoting {
@@ -31,11 +32,6 @@ using protocol::ClipboardEvent;
using protocol::KeyEvent;
using protocol::MouseEvent;
-// USB to Mac keycode mapping table.
-#define USB_KEYMAP(usb, xkb, win, mac, code) {usb, mac, code}
-#include "ui/base/keycodes/usb_keycode_map.h"
-#undef USB_KEYMAP
-
// skia/ext/skia_utils_mac.h only defines CGRectToSkRect().
SkIRect CGRectToSkIRect(const CGRect& rect) {
SkIRect result;
@@ -157,13 +153,14 @@ void InputInjectorMac::Core::InjectKeyEvent(const KeyEvent& event) {
if (!event.has_pressed() || !event.has_usb_keycode())
return;
- int keycode = UsbKeycodeToNativeKeycode(event.usb_keycode());
+ ui::KeycodeConverter* key_converter = ui::KeycodeConverter::GetInstance();
+ int keycode = key_converter->UsbKeycodeToNativeKeycode(event.usb_keycode());
VLOG(3) << "Converting USB keycode: " << std::hex << event.usb_keycode()
<< " to keycode: " << keycode << std::dec;
// If we couldn't determine the Mac virtual key code then ignore the event.
- if (keycode == InvalidNativeKeycode())
+ if (keycode == key_converter->InvalidNativeKeycode())
return;
base::ScopedCFTypeRef<CGEventRef> eventRef(
diff --git a/remoting/host/input_injector_win.cc b/remoting/host/input_injector_win.cc
index 352f82bd31..c2ac2c19d5 100644
--- a/remoting/host/input_injector_win.cc
+++ b/remoting/host/input_injector_win.cc
@@ -17,6 +17,7 @@
// 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"
+#include "ui/base/keycodes/keycode_converter.h"
namespace remoting {
@@ -26,11 +27,6 @@ using protocol::ClipboardEvent;
using protocol::KeyEvent;
using protocol::MouseEvent;
-// USB to XKB keycode map table.
-#define USB_KEYMAP(usb, xkb, win, mac, code) {usb, win, code}
-#include "ui/base/keycodes/usb_keycode_map.h"
-#undef USB_KEYMAP
-
// A class to generate events on Windows.
class InputInjectorWin : public InputInjector {
public:
@@ -185,13 +181,13 @@ void InputInjectorWin::Core::HandleKey(const KeyEvent& event) {
// Reset the system idle suspend timeout.
SetThreadExecutionState(ES_SYSTEM_REQUIRED);
- int scancode = UsbKeycodeToNativeKeycode(event.usb_keycode());
-
+ ui::KeycodeConverter* key_converter = ui::KeycodeConverter::GetInstance();
+ int scancode = key_converter->UsbKeycodeToNativeKeycode(event.usb_keycode());
VLOG(3) << "Converting USB keycode: " << std::hex << event.usb_keycode()
<< " to scancode: " << scancode << std::dec;
// Ignore events which can't be mapped.
- if (scancode == InvalidNativeKeycode())
+ if (scancode == key_converter->InvalidNativeKeycode())
return;
// Populate the a Windows INPUT structure for the event.
@@ -219,21 +215,15 @@ void InputInjectorWin::Core::HandleMouse(const MouseEvent& event) {
// Reset the system idle suspend timeout.
SetThreadExecutionState(ES_SYSTEM_REQUIRED);
- // TODO(garykac) Collapse mouse movement and button events into a single
- // input event when possible.
+ INPUT input;
+ memset(&input, 0, sizeof(input));
+ input.type = INPUT_MOUSE;
+
if (event.has_delta_x() && event.has_delta_y()) {
- INPUT input;
- input.type = INPUT_MOUSE;
- input.mi.time = 0;
input.mi.dx = event.delta_x();
input.mi.dy = event.delta_y();
- input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_VIRTUALDESK;
- if (SendInput(1, &input, sizeof(INPUT)) == 0)
- LOG_GETLASTERROR(ERROR) << "Failed to inject a mouse move event";
+ input.mi.dwFlags |= MOUSEEVENTF_MOVE | MOUSEEVENTF_VIRTUALDESK;
} else if (event.has_x() && event.has_y()) {
- INPUT input;
- input.type = INPUT_MOUSE;
- input.mi.time = 0;
SkISize screen_size(SkISize::Make(GetSystemMetrics(SM_CXVIRTUALSCREEN),
GetSystemMetrics(SM_CYVIRTUALSCREEN)));
if ((screen_size.width() > 1) && (screen_size.height() > 1)) {
@@ -241,10 +231,8 @@ void InputInjectorWin::Core::HandleMouse(const MouseEvent& event) {
int y = std::max(0, std::min(screen_size.height(), event.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 =
+ input.mi.dwFlags |=
MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK;
- if (SendInput(1, &input, sizeof(INPUT)) == 0)
- LOG_GETLASTERROR(ERROR) << "Failed to inject a mouse move event";
}
}
@@ -256,31 +244,17 @@ void InputInjectorWin::Core::HandleMouse(const MouseEvent& event) {
}
if (wheel_delta_x != 0 || wheel_delta_y != 0) {
- INPUT wheel;
- wheel.type = INPUT_MOUSE;
- wheel.mi.time = 0;
-
if (wheel_delta_x != 0) {
- wheel.mi.mouseData = wheel_delta_x;
- wheel.mi.dwFlags = MOUSEEVENTF_HWHEEL;
- if (SendInput(1, &wheel, sizeof(INPUT)) == 0)
- LOG_GETLASTERROR(ERROR) << "Failed to inject a mouse wheel(x) event";
+ input.mi.mouseData = wheel_delta_x;
+ input.mi.dwFlags |= MOUSEEVENTF_HWHEEL;
}
if (wheel_delta_y != 0) {
- wheel.mi.mouseData = wheel_delta_y;
- wheel.mi.dwFlags = MOUSEEVENTF_WHEEL;
- if (SendInput(1, &wheel, sizeof(INPUT)) == 0)
- LOG_GETLASTERROR(ERROR) << "Failed to inject a mouse wheel(y) event";
+ input.mi.mouseData = wheel_delta_y;
+ input.mi.dwFlags |= MOUSEEVENTF_WHEEL;
}
}
if (event.has_button() && event.has_button_down()) {
- INPUT button_event;
- button_event.type = INPUT_MOUSE;
- button_event.mi.time = 0;
- button_event.mi.dx = 0;
- button_event.mi.dy = 0;
-
MouseEvent::MouseButton button = event.button();
bool down = event.button_down();
@@ -295,21 +269,19 @@ void InputInjectorWin::Core::HandleMouse(const MouseEvent& event) {
}
if (button == MouseEvent::BUTTON_LEFT) {
- button_event.mi.dwFlags =
- down ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
+ input.mi.dwFlags |= down ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
} else if (button == MouseEvent::BUTTON_MIDDLE) {
- button_event.mi.dwFlags =
- down ? MOUSEEVENTF_MIDDLEDOWN : MOUSEEVENTF_MIDDLEUP;
+ input.mi.dwFlags |= down ? MOUSEEVENTF_MIDDLEDOWN : MOUSEEVENTF_MIDDLEUP;
} else if (button == MouseEvent::BUTTON_RIGHT) {
- button_event.mi.dwFlags =
- down ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP;
+ input.mi.dwFlags |= down ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP;
} else {
- button_event.mi.dwFlags =
- down ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
+ input.mi.dwFlags |= down ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
}
+ }
- if (SendInput(1, &button_event, sizeof(INPUT)) == 0)
- LOG_GETLASTERROR(ERROR) << "Failed to inject a mouse button event";
+ if (input.mi.dwFlags) {
+ if (SendInput(1, &input, sizeof(INPUT)) == 0)
+ LOG_GETLASTERROR(ERROR) << "Failed to inject a mouse event";
}
}
diff --git a/remoting/host/mac/me2me_preference_pane.mm b/remoting/host/mac/me2me_preference_pane.mm
index 3d0879bcc6..56cc235e84 100644
--- a/remoting/host/mac/me2me_preference_pane.mm
+++ b/remoting/host/mac/me2me_preference_pane.mm
@@ -468,12 +468,15 @@ std::string JsonHostConfig::GetSerializedData() const {
std::string email;
if (config_.get()) {
- bool result = config_->GetString(remoting::kXmppLoginConfigPath, &email);
-
- // The config has already been checked by |IsConfigValid|.
+ bool result = config_->GetString(remoting::kHostOwnerConfigPath, &email);
if (!result) {
- [self showError];
- return;
+ result = config_->GetString(remoting::kXmppLoginConfigPath, &email);
+
+ // The config has already been checked by |IsConfigValid|.
+ if (!result) {
+ [self showError];
+ return;
+ }
}
}
[disable_view_ setEnabled:(is_pane_unlocked_ && is_service_running_ &&
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index 39cd72da83..c4572e20cd 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -15,7 +15,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/threading/platform_thread.h"
#include "base/values.h"
-#include "jingle/glue/xmpp_client_socket_factory.h"
#include "net/base/net_util.h"
#include "net/socket/client_socket_factory.h"
#include "remoting/base/auth_token_util.h"
@@ -332,12 +331,10 @@ void HostNPScriptObject::It2MeImpl::FinishConnect() {
host_key_pair_ = RsaKeyPair::Generate();
// Create XMPP connection.
- scoped_ptr<jingle_glue::ResolvingClientSocketFactory> socket_factory(
- new jingle_glue::XmppClientSocketFactory(
- net::ClientSocketFactory::GetDefaultFactory(), net::SSLConfig(),
- host_context_->url_request_context_getter(), false));
scoped_ptr<SignalStrategy> signal_strategy(
- new XmppSignalStrategy(socket_factory.Pass(), xmpp_server_config_));
+ new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(),
+ host_context_->url_request_context_getter(),
+ xmpp_server_config_));
// Request registration of the host for support.
scoped_ptr<RegisterSupportHostRequest> register_request(
diff --git a/remoting/host/register_support_host_request_unittest.cc b/remoting/host/register_support_host_request_unittest.cc
index 9065af427c..e4ce866365 100644
--- a/remoting/host/register_support_host_request_unittest.cc
+++ b/remoting/host/register_support_host_request_unittest.cc
@@ -34,7 +34,6 @@ namespace remoting {
namespace {
const char kTestBotJid[] = "remotingunittest@bot.talk.google.com";
const char kTestJid[] = "user@gmail.com/chromoting123";
-const int64 kTestTime = 123123123;
const char kSupportId[] = "AB4RF3";
const char kSupportIdLifetime[] = "300";
const char kStanzaId[] = "123";
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index e1ba45204f..97886e9e89 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -27,7 +27,6 @@
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_listener.h"
-#include "jingle/glue/xmpp_client_socket_factory.h"
#include "media/base/media.h"
#include "net/base/network_change_notifier.h"
#include "net/socket/client_socket_factory.h"
@@ -104,9 +103,11 @@ namespace {
// This is used for tagging system event logs.
const char kApplicationName[] = "chromoting";
+#if defined(OS_LINUX)
// The command line switch used to pass name of the pipe to capture audio on
// linux.
const char kAudioPipeSwitchName[] = "audio-pipe-name";
+#endif // defined(OS_LINUX)
// The command line switch used by the parent to request the host to signal it
// when it is successfully started.
@@ -966,12 +967,9 @@ void HostProcess::StartHost() {
state_ == HOST_STOPPED) << state_;
state_ = HOST_STARTED;
- scoped_ptr<jingle_glue::ResolvingClientSocketFactory> socket_factory(
- new jingle_glue::XmppClientSocketFactory(
- net::ClientSocketFactory::GetDefaultFactory(), net::SSLConfig(),
- context_->url_request_context_getter(), false));
signal_strategy_.reset(
- new XmppSignalStrategy(socket_factory.Pass(),
+ new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(),
+ context_->url_request_context_getter(),
xmpp_server_config_));
scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker(
diff --git a/remoting/host/server_log_entry.cc b/remoting/host/server_log_entry.cc
index b13f6c667b..8ef8e49cf0 100644
--- a/remoting/host/server_log_entry.cc
+++ b/remoting/host/server_log_entry.cc
@@ -43,10 +43,6 @@ const char kStatusName[] = "status";
const char kExitCodeName[] = "exit-code";
const char kKeyOsName[] = "os-name";
-const char kValueOsNameWindows[] = "Windows";
-const char kValueOsNameLinux[] = "Linux";
-const char kValueOsNameMac[] = "Mac";
-const char kValueOsNameChromeOS[] = "ChromeOS";
const char kKeyOsVersion[] = "os-version";
@@ -102,13 +98,13 @@ scoped_ptr<ServerLogEntry> ServerLogEntry::MakeForHostStatus(
void ServerLogEntry::AddHostFields() {
#if defined(OS_WIN)
- Set(kKeyOsName, kValueOsNameWindows);
+ Set(kKeyOsName, "Windows");
#elif defined(OS_MACOSX)
- Set(kKeyOsName, kValueOsNameMac);
+ Set(kKeyOsName, "Mac");
#elif defined(OS_CHROMEOS)
- Set(kKeyOsName, kValueOsNameChromeOS);
+ Set(kKeyOsName, "ChromeOS");
#elif defined(OS_LINUX)
- Set(kKeyOsName, kValueOsNameLinux);
+ Set(kKeyOsName, "Linux");
#endif
// SysInfo::OperatingSystemVersionNumbers is only defined for the following
diff --git a/remoting/host/service_urls.cc b/remoting/host/service_urls.cc
index e73fc2abb6..8d8f083f93 100644
--- a/remoting/host/service_urls.cc
+++ b/remoting/host/service_urls.cc
@@ -7,8 +7,6 @@
#include "base/command_line.h"
#include "base/logging.h"
-namespace {
-
// Configurable service data.
const char kDirectoryBaseUrl[] = "https://www.googleapis.com/chromoting/v1";
const char kXmppServerAddress[] = "talk.google.com:5222";
@@ -16,16 +14,16 @@ const bool kXmppServerUseTls = true;
const char kDirectoryBotJid[] = "remoting@bot.talk.google.com";
// Command line switches.
+#if !defined(NDEBUG)
const char kDirectoryBaseUrlSwitch[] = "directory-base-url";
const char kXmppServerAddressSwitch[] = "xmpp-server-address";
const char kXmppServerDisableTlsSwitch[] = "disable-xmpp-server-tls";
const char kDirectoryBotJidSwitch[] = "directory-bot-jid";
+#endif // !defined(NDEBUG)
// Non-configurable service paths.
const char kDirectoryHostsSuffix[] = "/@me/hosts/";
-} // namespace
-
namespace remoting {
ServiceUrls::ServiceUrls()
diff --git a/remoting/host/win/elevated_controller.cc b/remoting/host/win/elevated_controller.cc
index 62d70c4f0a..c6bd37bb1e 100644
--- a/remoting/host/win/elevated_controller.cc
+++ b/remoting/host/win/elevated_controller.cc
@@ -52,10 +52,11 @@ const char kUnprivilegedConfigFileSecurityDescriptor[] =
// Configuration keys.
const char kHostId[] = "host_id";
const char kXmppLogin[] = "xmpp_login";
+const char kHostOwner[] = "host_owner";
const char kHostSecretHash[] = "host_secret_hash";
// The configuration keys that cannot be specified in UpdateConfig().
-const char* const kReadonlyKeys[] = { kHostId, kXmppLogin };
+const char* const kReadonlyKeys[] = { kHostId, kHostOwner, kXmppLogin };
// The configuration keys whose values may be read by GetConfig().
const char* const kUnprivilegedConfigKeys[] = { kHostId, kXmppLogin };
@@ -222,9 +223,14 @@ HRESULT WriteConfig(const char* content, size_t length, HWND owner_window) {
if (!config_value->GetAsDictionary(&config_dict)) {
return E_FAIL;
}
- std::string email, host_id, host_secret_hash;
- if (!config_dict->GetString(kXmppLogin, &email) ||
- !config_dict->GetString(kHostId, &host_id) ||
+ std::string email;
+ if (!config_dict->GetString(kHostOwner, &email)) {
+ if (!config_dict->GetString(kXmppLogin, &email)) {
+ return E_FAIL;
+ }
+ }
+ std::string host_id, host_secret_hash;
+ if (!config_dict->GetString(kHostId, &host_id) ||
!config_dict->GetString(kHostSecretHash, &host_secret_hash)) {
return E_FAIL;
}