summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 00:38:13 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 00:38:13 +0000
commit448cce5ac719f13dbe5c5e986bca3dbb19925ebc (patch)
tree124613f2849c352c7a64374702674296eff08bcc /remoting
parent2bb83e405afd54dd75f88e024e6de1f6809a69d2 (diff)
downloadchromium_src-448cce5ac719f13dbe5c5e986bca3dbb19925ebc.zip
chromium_src-448cce5ac719f13dbe5c5e986bca3dbb19925ebc.tar.gz
chromium_src-448cce5ac719f13dbe5c5e986bca3dbb19925ebc.tar.bz2
Disable Ctrl+Alt+Esc on Mac and Linux.
BUG=129652,129684 Review URL: https://chromiumcodereview.appspot.com/10453015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/host_user_interface.cc10
-rw-r--r--remoting/host/host_user_interface.h7
-rw-r--r--remoting/host/local_input_monitor.h4
-rw-r--r--remoting/host/local_input_monitor_mac.mm17
-rw-r--r--remoting/host/remoting_me2me_host.cc1
-rw-r--r--remoting/host/ui_strings.cc9
6 files changed, 46 insertions, 2 deletions
diff --git a/remoting/host/host_user_interface.cc b/remoting/host/host_user_interface.cc
index 0009ea0..365b52b 100644
--- a/remoting/host/host_user_interface.cc
+++ b/remoting/host/host_user_interface.cc
@@ -16,7 +16,8 @@ HostUserInterface::HostUserInterface(ChromotingHostContext* context)
: host_(NULL),
context_(context),
is_monitoring_local_inputs_(false),
- ui_thread_proxy_(context->ui_message_loop()) {
+ ui_thread_proxy_(context->ui_message_loop()),
+ disable_disconnect_shortcut_on_mac_(false) {
}
HostUserInterface::~HostUserInterface() {
@@ -41,6 +42,10 @@ void HostUserInterface::Start(ChromotingHost* host,
host_->AddStatusObserver(this);
}
+void HostUserInterface::DisableDisconnectShortcutOnMac() {
+ disable_disconnect_shortcut_on_mac_ = true;
+}
+
void HostUserInterface::OnClientAuthenticated(const std::string& jid) {
authenticated_jid_ = jid;
@@ -125,6 +130,9 @@ void HostUserInterface::MonitorLocalInputs(bool enable) {
if (enable != is_monitoring_local_inputs_) {
if (enable) {
local_input_monitor_->Start(host_);
+ if (disable_disconnect_shortcut_on_mac_) {
+ local_input_monitor_->DisableShortcutOnMac();
+ }
} else {
local_input_monitor_->Stop();
}
diff --git a/remoting/host/host_user_interface.h b/remoting/host/host_user_interface.h
index 9c2729e..806361f 100644
--- a/remoting/host/host_user_interface.h
+++ b/remoting/host/host_user_interface.h
@@ -31,6 +31,11 @@ class HostUserInterface : public HostStatusObserver {
virtual void Start(ChromotingHost* host,
const base::Closure& disconnect_callback);
+ // TODO(sergeyu): Disconnect shortcut is disabled with Me2Me on Mac
+ // because it didn't work properly. Fix and remove this hack.
+ // http://crbug.com/129684
+ void DisableDisconnectShortcutOnMac();
+
// HostStatusObserver implementation. These methods will be called from the
// network thread.
virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE;
@@ -97,6 +102,8 @@ class HostUserInterface : public HostStatusObserver {
ScopedThreadProxy ui_thread_proxy_;
+ bool disable_disconnect_shortcut_on_mac_;
+
DISALLOW_COPY_AND_ASSIGN(HostUserInterface);
};
diff --git a/remoting/host/local_input_monitor.h b/remoting/host/local_input_monitor.h
index 8e05700..39de156 100644
--- a/remoting/host/local_input_monitor.h
+++ b/remoting/host/local_input_monitor.h
@@ -18,6 +18,10 @@ class LocalInputMonitor {
virtual void Start(ChromotingHost* host) = 0;
virtual void Stop() = 0;
+ // TODO(sergeyu): This is a short-term hack to disable disconnection
+ // shortcut on Mac.
+ virtual void DisableShortcutOnMac() {};
+
static scoped_ptr<LocalInputMonitor> Create();
};
diff --git a/remoting/host/local_input_monitor_mac.mm b/remoting/host/local_input_monitor_mac.mm
index b25496f..99a56be 100644
--- a/remoting/host/local_input_monitor_mac.mm
+++ b/remoting/host/local_input_monitor_mac.mm
@@ -52,6 +52,9 @@ typedef std::set<scoped_refptr<remoting::ChromotingHost> > Hosts;
// monitored, in which case the object should be destroyed.
- (bool)removeHost:(remoting::ChromotingHost*)host;
+// Disabled disconnection keyboard shortcut.
+- (void)disableShortcut;
+
@end
static CGEventRef LocalMouseMoved(CGEventTapProxy proxy, CGEventType type,
@@ -141,6 +144,15 @@ static CGEventRef LocalMouseMoved(CGEventTapProxy proxy, CGEventType type,
return hosts_.empty();
}
+- (void)disableShortcut {
+ if (hotKey_) {
+ GTMCarbonEventDispatcherHandler* handler =
+ [GTMCarbonEventDispatcherHandler sharedEventDispatcherHandler];
+ [handler unregisterHotKey:hotKey_];
+ hotKey_ = NULL;
+ }
+}
+
@end
namespace remoting {
@@ -153,6 +165,7 @@ class LocalInputMonitorMac : public LocalInputMonitor {
virtual ~LocalInputMonitorMac();
virtual void Start(ChromotingHost* host) OVERRIDE;
virtual void Stop() OVERRIDE;
+ virtual void DisableShortcutOnMac() OVERRIDE;
private:
ChromotingHost* host_;
@@ -186,6 +199,10 @@ void LocalInputMonitorMac::Stop() {
}
}
+void LocalInputMonitorMac::DisableShortcutOnMac() {
+ [local_input_monitor disableShortcut];
+}
+
scoped_ptr<LocalInputMonitor> LocalInputMonitor::Create() {
return scoped_ptr<LocalInputMonitor>(new LocalInputMonitorMac());
}
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 71f2564..2045347 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -202,6 +202,7 @@ class HostProcess
#if defined(OS_MACOSX) || defined(OS_WIN)
host_user_interface_.reset(new HostUserInterface(context_.get()));
+ host_user_interface_->DisableDisconnectShortcutOnMac();
#endif
StartWatchingNatPolicy();
diff --git a/remoting/host/ui_strings.cc b/remoting/host/ui_strings.cc
index 99c59b3..06d912b 100644
--- a/remoting/host/ui_strings.cc
+++ b/remoting/host/ui_strings.cc
@@ -18,7 +18,14 @@ UiStrings::UiStrings() :
// doesn't have a bundle (and hence no dialog) on that platform and
// the web-app will provide the correct localization for this string.
disconnect_button_text_plus_shortcut(
- ASCIIToUTF16("Disconnect (Ctrl+Alt+Esc)")),
+#if defined(OS_MACOSX)
+ // TODO(sergeyu): Currently the shortcut is disabled because it
+ // doesn't work properly on Mac.
+ ASCIIToUTF16("Disconnect")
+#else // !defined(OS_MACOSX)
+ ASCIIToUTF16("Disconnect (Ctrl+Alt+Esc)")
+#endif // !defined(OS_MACOSX)
+ ),
continue_prompt(ASCIIToUTF16(
"You are currently sharing this machine with another user. "
"Please confirm that you want to continue sharing.")),