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

Side by Side Diff: ui/aura/root_window.h

Issue 113283005: aura: Start using EventPrcessor interface for event dispatch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/aura/root_window.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_AURA_ROOT_WINDOW_H_ 5 #ifndef UI_AURA_ROOT_WINDOW_H_
6 #define UI_AURA_ROOT_WINDOW_H_ 6 #define UI_AURA_ROOT_WINDOW_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 void UpdateRootWindowSize(const gfx::Size& host_size); 266 void UpdateRootWindowSize(const gfx::Size& host_size);
267 267
268 // Overridden from aura::client::CaptureDelegate: 268 // Overridden from aura::client::CaptureDelegate:
269 virtual void UpdateCapture(Window* old_capture, Window* new_capture) OVERRIDE; 269 virtual void UpdateCapture(Window* old_capture, Window* new_capture) OVERRIDE;
270 virtual void OnOtherRootGotCapture() OVERRIDE; 270 virtual void OnOtherRootGotCapture() OVERRIDE;
271 virtual void SetNativeCapture() OVERRIDE; 271 virtual void SetNativeCapture() OVERRIDE;
272 virtual void ReleaseNativeCapture() OVERRIDE; 272 virtual void ReleaseNativeCapture() OVERRIDE;
273 273
274 // Overridden from ui::EventProcessor: 274 // Overridden from ui::EventProcessor:
275 virtual ui::EventTarget* GetRootTarget() OVERRIDE; 275 virtual ui::EventTarget* GetRootTarget() OVERRIDE;
276 virtual void PrepareEventForDispatch(ui::Event* event) OVERRIDE;
276 277
277 // Overridden from ui::EventDispatcherDelegate. 278 // Overridden from ui::EventDispatcherDelegate.
278 virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE; 279 virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE;
279 virtual ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, 280 virtual ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target,
280 ui::Event* event) OVERRIDE; 281 ui::Event* event) OVERRIDE;
281 virtual ui::EventDispatchDetails PostDispatchEvent( 282 virtual ui::EventDispatchDetails PostDispatchEvent(
282 ui::EventTarget* target, const ui::Event& event) OVERRIDE; 283 ui::EventTarget* target, const ui::Event& event) OVERRIDE;
283 284
284 // Overridden from ui::GestureEventHelper. 285 // Overridden from ui::GestureEventHelper.
285 virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE; 286 virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 ui::EventDispatchDetails DispatchMouseEventToTarget(ui::MouseEvent* event, 329 ui::EventDispatchDetails DispatchMouseEventToTarget(ui::MouseEvent* event,
329 Window* target) 330 Window* target)
330 WARN_UNUSED_RESULT; 331 WARN_UNUSED_RESULT;
331 ui::EventDispatchDetails DispatchTouchEventImpl(ui::TouchEvent* event) 332 ui::EventDispatchDetails DispatchTouchEventImpl(ui::TouchEvent* event)
332 WARN_UNUSED_RESULT; 333 WARN_UNUSED_RESULT;
333 ui::EventDispatchDetails DispatchHeldEvents() WARN_UNUSED_RESULT; 334 ui::EventDispatchDetails DispatchHeldEvents() WARN_UNUSED_RESULT;
334 // Creates and dispatches synthesized mouse move event using the 335 // Creates and dispatches synthesized mouse move event using the
335 // current mouse location. 336 // current mouse location.
336 ui::EventDispatchDetails SynthesizeMouseMoveEvent() WARN_UNUSED_RESULT; 337 ui::EventDispatchDetails SynthesizeMouseMoveEvent() WARN_UNUSED_RESULT;
337 338
338 void DispatchHeldEventsAsync();
339 void SynthesizeMouseMoveEventAsync(); 339 void SynthesizeMouseMoveEventAsync();
340 340
341 // Posts a task to send synthesized mouse move event if there 341 // Posts a task to send synthesized mouse move event if there
342 // is no a pending task. 342 // is no a pending task.
343 void PostMouseMoveEventAfterWindowChange(); 343 void PostMouseMoveEventAfterWindowChange();
344 344
345 gfx::Transform GetInverseRootTransform() const; 345 gfx::Transform GetInverseRootTransform() const;
346 346
347 void PreDispatchLocatedEvent(Window* target, ui::LocatedEvent* event);
348
347 // TODO(beng): evaluate the ideal ownership model. 349 // TODO(beng): evaluate the ideal ownership model.
348 scoped_ptr<Window> window_; 350 scoped_ptr<Window> window_;
349 351
350 scoped_ptr<ui::Compositor> compositor_; 352 scoped_ptr<ui::Compositor> compositor_;
351 353
352 scoped_ptr<RootWindowHost> host_; 354 scoped_ptr<RootWindowHost> host_;
353 355
354 // Touch ids that are currently down. 356 // Touch ids that are currently down.
355 uint32 touch_ids_down_; 357 uint32 touch_ids_down_;
356 358
(...skipping 14 matching lines...) Expand all
371 bool defer_draw_scheduling_; 373 bool defer_draw_scheduling_;
372 374
373 // How many move holds are outstanding. We try to defer dispatching 375 // How many move holds are outstanding. We try to defer dispatching
374 // touch/mouse moves while the count is > 0. 376 // touch/mouse moves while the count is > 0.
375 int move_hold_count_; 377 int move_hold_count_;
376 scoped_ptr<ui::LocatedEvent> held_move_event_; 378 scoped_ptr<ui::LocatedEvent> held_move_event_;
377 379
378 // Allowing for reposting of events. Used when exiting context menus. 380 // Allowing for reposting of events. Used when exiting context menus.
379 scoped_ptr<ui::LocatedEvent> held_repostable_event_; 381 scoped_ptr<ui::LocatedEvent> held_repostable_event_;
380 382
383 // Set when dispatching a held event.
384 bool dispatching_held_event_;
385
381 scoped_ptr<ui::ViewProp> prop_; 386 scoped_ptr<ui::ViewProp> prop_;
382 387
383 scoped_ptr<RootWindowTransformer> transformer_; 388 scoped_ptr<RootWindowTransformer> transformer_;
384 389
385 // Used to schedule reposting an event. 390 // Used to schedule reposting an event.
386 base::WeakPtrFactory<RootWindow> repost_event_factory_; 391 base::WeakPtrFactory<RootWindow> repost_event_factory_;
387 392
388 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. 393 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0.
389 base::WeakPtrFactory<RootWindow> held_event_factory_; 394 base::WeakPtrFactory<RootWindow> held_event_factory_;
390 395
391 DISALLOW_COPY_AND_ASSIGN(RootWindow); 396 DISALLOW_COPY_AND_ASSIGN(RootWindow);
392 }; 397 };
393 398
394 } // namespace aura 399 } // namespace aura
395 400
396 #endif // UI_AURA_ROOT_WINDOW_H_ 401 #endif // UI_AURA_ROOT_WINDOW_H_
OLDNEW
« no previous file with comments | « no previous file | ui/aura/root_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698