summaryrefslogtreecommitdiffstats
path: root/ui/aura
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-07 14:44:53 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-07 14:44:53 +0000
commit8f80db0f2c8b752d0f405f541ce7f9f88a698517 (patch)
treec43c65357d18150441a27df3129fbcb118c7a625 /ui/aura
parent0ae649994e12ba599ad74a41129e046f941c064e (diff)
downloadchromium_src-8f80db0f2c8b752d0f405f541ce7f9f88a698517.zip
chromium_src-8f80db0f2c8b752d0f405f541ce7f9f88a698517.tar.gz
chromium_src-8f80db0f2c8b752d0f405f541ce7f9f88a698517.tar.bz2
Implements accelerator handling for menus on aura.
BUG=105964 TEST=Manual Review URL: https://chromiumcodereview.appspot.com/9224001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120777 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r--ui/aura/aura.gyp2
-rw-r--r--ui/aura/client/dispatcher_client.cc31
-rw-r--r--ui/aura/client/dispatcher_client.h29
3 files changed, 62 insertions, 0 deletions
diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp
index c84a74e..8c4bc99 100644
--- a/ui/aura/aura.gyp
+++ b/ui/aura/aura.gyp
@@ -32,6 +32,8 @@
'client/activation_delegate.h',
'client/aura_constants.cc',
'client/aura_constants.h',
+ 'client/dispatcher_client.cc',
+ 'client/dispatcher_client.h',
'client/drag_drop_client.cc',
'client/drag_drop_client.h',
'client/drag_drop_delegate.cc',
diff --git a/ui/aura/client/dispatcher_client.cc b/ui/aura/client/dispatcher_client.cc
new file mode 100644
index 0000000..f9cd3ac
--- /dev/null
+++ b/ui/aura/client/dispatcher_client.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2012 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 "ui/aura/client/dispatcher_client.h"
+
+#include "ui/aura/root_window.h"
+
+namespace aura {
+
+namespace client {
+
+namespace {
+
+// A property key to store the nested dispatcher controller. The type of the
+// value is |aura::client::DispatcherClient*|.
+const char kDispatcherClient[] = "AuraDispatcherClient";
+
+} // namespace
+
+void SetDispatcherClient(DispatcherClient* client) {
+ RootWindow::GetInstance()->SetProperty(kDispatcherClient, client);
+}
+
+DispatcherClient* GetDispatcherClient() {
+ return reinterpret_cast<DispatcherClient*>(
+ RootWindow::GetInstance()->GetProperty(kDispatcherClient));
+}
+
+} // namespace client
+} // namespace aura
diff --git a/ui/aura/client/dispatcher_client.h b/ui/aura/client/dispatcher_client.h
new file mode 100644
index 0000000..099e370
--- /dev/null
+++ b/ui/aura/client/dispatcher_client.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2012 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 UI_AURA_CLIENT_DISPATCHER_CLIENT_H_
+#define UI_AURA_CLIENT_DISPATCHER_CLIENT_H_
+#pragma once
+
+#include "ui/aura/aura_export.h"
+#include "base/message_loop.h"
+
+namespace aura {
+
+namespace client {
+
+// An interface implemented by an object which handles nested dispatchers.
+class AURA_EXPORT DispatcherClient {
+ public:
+ virtual void RunWithDispatcher(MessageLoop::Dispatcher* dispatcher,
+ bool nestable_tasks_allowed) = 0;
+};
+
+AURA_EXPORT void SetDispatcherClient(DispatcherClient* client);
+AURA_EXPORT DispatcherClient* GetDispatcherClient();
+
+} // namespace client
+} // namespace aura
+
+#endif // UI_AURA_CLIENT_DISPATCHER_CLIENT_H_