Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: ui/aura_shell/root_window_event_filter.cc

Issue 8771015: Rename Desktop->RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura_shell/root_window_event_filter.h ('k') | ui/aura_shell/root_window_event_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « ui/aura_shell/root_window_event_filter.h ('k') | ui/aura_shell/root_window_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698