| Index: ui/aura_shell/root_window_event_filter.cc
|
| ===================================================================
|
| --- ui/aura_shell/root_window_event_filter.cc (revision 113260)
|
| +++ ui/aura_shell/root_window_event_filter.cc (working copy)
|
| @@ -2,11 +2,11 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ui/aura_shell/desktop_event_filter.h"
|
| +#include "ui/aura_shell/root_window_event_filter.h"
|
|
|
| -#include "ui/aura/desktop.h"
|
| #include "ui/aura/event.h"
|
| #include "ui/aura/focus_manager.h"
|
| +#include "ui/aura/root_window.h"
|
| #include "ui/aura/window_delegate.h"
|
| #include "ui/aura_shell/shell.h"
|
| #include "ui/aura_shell/stacking_controller.h"
|
| @@ -40,36 +40,36 @@
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// DesktopEventFilter, public:
|
| +// RootWindowEventFilter, public:
|
|
|
| -DesktopEventFilter::DesktopEventFilter()
|
| - : EventFilter(aura::Desktop::GetInstance()) {
|
| +RootWindowEventFilter::RootWindowEventFilter()
|
| + : EventFilter(aura::RootWindow::GetInstance()) {
|
| }
|
|
|
| -DesktopEventFilter::~DesktopEventFilter() {
|
| - // Additional filters are not owned by DesktopEventFilter and they
|
| +RootWindowEventFilter::~RootWindowEventFilter() {
|
| + // Additional filters are not owned by RootWindowEventFilter and they
|
| // should all be removed when running here. |filters_| has
|
| // check_empty == true and will DCHECK failure if it is not empty.
|
| }
|
|
|
| -void DesktopEventFilter::AddFilter(aura::EventFilter* filter) {
|
| +void RootWindowEventFilter::AddFilter(aura::EventFilter* filter) {
|
| filters_.AddObserver(filter);
|
| }
|
|
|
| -void DesktopEventFilter::RemoveFilter(aura::EventFilter* filter) {
|
| +void RootWindowEventFilter::RemoveFilter(aura::EventFilter* filter) {
|
| filters_.RemoveObserver(filter);
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// DesktopEventFilter, EventFilter implementation:
|
| +// RootWindowEventFilter, EventFilter implementation:
|
|
|
| -bool DesktopEventFilter::PreHandleKeyEvent(aura::Window* target,
|
| - aura::KeyEvent* event) {
|
| +bool RootWindowEventFilter::PreHandleKeyEvent(aura::Window* target,
|
| + aura::KeyEvent* event) {
|
| return FilterKeyEvent(target, event);
|
| }
|
|
|
| -bool DesktopEventFilter::PreHandleMouseEvent(aura::Window* target,
|
| - aura::MouseEvent* event) {
|
| +bool RootWindowEventFilter::PreHandleMouseEvent(aura::Window* target,
|
| + aura::MouseEvent* event) {
|
| // We must always update the cursor, otherwise the cursor can get stuck if an
|
| // event filter registered with us consumes the event.
|
| if (event->type() == ui::ET_MOUSE_MOVED)
|
| @@ -84,7 +84,7 @@
|
| return false;
|
| }
|
|
|
| -ui::TouchStatus DesktopEventFilter::PreHandleTouchEvent(
|
| +ui::TouchStatus RootWindowEventFilter::PreHandleTouchEvent(
|
| aura::Window* target,
|
| aura::TouchEvent* event) {
|
| ui::TouchStatus status = FilterTouchEvent(target, event);
|
| @@ -97,32 +97,32 @@
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// DesktopEventFilter, private:
|
| +// RootWindowEventFilter, private:
|
|
|
| -void DesktopEventFilter::ActivateIfNecessary(aura::Window* window,
|
| - aura::Event* event) {
|
| +void RootWindowEventFilter::ActivateIfNecessary(aura::Window* window,
|
| + aura::Event* event) {
|
| aura::Window* activatable = StackingController::GetActivatableWindow(window);
|
| - if (activatable == aura::Desktop::GetInstance()->active_window()) {
|
| + if (activatable == aura::RootWindow::GetInstance()->active_window()) {
|
| // |window| is a descendant of the active window, no need to activate.
|
| window->GetFocusManager()->SetFocusedWindow(window);
|
| } else {
|
| - aura::Desktop::GetInstance()->SetActiveWindow(activatable, window);
|
| + aura::RootWindow::GetInstance()->SetActiveWindow(activatable, window);
|
| }
|
| }
|
|
|
| -void DesktopEventFilter::UpdateCursor(aura::Window* target,
|
| - aura::MouseEvent* event) {
|
| +void RootWindowEventFilter::UpdateCursor(aura::Window* target,
|
| + aura::MouseEvent* event) {
|
| gfx::NativeCursor cursor = target->GetCursor(event->location());
|
| if (event->flags() & ui::EF_IS_NON_CLIENT) {
|
| int window_component =
|
| target->delegate()->GetNonClientComponent(event->location());
|
| cursor = CursorForWindowComponent(window_component);
|
| }
|
| - aura::Desktop::GetInstance()->SetCursor(cursor);
|
| + aura::RootWindow::GetInstance()->SetCursor(cursor);
|
| }
|
|
|
| -bool DesktopEventFilter::FilterKeyEvent(aura::Window* target,
|
| - aura::KeyEvent* event) {
|
| +bool RootWindowEventFilter::FilterKeyEvent(aura::Window* target,
|
| + aura::KeyEvent* event) {
|
| bool handled = false;
|
| if (filters_.might_have_observers()) {
|
| ObserverListBase<aura::EventFilter>::Iterator it(filters_);
|
| @@ -133,8 +133,8 @@
|
| return handled;
|
| }
|
|
|
| -bool DesktopEventFilter::FilterMouseEvent(aura::Window* target,
|
| - aura::MouseEvent* event) {
|
| +bool RootWindowEventFilter::FilterMouseEvent(aura::Window* target,
|
| + aura::MouseEvent* event) {
|
| bool handled = false;
|
| if (filters_.might_have_observers()) {
|
| ObserverListBase<aura::EventFilter>::Iterator it(filters_);
|
| @@ -145,8 +145,9 @@
|
| return handled;
|
| }
|
|
|
| -ui::TouchStatus DesktopEventFilter::FilterTouchEvent(aura::Window* target,
|
| - aura::TouchEvent* event) {
|
| +ui::TouchStatus RootWindowEventFilter::FilterTouchEvent(
|
| + aura::Window* target,
|
| + aura::TouchEvent* event) {
|
| ui::TouchStatus status = ui::TOUCH_STATUS_UNKNOWN;
|
| if (filters_.might_have_observers()) {
|
| ObserverListBase<aura::EventFilter>::Iterator it(filters_);
|
|
|