Index: ui/aura/event_filter.cc |
diff --git a/ui/aura/event_filter.cc b/ui/aura/event_filter.cc |
index 68748fbe3dafdec09654e804d12ee94651a1cae6..41436b3c1c090ff00d9aea8d40fa98e436f32f19 100644 |
--- a/ui/aura/event_filter.cc |
+++ b/ui/aura/event_filter.cc |
@@ -4,6 +4,10 @@ |
#include "ui/aura/event_filter.h" |
+#include "ui/aura/event.h" |
+#include "ui/aura/focus_manager.h" |
+#include "ui/aura/window.h" |
+ |
namespace aura { |
EventFilter::EventFilter(Window* owner) : owner_(owner) { |
@@ -13,6 +17,11 @@ EventFilter::~EventFilter() { |
} |
bool EventFilter::OnMouseEvent(Window* target, MouseEvent* event) { |
+ if (event->type() == ui::ET_MOUSE_PRESSED) { |
+ // TODO(beng): some windows (e.g. disabled ones, tooltips, etc) may not be |
+ // focusable. |
+ target->GetFocusManager()->SetFocusedWindow(target); |
+ } |
return false; |
} |