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

Unified Diff: ash/common/keyboard/keyboard_observer_register.h

Issue 2747543002: ash: Start/stop observing KeyboardController via ShellObserver (Closed)
Patch Set: update LockLayoutManager to use similar logic Created 3 years, 9 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
« no previous file with comments | « ash/BUILD.gn ('k') | ash/common/keyboard/keyboard_observer_register.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/keyboard/keyboard_observer_register.h
diff --git a/ash/common/keyboard/keyboard_observer_register.h b/ash/common/keyboard/keyboard_observer_register.h
new file mode 100644
index 0000000000000000000000000000000000000000..11224a8cdb096d912dd79a8345b66b7f5c29b5f8
--- /dev/null
+++ b/ash/common/keyboard/keyboard_observer_register.h
@@ -0,0 +1,35 @@
+// Copyright 2017 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_COMMON_KEYBOARD_KEYBOAD_OBSERVER_REGISTER_H_
+#define ASH_COMMON_KEYBOARD_KEYBOAD_OBSERVER_REGISTER_H_
+
+#include "base/scoped_observer.h"
+
+namespace keyboard {
+class KeyboardController;
+class KeyboardControllerObserver;
+}
+
+namespace ash {
+
+class WmWindow;
+
+// Helper function to start/stop observing KeyboardController.
+// |keyboard_root_window| is the root window where KeyboardController changes
+// states. |observer_root_window| is the root window relevant to the
+// |keyboard_observer|. If |keyboard_root_window| is different from
+// |observer_root_window|, this function is a no-op. Otherwise, the observing
+// starts if |keyboard_activated| is true and stops if |keyboard_activated| is
+// false.
+void UpdateKeyboardObserverFromStateChanged(
+ bool keyboard_activated,
+ WmWindow* keyboard_root_window,
+ WmWindow* observer_root_window,
+ ScopedObserver<keyboard::KeyboardController,
+ keyboard::KeyboardControllerObserver>* keyboard_observer);
+
+} // namespace ash
+
+#endif // ASH_COMMON_KEYBOARD_KEYBOAD_OBSERVER_REGISTER_H_
« no previous file with comments | « ash/BUILD.gn ('k') | ash/common/keyboard/keyboard_observer_register.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698