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

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: 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
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..8168821ee0ef7b2b48031858edcdbdd91485d763 100644
--- a/ash/wm/base_layout_manager.cc
+++ b/ash/wm/base_layout_manager.cc
@@ -107,7 +107,7 @@ void BaseLayoutManager::SetChildBounds(aura::Window* child,
// BaseLayoutManager, ash::ShellObserver overrides:
void BaseLayoutManager::OnDisplayWorkAreaInsetsChanged() {
- AdjustWindowSizesForScreenChange(ADJUST_WINDOW_DISPLAY_INSETS_CHANGED);
+ AdjustWindowsBoundsForWorkAreaChange(ADJUST_WINDOW_WORK_AREA_INSETS_CHANGED);
}
/////////////////////////////////////////////////////////////////////////////
@@ -145,7 +145,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);
+ AdjustWindowsBoundsForWorkAreaChange(ADJUST_WINDOW_DISPLAY_SIZE_CHANGED);
}
//////////////////////////////////////////////////////////////////////////////
@@ -192,12 +192,16 @@ void BaseLayoutManager::ShowStateChanged(aura::Window* window,
}
}
-void BaseLayoutManager::AdjustWindowSizesForScreenChange(
+void BaseLayoutManager::AdjustWindowsBoundsForWorkAreaChange(
AdjustWindowReason reason) {
+ // ADJUST_WINDOW_WINDOW_ADDED should not be called for this
+ // method.
+ DCHECK_NE(reason, ADJUST_WINDOW_WINDOW_ADDED);
+
// 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 +213,11 @@ void BaseLayoutManager::AdjustWindowSizesForScreenChange(
for (WindowSet::const_iterator it = windows_.begin();
it != windows_.end();
++it) {
- AdjustWindowSizeForScreenChange(*it, reason);
+ AdjustWindowBounds(*it, reason);
}
}
-void BaseLayoutManager::AdjustWindowSizeForScreenChange(
+void BaseLayoutManager::AdjustWindowBounds(
aura::Window* window,
AdjustWindowReason reason) {
if (wm::IsWindowMaximized(window)) {

Powered by Google App Engine
This is Rietveld 408576698