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

Unified Diff: ash/wm/system_modal_container_layout_manager.cc

Issue 277223004: Addressing dialog cropping by the virtual keyboard for M36 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | ash/wm/system_modal_container_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/system_modal_container_layout_manager.cc
diff --git a/ash/wm/system_modal_container_layout_manager.cc b/ash/wm/system_modal_container_layout_manager.cc
index c16d267057d19b91d5e6ecbf1dcacdb77482defd..8c32215bd16d0cbbec387c48d8cff26da00e892a 100644
--- a/ash/wm/system_modal_container_layout_manager.cc
+++ b/ash/wm/system_modal_container_layout_manager.cc
@@ -272,14 +272,23 @@ gfx::Rect SystemModalContainerLayoutManager::GetUsableDialogArea() {
gfx::Rect SystemModalContainerLayoutManager::GetCenteredAndOrFittedBounds(
const aura::Window* window) {
+ gfx::Rect target_bounds;
+ gfx::Rect usable_area = GetUsableDialogArea();
if (window->GetProperty(kCenteredKey)) {
// Keep the dialog centered if it was centered before.
- gfx::Rect target_bounds = GetUsableDialogArea();
+ target_bounds = usable_area;
target_bounds.ClampToCenteredSize(window->bounds().size());
- return target_bounds;
+ } else {
+ // Keep the dialog within the usable area.
+ target_bounds = window->bounds();
+ target_bounds.AdjustToFit(usable_area);
+ }
+ if (usable_area != container_->bounds()) {
+ // Don't clamp the dialog for the keyboard. Keep the size as it is but make
+ // sure that the top remains visible.
+ // TODO(skuhne): M37 should add over scroll functionality to address this.
+ target_bounds.set_size(window->bounds().size());
}
- gfx::Rect target_bounds = window->bounds();
- target_bounds.AdjustToFit(GetUsableDialogArea());
return target_bounds;
}
« no previous file with comments | « no previous file | ash/wm/system_modal_container_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698