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

Unified Diff: ash/common/wm/window_state.cc

Issue 2240353002: move switch Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Virtual keyboard non-sticky mode changes. Created 4 years, 4 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/window_state.h ('k') | ash/common/wm/workspace/workspace_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/window_state.cc
diff --git a/ash/common/wm/window_state.cc b/ash/common/wm/window_state.cc
index debafcfd825ee6f6fafacad0fae0b557cb776df2..02dc6bbdffc0c0f5b7fb17aaaa280599f5b3c948 100644
--- a/ash/common/wm/window_state.cc
+++ b/ash/common/wm/window_state.cc
@@ -312,7 +312,10 @@ WindowState::WindowState(WmWindow* window)
can_be_dragged_(true),
cached_always_on_top_(false),
ignore_property_change_(false),
- current_state_(new DefaultState(ToWindowStateType(GetShowState()))) {}
+ current_state_(new DefaultState(ToWindowStateType(GetShowState()))),
+ vk_restore_bounds_(gfx::Rect()) {
+ window->AddObserver(this);
+}
bool WindowState::GetAlwaysOnTop() const {
return window_->IsAlwaysOnTop();
@@ -401,5 +404,21 @@ void WindowState::SetBoundsDirectCrossFade(const gfx::Rect& new_bounds) {
window_->SetBoundsDirectCrossFade(new_bounds);
}
+void WindowState::OnWindowPropertyChanged(WmWindow* window,
+ WmWindowProperty property) {
+ if (property != ash::WmWindowProperty::VK_NEW_BOUNDS)
+ return;
+
+ gfx::Rect* new_bounds = window->GetRectProperty(property);
+
+ if (new_bounds) {
+ vk_restore_bounds_ = window->GetBounds();
+ window->SetBounds(*new_bounds);
+ } else {
+ window->SetBounds(vk_restore_bounds_);
+ vk_restore_bounds_ = gfx::Rect();
+ }
+}
+
} // namespace wm
} // namespace ash
« no previous file with comments | « ash/common/wm/window_state.h ('k') | ash/common/wm/workspace/workspace_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698