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
3 // found in the LICENSE file.
5 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_BLOCKER_H_
6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_BLOCKER_H_
8 #include "ash/shell_observer.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_vector.h"
11 #include "ui/aura/scoped_window_targeter.h"
19 // A class which blocks mouse and keyboard events while instantiated by
20 // replacing the root window event targeter.
21 class MaximizeModeEventBlocker
: public ShellObserver
{
23 MaximizeModeEventBlocker();
24 virtual ~MaximizeModeEventBlocker();
27 virtual void OnRootWindowAdded(aura::Window
* root_window
) OVERRIDE
;
30 // Adds an event targeter on |root_window| to block mouse and keyboard events.
31 void AddEventTargeterOn(aura::Window
* root_window
);
33 ScopedVector
<aura::ScopedWindowTargeter
> targeters_
;
35 DISALLOW_COPY_AND_ASSIGN(MaximizeModeEventBlocker
);
40 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_BLOCKER_H_