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

Unified Diff: ash/common/wm/panels/panel_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/panels/panel_layout_manager.h ('k') | ash/common/wm/workspace/workspace_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/panels/panel_layout_manager.cc
diff --git a/ash/common/wm/panels/panel_layout_manager.cc b/ash/common/wm/panels/panel_layout_manager.cc
index ba2b0f8ce5e4defea4963e4c99cc0d428a82bb25..4fe8a1b2b1249174c5c452e2203df966483d044c 100644
--- a/ash/common/wm/panels/panel_layout_manager.cc
+++ b/ash/common/wm/panels/panel_layout_manager.cc
@@ -8,6 +8,7 @@
#include <map>
#include <utility>
+#include "ash/common/keyboard/keyboard_observer_register.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/wm/overview/window_selector_controller.h"
@@ -101,7 +102,7 @@ struct VisiblePanelPositionInfo {
max_major(0),
major_pos(0),
major_length(0),
- window(NULL),
+ window(nullptr),
slide_in(false) {}
int min_major;
@@ -245,9 +246,10 @@ PanelLayoutManager::PanelLayoutManager(WmWindow* panel_container)
in_add_window_(false),
in_layout_(false),
show_callout_widgets_(true),
- dragged_panel_(NULL),
+ dragged_panel_(nullptr),
shelf_(nullptr),
- last_active_panel_(NULL),
+ last_active_panel_(nullptr),
+ keyboard_observer_(this),
weak_factory_(this) {
DCHECK(panel_container);
WmShell* shell = panel_container->GetShell();
@@ -294,7 +296,7 @@ void PanelLayoutManager::StartDragging(WmWindow* panel) {
}
void PanelLayoutManager::FinishDragging() {
- dragged_panel_ = NULL;
+ dragged_panel_ = nullptr;
Relayout();
}
@@ -385,10 +387,10 @@ void PanelLayoutManager::OnWindowRemovedFromLayout(WmWindow* child) {
child->GetWindowState()->RemoveObserver(this);
if (dragged_panel_ == child)
- dragged_panel_ = NULL;
+ dragged_panel_ = nullptr;
if (last_active_panel_ == child)
- last_active_panel_ = NULL;
+ last_active_panel_ = nullptr;
Relayout();
}
@@ -452,6 +454,13 @@ void PanelLayoutManager::OnShelfAlignmentChanged(WmWindow* root_window) {
Relayout();
}
+void PanelLayoutManager::OnVirtualKeyboardStateChanged(bool activated,
+ WmWindow* root_window) {
+ UpdateKeyboardObserverFromStateChanged(activated, root_window,
+ panel_container_->GetRootWindow(),
+ &keyboard_observer_);
+}
+
/////////////////////////////////////////////////////////////////////////////
// PanelLayoutManager, WindowObserver implementation:
@@ -792,7 +801,7 @@ void PanelLayoutManager::UpdateStacking(WmWindow* active_panel) {
previous_panel = it->second;
}
- previous_panel = NULL;
+ previous_panel = nullptr;
for (std::map<int, WmWindow*>::const_reverse_iterator it =
window_ordering.rbegin();
it != window_ordering.rend() && it->second != active_panel; ++it) {
@@ -930,6 +939,8 @@ void PanelLayoutManager::OnKeyboardBoundsChanging(
OnWindowResized();
}
-void PanelLayoutManager::OnKeyboardClosed() {}
+void PanelLayoutManager::OnKeyboardClosed() {
+ keyboard_observer_.RemoveAll();
+}
} // namespace ash
« no previous file with comments | « ash/common/wm/panels/panel_layout_manager.h ('k') | ash/common/wm/workspace/workspace_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698