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

Unified Diff: ash/magnifier/partial_magnification_controller.cc

Issue 2361563002: chromeos: Laser tool blocks events from propagating. (Closed)
Patch Set: Created 4 years, 3 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/laser/laser_pointer_view.cc ('k') | ash/mus/bridge/wm_shell_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/magnifier/partial_magnification_controller.cc
diff --git a/ash/magnifier/partial_magnification_controller.cc b/ash/magnifier/partial_magnification_controller.cc
index e005b44eed382918eb6c650dcb9ace95e0b0227f..f551076ccc4c77d34222736851bed5259d325d52 100644
--- a/ash/magnifier/partial_magnification_controller.cc
+++ b/ash/magnifier/partial_magnification_controller.cc
@@ -4,6 +4,7 @@
#include "ash/magnifier/partial_magnification_controller.h"
+#include "ash/common/system/chromeos/palette/palette_utils.h"
#include "ash/shell.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
@@ -14,10 +15,6 @@
#include "ui/views/widget/widget.h"
#include "ui/wm/core/coordinate_conversion.h"
-#if defined(OS_CHROMEOS)
-#include "ash/common/system/chromeos/palette/palette_utils.h"
-#endif
-
namespace ash {
namespace {
@@ -64,16 +61,6 @@ aura::Window* GetCurrentRootWindow() {
return nullptr;
}
-// Returns true if the event should be processed normally, ie, the stylus is
-// over the palette icon or widget.
-bool ShouldSkipEventFiltering(const gfx::Point& point) {
-#if defined(OS_CHROMEOS)
- return PaletteContainsPointInScreen(point);
-#else
- return false;
-#endif
-}
-
} // namespace
// The content mask provides a clipping layer for the magnification window so we
@@ -254,8 +241,9 @@ void PartialMagnificationController::OnLocatedEvent(
gfx::Point screen_point = event->root_location();
wm::ConvertPointToScreen(event_root, &screen_point);
+ // If the stylus is pressed on the palette icon or widget, do not activate.
if (event->type() == ui::ET_MOUSE_PRESSED &&
- !ShouldSkipEventFiltering(screen_point)) {
+ !PaletteContainsPointInScreen(screen_point)) {
SetActive(true);
}
@@ -282,7 +270,8 @@ void PartialMagnificationController::OnLocatedEvent(
event_root, host_widget_->GetNativeView()->GetRootWindow(), &point);
host_widget_->SetBounds(GetBounds(point));
- if (!ShouldSkipEventFiltering(screen_point))
+ // If the stylus is over the palette icon or widget, do not consume the event.
+ if (!PaletteContainsPointInScreen(screen_point))
event->StopPropagation();
}
« no previous file with comments | « ash/laser/laser_pointer_view.cc ('k') | ash/mus/bridge/wm_shell_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698