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

Unified Diff: ash/wm/maximize_mode/maximize_mode_event_blocker.h

Issue 230613004: Block keyboard and mouse input when maximize mode is activated by accelerometer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/maximize_mode/maximize_mode_event_blocker.h
diff --git a/ash/wm/maximize_mode/maximize_mode_event_blocker.h b/ash/wm/maximize_mode/maximize_mode_event_blocker.h
new file mode 100644
index 0000000000000000000000000000000000000000..9e4a1a0bfa043fadc7e26af67621c719a8c173f6
--- /dev/null
+++ b/ash/wm/maximize_mode/maximize_mode_event_blocker.h
@@ -0,0 +1,40 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_BLOCKER_H_
+#define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_BLOCKER_H_
+
+#include "ash/shell_observer.h"
+#include "base/macros.h"
+#include "base/memory/scoped_vector.h"
+#include "ui/aura/scoped_window_targeter.h"
+
+namespace aura {
+class Window;
+} // namespace aura
+
+namespace ash {
+
+// A class which blocks mouse and keyboard events while instantiated by
+// replacing the root window event targeter.
+class MaximizeModeEventBlocker : public ShellObserver {
+ public:
+ MaximizeModeEventBlocker();
+ virtual ~MaximizeModeEventBlocker();
+
+ // ShellObserver:
+ virtual void OnRootWindowAdded(aura::Window* root_window) OVERRIDE;
+
+ private:
+ // Adds an event targeter on |root_window| to block mouse and keyboard events.
+ void AddEventTargeterOn(aura::Window* root_window);
+
+ ScopedVector<aura::ScopedWindowTargeter> targeters_;
+
+ DISALLOW_COPY_AND_ASSIGN(MaximizeModeEventBlocker);
+};
+
+} // namespace ash
+
+#endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_EVENT_BLOCKER_H_
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_controller_unittest.cc ('k') | ash/wm/maximize_mode/maximize_mode_event_blocker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698