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

Side by Side Diff: ui/aura/window_event_dispatcher.cc

Issue 944763002: Make Page Visibility API work when the browser window is visible or not Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ui/aura/window_event_dispatcher.h" 5 #include "ui/aura/window_event_dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 572
573 void WindowEventDispatcher::OnWindowVisibilityChanging(Window* window, 573 void WindowEventDispatcher::OnWindowVisibilityChanging(Window* window,
574 bool visible) { 574 bool visible) {
575 if (!host_->window()->Contains(window)) 575 if (!host_->window()->Contains(window))
576 return; 576 return;
577 577
578 DispatchMouseExitToHidingWindow(window); 578 DispatchMouseExitToHidingWindow(window);
579 } 579 }
580 580
581 void WindowEventDispatcher::OnWindowVisibilityChanged(Window* window, 581 void WindowEventDispatcher::OnWindowVisibilityChanged(Window* window,
582 bool visible) { 582 bool visible,
583 bool content_visible) {
583 if (!host_->window()->Contains(window)) 584 if (!host_->window()->Contains(window))
584 return; 585 return;
585 586
586 if (window->ContainsPointInRoot(GetLastMouseLocationInRoot())) 587 if (window->ContainsPointInRoot(GetLastMouseLocationInRoot()))
587 PostSynthesizeMouseMove(); 588 PostSynthesizeMouseMove();
588 589
589 // Hiding the window releases capture which can implicitly destroy the window 590 // Hiding the window releases capture which can implicitly destroy the window
590 // so the window may no longer be valid after this call. 591 // so the window may no longer be valid after this call.
591 if (!visible) 592 if (!visible)
592 OnWindowHidden(window, WINDOW_HIDDEN); 593 OnWindowHidden(window, WINDOW_HIDDEN);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 } 892 }
892 893
893 // This flag is set depending on the gestures recognized in the call above, 894 // This flag is set depending on the gestures recognized in the call above,
894 // and needs to propagate with the forwarded event. 895 // and needs to propagate with the forwarded event.
895 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); 896 event->set_may_cause_scrolling(orig_event.may_cause_scrolling());
896 897
897 PreDispatchLocatedEvent(target, event); 898 PreDispatchLocatedEvent(target, event);
898 } 899 }
899 900
900 } // namespace aura 901 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698