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

Unified Diff: ash/wm/workspace/workspace_layout_manager.cc

Issue 504793003: Resize BrowserFrameAsh and not RenderWidgetHostViewAura when keyboard bounds change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Readd removed newline. Created 6 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/workspace/workspace_layout_manager.cc
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index 68fabb50f7cb58a4557ec0cd316eb7dc9184e65d..c7e6c4c1e70a5a1a7605f06837d4aa000bb073c5 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -134,22 +134,21 @@ void WorkspaceLayoutManager::SetChildBounds(
void WorkspaceLayoutManager::OnKeyboardBoundsChanging(
const gfx::Rect& new_bounds) {
- aura::Window* root_window = window_->GetRootWindow();
ui::InputMethod* input_method =
- root_window->GetProperty(aura::client::kRootWindowInputMethodKey);
+ root_window_->GetProperty(aura::client::kRootWindowInputMethodKey);
ui::TextInputClient* text_input_client = input_method->GetTextInputClient();
if (!text_input_client)
return;
- aura::Window *window = text_input_client->GetAttachedWindow();
+ aura::Window *window =
+ text_input_client->GetAttachedWindow()->GetToplevelWindow();
if (!window || !window_->Contains(window))
return;
- aura::Window *toplevel_window = window->GetToplevelWindow();
- wm::WindowState* toplevel_window_state = wm::GetWindowState(toplevel_window);
+ wm::WindowState* window_state = wm::GetWindowState(window);
if (!new_bounds.IsEmpty()) {
// Store existing bounds to be restored before resizing for keyboard if it
// is not already stored.
- if (!toplevel_window_state->HasRestoreBounds())
- toplevel_window_state->SaveCurrentBoundsForRestore();
+ if (!window_state->HasRestoreBounds())
+ window_state->SaveCurrentBoundsForRestore();
gfx::Rect window_bounds = ScreenUtil::ConvertRectToScreen(
window_,
@@ -161,9 +160,9 @@ void WorkspaceLayoutManager::OnKeyboardBoundsChanging(
gfx::Point origin(window->bounds().x(), window->bounds().y() - shift);
SetChildBounds(window, gfx::Rect(origin, window->bounds().size()));
}
- } else if (toplevel_window_state->HasRestoreBounds()) {
+ } else if (window_state->HasRestoreBounds()) {
// Keyboard hidden, restore original bounds if they exist.
- toplevel_window_state->SetAndClearRestoreBounds();
+ window_state->SetAndClearRestoreBounds();
}
}

Powered by Google App Engine
This is Rietveld 408576698