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

Unified Diff: ui/aura/shared/compound_event_filter.h

Issue 10982040: Fix mouse lock on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 8 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
Index: ui/aura/shared/compound_event_filter.h
diff --git a/ui/aura/shared/compound_event_filter.h b/ui/aura/shared/compound_event_filter.h
index 39f1be69aed73c6070f98cd45bb0574153d32c03..5b35df1898709291f3a361b1b64bc46da24dc742 100644
--- a/ui/aura/shared/compound_event_filter.h
+++ b/ui/aura/shared/compound_event_filter.h
@@ -40,10 +40,6 @@ class AURA_EXPORT CompoundEventFilter : public EventFilter {
// Returns the cursor for the specified component.
static gfx::NativeCursor CursorForWindowComponent(int window_component);
- void set_update_cursor_visibility(bool update) {
- update_cursor_visibility_ = update;
- }
-
// Adds/removes additional event filters. This does not take ownership of
// the EventFilter.
// NOTE: EventFilters are deprecated. Use env::AddPreTargetEventHandler etc.
@@ -62,7 +58,11 @@ class AURA_EXPORT CompoundEventFilter : public EventFilter {
ui::TouchStatus FilterTouchEvent(Window* target, ui::TouchEvent* event);
// Sets the visibility of the cursor if the event is not synthesized and
- // |update_cursor_visibility_| is true.
+ // 1) it's hiding (show=false) when the cursor is currently shown, or
+ // 2) it's showing (show=true) if the cursor is previously hidden
+ // by this event filter (see |cursor_hidden_by_filter_|),
+ // so that it doesn't change the cursor visibility if the cursor was
+ // intentionally hidden by other components.
void SetCursorVisibilityOnEvent(aura::Window* target,
ui::Event* event,
bool show);
@@ -80,9 +80,8 @@ class AURA_EXPORT CompoundEventFilter : public EventFilter {
// Additional event filters that pre-handles events.
ObserverList<EventFilter, true> filters_;
- // Should we show the mouse cursor when we see mouse movement and hide it when
- // we see a touch event?
- bool update_cursor_visibility_;
+ // True if the cursur was hidden by the filter.
+ bool cursor_hidden_by_filter_;
DISALLOW_COPY_AND_ASSIGN(CompoundEventFilter);
};
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | ui/aura/shared/compound_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698