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

Unified Diff: ash/wm/base_layout_manager.cc

Issue 21979005: Make sure that 30%of restored window is always visible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 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/wm/base_layout_manager.h ('k') | ash/wm/property_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/base_layout_manager.cc
diff --git a/ash/wm/base_layout_manager.cc b/ash/wm/base_layout_manager.cc
index 10f8311f61903bdab6d7facc01600f9ccd06314a..6842f3e3c0b070ed43ecdc6ca4d9d777f57b31c4 100644
--- a/ash/wm/base_layout_manager.cc
+++ b/ash/wm/base_layout_manager.cc
@@ -107,7 +107,8 @@ void BaseLayoutManager::SetChildBounds(aura::Window* child,
// BaseLayoutManager, ash::ShellObserver overrides:
void BaseLayoutManager::OnDisplayWorkAreaInsetsChanged() {
- AdjustWindowSizesForScreenChange(ADJUST_WINDOW_DISPLAY_INSETS_CHANGED);
+ AdjustAllWindowsBoundsForWorkAreaChange(
+ ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED);
}
/////////////////////////////////////////////////////////////////////////////
@@ -145,7 +146,7 @@ void BaseLayoutManager::OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) {
if (root_window_ == window)
- AdjustWindowSizesForScreenChange(ADJUST_WINDOW_SCREEN_SIZE_CHANGED);
+ AdjustAllWindowsBoundsForWorkAreaChange(ADJUST_WINDOW_DISPLAY_SIZE_CHANGED);
}
//////////////////////////////////////////////////////////////////////////////
@@ -192,12 +193,12 @@ void BaseLayoutManager::ShowStateChanged(aura::Window* window,
}
}
-void BaseLayoutManager::AdjustWindowSizesForScreenChange(
+void BaseLayoutManager::AdjustAllWindowsBoundsForWorkAreaChange(
AdjustWindowReason reason) {
// Don't do any adjustments of the insets while we are in screen locked mode.
// This would happen if the launcher was auto hidden before the login screen
// was shown and then gets shown when the login screen gets presented.
- if (reason == ADJUST_WINDOW_DISPLAY_INSETS_CHANGED &&
+ if (reason == ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED &&
Shell::GetInstance()->session_state_delegate()->IsScreenLocked())
return;
@@ -209,11 +210,11 @@ void BaseLayoutManager::AdjustWindowSizesForScreenChange(
for (WindowSet::const_iterator it = windows_.begin();
it != windows_.end();
++it) {
- AdjustWindowSizeForScreenChange(*it, reason);
+ AdjustWindowBoundsForWorkAreaChange(*it, reason);
}
}
-void BaseLayoutManager::AdjustWindowSizeForScreenChange(
+void BaseLayoutManager::AdjustWindowBoundsForWorkAreaChange(
aura::Window* window,
AdjustWindowReason reason) {
if (wm::IsWindowMaximized(window)) {
« no previous file with comments | « ash/wm/base_layout_manager.h ('k') | ash/wm/property_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698