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

Side by Side Diff: ash/wm/lock_window_state.cc

Issue 528043002: Fix stale keyboard bounds on login screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « ash/wm/lock_layout_manager_unittest.cc ('k') | ui/keyboard/keyboard_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/lock_window_state.h" 5 #include "ash/wm/lock_window_state.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/wm/lock_layout_manager.h" 9 #include "ash/wm/lock_layout_manager.h"
10 #include "ash/wm/window_animations.h" 10 #include "ash/wm/window_animations.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 void LockWindowState::UpdateBounds(wm::WindowState* window_state) { 162 void LockWindowState::UpdateBounds(wm::WindowState* window_state) {
163 if (!window_state->IsMaximized() && !window_state->IsFullscreen()) 163 if (!window_state->IsMaximized() && !window_state->IsFullscreen())
164 return; 164 return;
165 165
166 keyboard::KeyboardController* keyboard_controller = 166 keyboard::KeyboardController* keyboard_controller =
167 keyboard::KeyboardController::GetInstance(); 167 keyboard::KeyboardController::GetInstance();
168 gfx::Rect keyboard_bounds; 168 gfx::Rect keyboard_bounds;
169 169
170 if (keyboard_controller && !keyboard::IsKeyboardOverscrollEnabled()) 170 if (keyboard_controller &&
171 !keyboard::IsKeyboardOverscrollEnabled() &&
172 keyboard_controller->keyboard_visible()) {
171 keyboard_bounds = keyboard_controller->current_keyboard_bounds(); 173 keyboard_bounds = keyboard_controller->current_keyboard_bounds();
174 }
172 175
173 gfx::Rect bounds = 176 gfx::Rect bounds =
174 ScreenUtil::GetDisplayBoundsInParent(window_state->window()); 177 ScreenUtil::GetDisplayBoundsInParent(window_state->window());
175 bounds.set_height(bounds.height() - keyboard_bounds.height()); 178 bounds.set_height(bounds.height() - keyboard_bounds.height());
179
180 VLOG(1) << "Updating window bounds to: " << bounds.ToString();
176 window_state->SetBoundsDirect(bounds); 181 window_state->SetBoundsDirect(bounds);
177 } 182 }
178 183
179 } // namespace ash 184 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/lock_layout_manager_unittest.cc ('k') | ui/keyboard/keyboard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698