Get some of the ash_unittests to run without crashing.

We currently make it as far as RootWindowControllerTest.MoveWindows_Basic.

This CL:
- changes ui::EventTarget::CanAcceptEvents to be CanAcceptEvent and take an event. This allows the event type to determine whether or not it can be accepted by the target.
- copy-pasta from ActivationController to AshActivationRules (GetNextWindowToActivate())
- forwarding to target handler for generic events in EventTarget
- RootWindowControllerTest needs to handle activation events @ the target and forward to OnBlur impl.

http://crbug.com/162100
[email protected]
Review URL: https://codereview.chromium.org/11445023

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171583 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index e8f5763..2635d12 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -21,6 +21,7 @@
 #include "ui/aura/window.h"
 #include "ui/aura/window_tracker.h"
 #include "ui/views/controls/menu/menu_controller.h"
+#include "ui/views/corewm/focus_change_event.h"
 #include "ui/views/widget/widget.h"
 #include "ui/views/widget/widget_delegate.h"
 
@@ -53,6 +54,7 @@
 
   void set_window(aura::Window* window) { window_ = window; }
 
+ private:
   // aura::test::TestWindowDelegate overrides:
   virtual bool CanFocus() OVERRIDE {
     return true;
@@ -61,7 +63,15 @@
     delete window_;
   }
 
- private:
+  // ui::EventHandler overrides:
+  virtual void OnEvent(ui::Event* event) OVERRIDE {
+    if (event->type() ==
+        views::corewm::FocusChangeEvent::focus_changing_event_type()) {
+      if (event->target() == window_)
+        OnBlur();
+    }
+  }
+
   aura::Window* window_;
 
   DISALLOW_COPY_AND_ASSIGN(DeleteOnBlurDelegate);