Commit 31bb3259 authored by James Cook's avatar James Cook Committed by Commit Bot

Rename ash::PointerWatcherAdapterClassic to PointerWatcherAdapter

There isn't a separate "classic" mode for ash anymore.

Bug: 842365
Test: ash_unittests
Change-Id: I52d758904cb0dc579e69e84c8ebd259e81aef7e2
Reviewed-on: https://chromium-review.googlesource.com/1167748Reviewed-by: default avatarJun Mukai <mukai@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581675}
parent 2021963d
...@@ -263,7 +263,7 @@ component("ash") { ...@@ -263,7 +263,7 @@ component("ash") {
"network_connect_delegate_mus.h", "network_connect_delegate_mus.h",
"new_window_controller.h", "new_window_controller.h",
"note_taking_controller.h", "note_taking_controller.h",
"pointer_watcher_adapter_classic.h", "pointer_watcher_adapter.h",
"policy/policy_recommendation_restorer.h", "policy/policy_recommendation_restorer.h",
"root_window_controller.h", "root_window_controller.h",
"root_window_settings.h", "root_window_settings.h",
...@@ -906,7 +906,7 @@ component("ash") { ...@@ -906,7 +906,7 @@ component("ash") {
"network_connect_delegate_mus.cc", "network_connect_delegate_mus.cc",
"new_window_controller.cc", "new_window_controller.cc",
"note_taking_controller.cc", "note_taking_controller.cc",
"pointer_watcher_adapter_classic.cc", "pointer_watcher_adapter.cc",
"policy/policy_recommendation_restorer.cc", "policy/policy_recommendation_restorer.cc",
"root_window_controller.cc", "root_window_controller.cc",
"root_window_settings.cc", "root_window_settings.cc",
...@@ -1781,7 +1781,7 @@ test("ash_unittests") { ...@@ -1781,7 +1781,7 @@ test("ash_unittests") {
"metrics/user_metrics_recorder_unittest.cc", "metrics/user_metrics_recorder_unittest.cc",
"multi_device_setup/multi_device_notification_presenter_unittest.cc", "multi_device_setup/multi_device_notification_presenter_unittest.cc",
"mus_property_mirror_ash_unittest.cc", "mus_property_mirror_ash_unittest.cc",
"pointer_watcher_adapter_classic_unittest.cc", "pointer_watcher_adapter_unittest.cc",
"policy/policy_recommendation_restorer_unittest.cc", "policy/policy_recommendation_restorer_unittest.cc",
"root_window_controller_unittest.cc", "root_window_controller_unittest.cc",
"rotator/screen_rotation_animation_unittest.cc", "rotator/screen_rotation_animation_unittest.cc",
...@@ -1818,8 +1818,8 @@ test("ash_unittests") { ...@@ -1818,8 +1818,8 @@ test("ash_unittests") {
"system/date/system_info_default_view_unittest.cc", "system/date/system_info_default_view_unittest.cc",
"system/enterprise/tray_enterprise_unittest.cc", "system/enterprise/tray_enterprise_unittest.cc",
"system/flag_warning/flag_warning_tray_unittest.cc", "system/flag_warning/flag_warning_tray_unittest.cc",
"system/ime/tray_ime_chromeos_unittest.cc",
"system/ime/ime_feature_pod_controller_unittest.cc", "system/ime/ime_feature_pod_controller_unittest.cc",
"system/ime/tray_ime_chromeos_unittest.cc",
"system/ime_menu/ime_menu_tray_unittest.cc", "system/ime_menu/ime_menu_tray_unittest.cc",
"system/keyboard_brightness/tray_keyboard_brightness_unittest.cc", "system/keyboard_brightness/tray_keyboard_brightness_unittest.cc",
"system/media_security/multi_profile_media_tray_item_unittest.cc", "system/media_security/multi_profile_media_tray_item_unittest.cc",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ash/pointer_watcher_adapter_classic.h" #include "ash/pointer_watcher_adapter.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/screen_position_client.h"
...@@ -16,15 +16,15 @@ ...@@ -16,15 +16,15 @@
namespace ash { namespace ash {
PointerWatcherAdapterClassic::PointerWatcherAdapterClassic() { PointerWatcherAdapter::PointerWatcherAdapter() {
Shell::Get()->AddPreTargetHandler(this); Shell::Get()->AddPreTargetHandler(this);
} }
PointerWatcherAdapterClassic::~PointerWatcherAdapterClassic() { PointerWatcherAdapter::~PointerWatcherAdapter() {
Shell::Get()->RemovePreTargetHandler(this); Shell::Get()->RemovePreTargetHandler(this);
} }
void PointerWatcherAdapterClassic::AddPointerWatcher( void PointerWatcherAdapter::AddPointerWatcher(
views::PointerWatcher* watcher, views::PointerWatcher* watcher,
views::PointerWatcherEventTypes events) { views::PointerWatcherEventTypes events) {
// We only allow a watcher to be added once. That is, we don't consider // We only allow a watcher to be added once. That is, we don't consider
...@@ -40,14 +40,14 @@ void PointerWatcherAdapterClassic::AddPointerWatcher( ...@@ -40,14 +40,14 @@ void PointerWatcherAdapterClassic::AddPointerWatcher(
non_move_watchers_.AddObserver(watcher); non_move_watchers_.AddObserver(watcher);
} }
void PointerWatcherAdapterClassic::RemovePointerWatcher( void PointerWatcherAdapter::RemovePointerWatcher(
views::PointerWatcher* watcher) { views::PointerWatcher* watcher) {
non_move_watchers_.RemoveObserver(watcher); non_move_watchers_.RemoveObserver(watcher);
move_watchers_.RemoveObserver(watcher); move_watchers_.RemoveObserver(watcher);
drag_watchers_.RemoveObserver(watcher); drag_watchers_.RemoveObserver(watcher);
} }
void PointerWatcherAdapterClassic::OnMouseEvent(ui::MouseEvent* event) { void PointerWatcherAdapter::OnMouseEvent(ui::MouseEvent* event) {
if (event->type() != ui::ET_MOUSE_PRESSED && if (event->type() != ui::ET_MOUSE_PRESSED &&
event->type() != ui::ET_MOUSE_RELEASED && event->type() != ui::ET_MOUSE_RELEASED &&
event->type() != ui::ET_MOUSE_MOVED && event->type() != ui::ET_MOUSE_MOVED &&
...@@ -60,7 +60,7 @@ void PointerWatcherAdapterClassic::OnMouseEvent(ui::MouseEvent* event) { ...@@ -60,7 +60,7 @@ void PointerWatcherAdapterClassic::OnMouseEvent(ui::MouseEvent* event) {
NotifyWatchers(ui::PointerEvent(*event), *event); NotifyWatchers(ui::PointerEvent(*event), *event);
} }
void PointerWatcherAdapterClassic::OnTouchEvent(ui::TouchEvent* event) { void PointerWatcherAdapter::OnTouchEvent(ui::TouchEvent* event) {
if (event->type() != ui::ET_TOUCH_PRESSED && if (event->type() != ui::ET_TOUCH_PRESSED &&
event->type() != ui::ET_TOUCH_RELEASED && event->type() != ui::ET_TOUCH_RELEASED &&
event->type() != ui::ET_TOUCH_MOVED) event->type() != ui::ET_TOUCH_MOVED)
...@@ -70,7 +70,7 @@ void PointerWatcherAdapterClassic::OnTouchEvent(ui::TouchEvent* event) { ...@@ -70,7 +70,7 @@ void PointerWatcherAdapterClassic::OnTouchEvent(ui::TouchEvent* event) {
NotifyWatchers(ui::PointerEvent(*event), *event); NotifyWatchers(ui::PointerEvent(*event), *event);
} }
gfx::Point PointerWatcherAdapterClassic::GetLocationInScreen( gfx::Point PointerWatcherAdapter::GetLocationInScreen(
const ui::LocatedEvent& event) const { const ui::LocatedEvent& event) const {
gfx::Point location_in_screen; gfx::Point location_in_screen;
if (event.type() == ui::ET_MOUSE_CAPTURE_CHANGED) { if (event.type() == ui::ET_MOUSE_CAPTURE_CHANGED) {
...@@ -84,7 +84,7 @@ gfx::Point PointerWatcherAdapterClassic::GetLocationInScreen( ...@@ -84,7 +84,7 @@ gfx::Point PointerWatcherAdapterClassic::GetLocationInScreen(
return location_in_screen; return location_in_screen;
} }
void PointerWatcherAdapterClassic::NotifyWatchers( void PointerWatcherAdapter::NotifyWatchers(
const ui::PointerEvent& event, const ui::PointerEvent& event,
const ui::LocatedEvent& original_event) { const ui::LocatedEvent& original_event) {
const gfx::Point screen_location(GetLocationInScreen(original_event)); const gfx::Point screen_location(GetLocationInScreen(original_event));
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef ASH_POINTER_WATCHER_ADAPTER_CLASSIC_H_ #ifndef ASH_POINTER_WATCHER_ADAPTER_H_
#define ASH_POINTER_WATCHER_ADAPTER_CLASSIC_H_ #define ASH_POINTER_WATCHER_ADAPTER_H_
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -27,12 +27,12 @@ enum class PointerWatcherEventTypes; ...@@ -27,12 +27,12 @@ enum class PointerWatcherEventTypes;
namespace ash { namespace ash {
// Support for PointerWatchers in non-mus ash, implemented with a pre-target // Support for PointerWatchers in ash, implemented with a pre-target
// EventHandler on the Shell. // EventHandler on the Shell.
class ASH_EXPORT PointerWatcherAdapterClassic : public ui::EventHandler { class ASH_EXPORT PointerWatcherAdapter : public ui::EventHandler {
public: public:
PointerWatcherAdapterClassic(); PointerWatcherAdapter();
~PointerWatcherAdapterClassic() override; ~PointerWatcherAdapter() override;
// See Shell::AddPointerWatcher() for details. // See Shell::AddPointerWatcher() for details.
void AddPointerWatcher(views::PointerWatcher* watcher, void AddPointerWatcher(views::PointerWatcher* watcher,
...@@ -62,9 +62,9 @@ class ASH_EXPORT PointerWatcherAdapterClassic : public ui::EventHandler { ...@@ -62,9 +62,9 @@ class ASH_EXPORT PointerWatcherAdapterClassic : public ui::EventHandler {
base::ObserverList<views::PointerWatcher, true> move_watchers_; base::ObserverList<views::PointerWatcher, true> move_watchers_;
base::ObserverList<views::PointerWatcher, true> drag_watchers_; base::ObserverList<views::PointerWatcher, true> drag_watchers_;
DISALLOW_COPY_AND_ASSIGN(PointerWatcherAdapterClassic); DISALLOW_COPY_AND_ASSIGN(PointerWatcherAdapter);
}; };
} // namespace ash } // namespace ash
#endif // ASH_POINTER_WATCHER_ADAPTER_CLASSIC_H_ #endif // ASH_POINTER_WATCHER_ADAPTER_H_
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ash/public/cpp/config.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/test/ash_test_base.h" #include "ash/test/ash_test_base.h"
#include "ui/events/base_event_utils.h" #include "ui/events/base_event_utils.h"
...@@ -13,7 +12,7 @@ ...@@ -13,7 +12,7 @@
namespace ash { namespace ash {
using PointerWatcherAdapterClassicTest = AshTestBase; using PointerWatcherAdapterTest = AshTestBase;
enum TestPointerCaptureEvents { enum TestPointerCaptureEvents {
NONE = 0x01, NONE = 0x01,
...@@ -149,11 +148,7 @@ class TestHelper { ...@@ -149,11 +148,7 @@ class TestHelper {
DISALLOW_COPY_AND_ASSIGN(TestHelper); DISALLOW_COPY_AND_ASSIGN(TestHelper);
}; };
TEST_F(PointerWatcherAdapterClassicTest, MouseEvents) { TEST_F(PointerWatcherAdapterTest, MouseEvents) {
// Not relevant for mash.
if (Shell::GetAshConfig() == Config::MASH_DEPRECATED)
return;
TestHelper helper; TestHelper helper;
// Move: only the move and drag PointerWatcher should get the event. // Move: only the move and drag PointerWatcher should get the event.
...@@ -195,11 +190,7 @@ TEST_F(PointerWatcherAdapterClassicTest, MouseEvents) { ...@@ -195,11 +190,7 @@ TEST_F(PointerWatcherAdapterClassicTest, MouseEvents) {
helper.ExpectCallCount(CAPTURE, CAPTURE, CAPTURE); helper.ExpectCallCount(CAPTURE, CAPTURE, CAPTURE);
} }
TEST_F(PointerWatcherAdapterClassicTest, TouchEvents) { TEST_F(PointerWatcherAdapterTest, TouchEvents) {
// Not relevant for mash.
if (Shell::GetAshConfig() == Config::MASH_DEPRECATED)
return;
TestHelper helper; TestHelper helper;
// Press: all. // Press: all.
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
#include "ash/multi_device_setup/multi_device_notification_presenter.h" #include "ash/multi_device_setup/multi_device_notification_presenter.h"
#include "ash/new_window_controller.h" #include "ash/new_window_controller.h"
#include "ash/note_taking_controller.h" #include "ash/note_taking_controller.h"
#include "ash/pointer_watcher_adapter_classic.h" #include "ash/pointer_watcher_adapter.h"
#include "ash/policy/policy_recommendation_restorer.h" #include "ash/policy/policy_recommendation_restorer.h"
#include "ash/public/cpp/ash_constants.h" #include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_features.h"
...@@ -1200,7 +1200,7 @@ void Shell::Init( ...@@ -1200,7 +1200,7 @@ void Shell::Init(
// Must occur after Shell has installed its early pre-target handlers (for // Must occur after Shell has installed its early pre-target handlers (for
// example, WindowModalityController). // example, WindowModalityController).
pointer_watcher_adapter_ = std::make_unique<PointerWatcherAdapterClassic>(); pointer_watcher_adapter_ = std::make_unique<PointerWatcherAdapter>();
resize_shadow_controller_.reset(new ResizeShadowController()); resize_shadow_controller_.reset(new ResizeShadowController());
shadow_controller_.reset(new ::wm::ShadowController( shadow_controller_.reset(new ::wm::ShadowController(
......
...@@ -153,7 +153,7 @@ class OverlayEventFilter; ...@@ -153,7 +153,7 @@ class OverlayEventFilter;
class PartialMagnificationController; class PartialMagnificationController;
class PeripheralBatteryNotifier; class PeripheralBatteryNotifier;
class PersistentWindowController; class PersistentWindowController;
class PointerWatcherAdapterClassic; class PointerWatcherAdapter;
class PolicyRecommendationRestorer; class PolicyRecommendationRestorer;
class PowerButtonController; class PowerButtonController;
class PowerEventObserver; class PowerEventObserver;
...@@ -755,7 +755,7 @@ class ASH_EXPORT Shell : public SessionObserver, ...@@ -755,7 +755,7 @@ class ASH_EXPORT Shell : public SessionObserver,
std::unique_ptr<MultiDeviceNotificationPresenter> std::unique_ptr<MultiDeviceNotificationPresenter>
multidevice_notification_presenter_; multidevice_notification_presenter_;
std::unique_ptr<NewWindowController> new_window_controller_; std::unique_ptr<NewWindowController> new_window_controller_;
std::unique_ptr<PointerWatcherAdapterClassic> pointer_watcher_adapter_; std::unique_ptr<PointerWatcherAdapter> pointer_watcher_adapter_;
std::unique_ptr<ResizeShadowController> resize_shadow_controller_; std::unique_ptr<ResizeShadowController> resize_shadow_controller_;
std::unique_ptr<SessionController> session_controller_; std::unique_ptr<SessionController> session_controller_;
std::unique_ptr<NightLightController> night_light_controller_; std::unique_ptr<NightLightController> night_light_controller_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment