Roll src/third_party/skia effcba4:647211f
[chromium-blink-merge.git] / ash / wm / system_modal_container_event_filter.cc
blobc8400cfb663fc7c3047d298a415e758f40a58c74
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
3 // found in the LICENSE file.
5 #include "ash/wm/system_modal_container_event_filter.h"
7 #include "ash/wm/system_modal_container_event_filter_delegate.h"
8 #include "ui/aura/window.h"
9 #include "ui/events/event.h"
11 namespace ash {
13 SystemModalContainerEventFilter::SystemModalContainerEventFilter(
14 SystemModalContainerEventFilterDelegate* delegate)
15 : delegate_(delegate) {
18 SystemModalContainerEventFilter::~SystemModalContainerEventFilter() {
21 void SystemModalContainerEventFilter::OnKeyEvent(ui::KeyEvent* event) {
22 aura::Window* target = static_cast<aura::Window*>(event->target());
23 if (!delegate_->CanWindowReceiveEvents(target))
24 event->StopPropagation();
27 void SystemModalContainerEventFilter::OnMouseEvent(
28 ui::MouseEvent* event) {
29 aura::Window* target = static_cast<aura::Window*>(event->target());
30 if (!delegate_->CanWindowReceiveEvents(target))
31 event->StopPropagation();
34 } // namespace ash