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

Unified Diff: ash/aura/pointer_watcher_adapter.cc

Issue 2267023003: ash: Eliminate PointerWatcherDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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 | « ash/aura/pointer_watcher_adapter.h ('k') | ash/aura/pointer_watcher_adapter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/aura/pointer_watcher_adapter.cc
diff --git a/ash/pointer_watcher_delegate_aura.cc b/ash/aura/pointer_watcher_adapter.cc
similarity index 82%
rename from ash/pointer_watcher_delegate_aura.cc
rename to ash/aura/pointer_watcher_adapter.cc
index 541a2b5643c1d25ef057667b50c2ce1cc5648b45..c57b6b5d5d6c2df393883e3c7ea08cff324c19c9 100644
--- a/ash/pointer_watcher_delegate_aura.cc
+++ b/ash/aura/pointer_watcher_adapter.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/pointer_watcher_delegate_aura.h"
+#include "ash/aura/pointer_watcher_adapter.h"
#include "ash/shell.h"
#include "ui/aura/client/screen_position_client.h"
@@ -15,17 +15,16 @@
namespace ash {
-PointerWatcherDelegateAura::PointerWatcherDelegateAura() {
+PointerWatcherAdapter::PointerWatcherAdapter() {
Shell::GetInstance()->AddPreTargetHandler(this);
}
-PointerWatcherDelegateAura::~PointerWatcherDelegateAura() {
+PointerWatcherAdapter::~PointerWatcherAdapter() {
Shell::GetInstance()->RemovePreTargetHandler(this);
}
-void PointerWatcherDelegateAura::AddPointerWatcher(
- views::PointerWatcher* watcher,
- bool wants_moves) {
+void PointerWatcherAdapter::AddPointerWatcher(views::PointerWatcher* watcher,
+ bool wants_moves) {
// We only allow a watcher to be added once. That is, we don't consider
// the pair of |watcher| and |wants_move| unique, just |watcher|.
if (wants_moves) {
@@ -37,13 +36,13 @@ void PointerWatcherDelegateAura::AddPointerWatcher(
}
}
-void PointerWatcherDelegateAura::RemovePointerWatcher(
+void PointerWatcherAdapter::RemovePointerWatcher(
views::PointerWatcher* watcher) {
non_move_watchers_.RemoveObserver(watcher);
move_watchers_.RemoveObserver(watcher);
}
-void PointerWatcherDelegateAura::OnMouseEvent(ui::MouseEvent* event) {
+void PointerWatcherAdapter::OnMouseEvent(ui::MouseEvent* event) {
if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED) {
FOR_EACH_OBSERVER(views::PointerWatcher, non_move_watchers_,
OnMouseCaptureChanged());
@@ -62,7 +61,7 @@ void PointerWatcherDelegateAura::OnMouseEvent(ui::MouseEvent* event) {
NotifyWatchers(ui::PointerEvent(*event), *event);
}
-void PointerWatcherDelegateAura::OnTouchEvent(ui::TouchEvent* event) {
+void PointerWatcherAdapter::OnTouchEvent(ui::TouchEvent* event) {
// For compatibility with the mus version, don't send drags.
if (event->type() != ui::ET_TOUCH_PRESSED &&
event->type() != ui::ET_TOUCH_RELEASED)
@@ -72,7 +71,7 @@ void PointerWatcherDelegateAura::OnTouchEvent(ui::TouchEvent* event) {
NotifyWatchers(ui::PointerEvent(*event), *event);
}
-gfx::Point PointerWatcherDelegateAura::GetLocationInScreen(
+gfx::Point PointerWatcherAdapter::GetLocationInScreen(
const ui::LocatedEvent& event) const {
aura::Window* target = static_cast<aura::Window*>(event.target());
gfx::Point location_in_screen = event.location();
@@ -81,13 +80,13 @@ gfx::Point PointerWatcherDelegateAura::GetLocationInScreen(
return location_in_screen;
}
-views::Widget* PointerWatcherDelegateAura::GetTargetWidget(
+views::Widget* PointerWatcherAdapter::GetTargetWidget(
const ui::LocatedEvent& event) const {
aura::Window* window = static_cast<aura::Window*>(event.target());
return views::Widget::GetTopLevelWidgetForNativeView(window);
}
-void PointerWatcherDelegateAura::NotifyWatchers(
+void PointerWatcherAdapter::NotifyWatchers(
const ui::PointerEvent& event,
const ui::LocatedEvent& original_event) {
const gfx::Point screen_location(GetLocationInScreen(original_event));
« no previous file with comments | « ash/aura/pointer_watcher_adapter.h ('k') | ash/aura/pointer_watcher_adapter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698