| Index: ui/aura/window.cc
|
| ===================================================================
|
| --- ui/aura/window.cc (revision 128508)
|
| +++ ui/aura/window.cc (working copy)
|
| @@ -9,6 +9,7 @@
|
| #include "base/logging.h"
|
| #include "base/stl_util.h"
|
| #include "base/string_util.h"
|
| +#include "ui/aura/client/event_client.h"
|
| #include "ui/aura/client/stacking_client.h"
|
| #include "ui/aura/client/visibility_client.h"
|
| #include "ui/aura/env.h"
|
| @@ -54,7 +55,6 @@
|
| id_(-1),
|
| transparent_(false),
|
| user_data_(NULL),
|
| - stops_event_propagation_(false),
|
| ignore_events_(false),
|
| hit_test_bounds_override_outer_(0),
|
| hit_test_bounds_override_inner_(0) {
|
| @@ -450,12 +450,24 @@
|
| bool Window::CanFocus() const {
|
| if (!IsVisible() || !parent_ || (delegate_ && !delegate_->CanFocus()))
|
| return false;
|
| - return !IsBehindStopEventsWindow() && parent_->CanFocus();
|
| +
|
| + // The client may forbid certain windows from receiving focus at a given point
|
| + // in time.
|
| + client::EventClient* client = client::GetEventClient(GetRootWindow());
|
| + if (client && !client->CanProcessEventsWithinSubtree(this))
|
| + return false;
|
| +
|
| + return parent_->CanFocus();
|
| }
|
|
|
| bool Window::CanReceiveEvents() const {
|
| - return parent_ && IsVisible() && !IsBehindStopEventsWindow() &&
|
| - parent_->CanReceiveEvents();
|
| + // The client may forbid certain windows from receiving events at a given
|
| + // point in time.
|
| + client::EventClient* client = client::GetEventClient(GetRootWindow());
|
| + if (client && !client->CanProcessEventsWithinSubtree(this))
|
| + return false;
|
| +
|
| + return parent_ && IsVisible() && parent_->CanReceiveEvents();
|
| }
|
|
|
| internal::FocusManager* Window::GetFocusManager() {
|
| @@ -491,15 +503,6 @@
|
| return root_window && root_window->capture_window() == this;
|
| }
|
|
|
| -bool Window::StopsEventPropagation() const {
|
| - if (!stops_event_propagation_ || children_.empty())
|
| - return false;
|
| - aura::Window::Windows::const_iterator it =
|
| - std::find_if(children_.begin(), children_.end(),
|
| - std::mem_fun(&aura::Window::IsVisible));
|
| - return it != children_.end();
|
| -}
|
| -
|
| void Window::SuppressPaint() {
|
| layer_->SuppressPaint();
|
| }
|
| @@ -654,6 +657,16 @@
|
| rend = children_.rend();
|
| it != rend; ++it) {
|
| Window* child = *it;
|
| +
|
| + if (for_event_handling) {
|
| + // The client may not allow events to be processed by certain subtrees.
|
| + client::EventClient* client = client::GetEventClient(GetRootWindow());
|
| + if (client && !client->CanProcessEventsWithinSubtree(child))
|
| + continue;
|
| + }
|
| +
|
| + // We don't process events for invisible windows or those that have asked
|
| + // to ignore events.
|
| if (!child->IsVisible() || (for_event_handling && child->ignore_events_))
|
| continue;
|
|
|
| @@ -664,9 +677,6 @@
|
| for_event_handling);
|
| if (match)
|
| return match;
|
| -
|
| - if (for_event_handling && child->StopsEventPropagation())
|
| - break;
|
| }
|
|
|
| return delegate_ ? this : NULL;
|
| @@ -801,15 +811,4 @@
|
| #endif
|
| }
|
|
|
| -bool Window::IsBehindStopEventsWindow() const {
|
| - Windows::const_iterator i = std::find(parent_->children().begin(),
|
| - parent_->children().end(),
|
| - this);
|
| - for (++i; i != parent_->children().end(); ++i) {
|
| - if ((*i)->StopsEventPropagation())
|
| - return true;
|
| - }
|
| - return false;
|
| -}
|
| -
|
| } // namespace aura
|
|
|