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

Unified Diff: ash/common/wm/dock/docked_window_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/dock/docked_window_layout_manager.h ('k') | ash/common/wm/lock_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/dock/docked_window_layout_manager.cc
diff --git a/ash/common/wm/dock/docked_window_layout_manager.cc b/ash/common/wm/dock/docked_window_layout_manager.cc
index d004da93c359f6c4110ba479906d899cc684e1af..0cbfc483d9eef6d44dea3a556fd7c1f1ce113b6d 100644
--- a/ash/common/wm/dock/docked_window_layout_manager.cc
+++ b/ash/common/wm/dock/docked_window_layout_manager.cc
@@ -5,6 +5,7 @@
#include "ash/common/wm/dock/docked_window_layout_manager.h"
#include "ash/animation/animation_change_type.h"
+#include "ash/common/keyboard/keyboard_observer_register.h"
#include "ash/common/shelf/shelf_background_animator.h"
#include "ash/common/shelf/shelf_background_animator_observer.h"
#include "ash/common/shelf/shelf_constants.h"
@@ -30,6 +31,7 @@
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
+#include "ui/keyboard/keyboard_controller.h"
#include "ui/views/background.h"
#include "ui/wm/core/coordinate_conversion.h"
#include "ui/wm/core/window_animations.h"
@@ -381,7 +383,8 @@ DockedWindowLayoutManager::DockedWindowLayoutManager(WmWindow* dock_container)
event_source_(DOCKED_ACTION_SOURCE_UNKNOWN),
last_active_window_(nullptr),
last_action_time_(base::Time::Now()),
- background_widget_(nullptr) {
+ background_widget_(nullptr),
+ keyboard_observer_(this) {
DCHECK(dock_container);
Shell::GetInstance()->AddShellObserver(this);
Shell::GetInstance()->activation_client()->AddObserver(this);
@@ -895,6 +898,14 @@ void DockedWindowLayoutManager::OnOverviewModeEnded() {
UpdateDockBounds(DockedWindowLayoutManagerObserver::CHILD_CHANGED);
}
+void DockedWindowLayoutManager::OnVirtualKeyboardStateChanged(
+ bool activated,
+ WmWindow* root_window) {
+ UpdateKeyboardObserverFromStateChanged(activated, root_window,
+ dock_container_->GetRootWindow(),
+ &keyboard_observer_);
+}
+
////////////////////////////////////////////////////////////////////////////////
// DockedWindowLayoutManager private implementation:
@@ -1337,6 +1348,8 @@ void DockedWindowLayoutManager::OnKeyboardBoundsChanging(
UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING);
}
-void DockedWindowLayoutManager::OnKeyboardClosed() {}
+void DockedWindowLayoutManager::OnKeyboardClosed() {
+ keyboard_observer_.RemoveAll();
+}
} // namespace ash
« no previous file with comments | « ash/common/wm/dock/docked_window_layout_manager.h ('k') | ash/common/wm/lock_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698