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

Unified Diff: ash/common/wm/workspace/workspace_layout_manager.cc

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/common/wm/workspace/workspace_layout_manager.h ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/workspace/workspace_layout_manager.cc
diff --git a/ash/common/wm/workspace/workspace_layout_manager.cc b/ash/common/wm/workspace/workspace_layout_manager.cc
index f33abb0f1ca76828028cc2da1ba117d79d7d0189..ddef2f202e6be06448958c6efddb6dbe1b56e6e2 100644
--- a/ash/common/wm/workspace/workspace_layout_manager.cc
+++ b/ash/common/wm/workspace/workspace_layout_manager.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "ash/common/keyboard/keyboard_observer_register.h"
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm/always_on_top_controller.h"
@@ -40,7 +41,8 @@ WorkspaceLayoutManager::WorkspaceLayoutManager(WmWindow* window)
root_window_controller_(root_window_->GetRootWindowController()),
shell_(window_->GetShell()),
work_area_in_parent_(wm::GetDisplayWorkAreaBoundsInParent(window_)),
- is_fullscreen_(wm::GetWindowForFullscreenMode(window) != nullptr) {
+ is_fullscreen_(wm::GetWindowForFullscreenMode(window) != nullptr),
+ keyboard_observer_(this) {
Shell::GetInstance()->AddShellObserver(this);
Shell::GetInstance()->activation_client()->AddObserver(this);
root_window_->aura_window()->AddObserver(this);
@@ -178,7 +180,9 @@ void WorkspaceLayoutManager::OnKeyboardBoundsChanging(
}
}
-void WorkspaceLayoutManager::OnKeyboardClosed() {}
+void WorkspaceLayoutManager::OnKeyboardClosed() {
+ keyboard_observer_.RemoveAll();
+}
//////////////////////////////////////////////////////////////////////////////
// WorkspaceLayoutManager, aura::WindowObserver implementation:
@@ -327,6 +331,13 @@ void WorkspaceLayoutManager::OnPinnedStateChanged(WmWindow* pinned_window) {
UpdateAlwaysOnTop(WmShell::Get()->IsPinned() ? pinned_window : nullptr);
}
+void WorkspaceLayoutManager::OnVirtualKeyboardStateChanged(
+ bool activated,
+ WmWindow* root_window) {
+ UpdateKeyboardObserverFromStateChanged(activated, root_window, root_window_,
+ &keyboard_observer_);
+}
+
//////////////////////////////////////////////////////////////////////////////
// WorkspaceLayoutManager, private:
« no previous file with comments | « ash/common/wm/workspace/workspace_layout_manager.h ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698