summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 23:38:39 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 23:38:39 +0000
commit7a05bdc2c52dde6baa9441996f245bfec307a482 (patch)
treec7e378ff3dfe17731b9bbe8e313792236ea8fb2e /ui
parent88d7d84ebff6e875a44db253f7eefb7d9040593d (diff)
downloadchromium_src-7a05bdc2c52dde6baa9441996f245bfec307a482.zip
chromium_src-7a05bdc2c52dde6baa9441996f245bfec307a482.tar.gz
chromium_src-7a05bdc2c52dde6baa9441996f245bfec307a482.tar.bz2
Fix menu on aura/linux
Added DispatchNativeEvent on Desktop so that Dispatcher can dispatch native event. This will be used in a few other places that needs to redispatch native event (simple_message_box_views.cc for example) cleanup unused variables. BUG=none TEST=run aura_shell_exe on linux, right click on a window to open menu. Review URL: http://codereview.chromium.org/8124005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104025 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/desktop.cc9
-rw-r--r--ui/aura/desktop.h4
-rw-r--r--ui/aura_shell/examples/window_type_launcher.h1
3 files changed, 13 insertions, 1 deletions
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc
index 43d76ba..6364836 100644
--- a/ui/aura/desktop.cc
+++ b/ui/aura/desktop.cc
@@ -132,6 +132,15 @@ void Desktop::WindowDestroying(Window* window) {
SetActiveWindow(GetTopmostWindowToActivate(window), NULL);
}
+bool Desktop::DispatchNativeEvent(const ui::NativeEvent& event) {
+ // TODO(oshima): consolidate windows and linux.
+#if defined(OS_WIN)
+ return host_->Dispatch(event);
+#else
+ return host_->Dispatch(event) != base::MessagePumpDispatcher::EVENT_IGNORED;
+#endif
+}
+
Window* Desktop::GetTopmostWindowToActivate(Window* ignore) {
Window::Windows windows(default_parent_->children());
for (Window::Windows::const_reverse_iterator i = windows.rbegin();
diff --git a/ui/aura/desktop.h b/ui/aura/desktop.h
index 1af4b8f..dcbea6d 100644
--- a/ui/aura/desktop.h
+++ b/ui/aura/desktop.h
@@ -12,6 +12,7 @@
#include "ui/aura/aura_export.h"
#include "ui/aura/cursor.h"
#include "ui/aura/root_window.h"
+#include "ui/base/events.h"
#include "ui/gfx/compositor/compositor.h"
#include "ui/gfx/native_widget_types.h"
@@ -91,6 +92,9 @@ class AURA_EXPORT Desktop : public ui::CompositorDelegate {
// Invoked from RootWindow when |window| is being destroyed.
void WindowDestroying(Window* window);
+ // Dispatch NativeEvent.
+ bool DispatchNativeEvent(const ui::NativeEvent& event);
+
static Desktop* GetInstance();
private:
diff --git a/ui/aura_shell/examples/window_type_launcher.h b/ui/aura_shell/examples/window_type_launcher.h
index 08cdff0..1f9ed5f 100644
--- a/ui/aura_shell/examples/window_type_launcher.h
+++ b/ui/aura_shell/examples/window_type_launcher.h
@@ -71,7 +71,6 @@ class WindowTypeLauncher : public views::WidgetDelegateView,
views::NativeTextButton* create_button_;
views::NativeTextButton* create_nonresizable_button_;
views::NativeTextButton* bubble_button_;
- views::NativeTextButton* tile_button_;
views::NativeTextButton* lock_button_;
scoped_ptr<views::MenuRunner> menu_runner_;