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

Side by Side 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: Fix nit. 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/workspace/workspace_layout_manager.h" 5 #include "ash/wm/workspace/workspace_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/display/display_controller.h" 9 #include "ash/display/display_controller.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds); 127 wm::SetBoundsEvent event(wm::WM_EVENT_SET_BOUNDS, requested_bounds);
128 window_state->OnWMEvent(&event); 128 window_state->OnWMEvent(&event);
129 UpdateShelfVisibility(); 129 UpdateShelfVisibility();
130 } 130 }
131 131
132 ////////////////////////////////////////////////////////////////////////////// 132 //////////////////////////////////////////////////////////////////////////////
133 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation: 133 // WorkspaceLayoutManager, keyboard::KeyboardControllerObserver implementation:
134 134
135 void WorkspaceLayoutManager::OnKeyboardBoundsChanging( 135 void WorkspaceLayoutManager::OnKeyboardBoundsChanging(
136 const gfx::Rect& new_bounds) { 136 const gfx::Rect& new_bounds) {
137 aura::Window* root_window = window_->GetRootWindow();
138 ui::InputMethod* input_method = 137 ui::InputMethod* input_method =
139 root_window->GetProperty(aura::client::kRootWindowInputMethodKey); 138 root_window_->GetProperty(aura::client::kRootWindowInputMethodKey);
140 ui::TextInputClient* text_input_client = input_method->GetTextInputClient(); 139 ui::TextInputClient* text_input_client = input_method->GetTextInputClient();
141 if (!text_input_client) 140 if (!text_input_client)
142 return; 141 return;
143 aura::Window *window = text_input_client->GetAttachedWindow(); 142 aura::Window *window =
143 text_input_client->GetAttachedWindow()->GetToplevelWindow();
144 if (!window || !window_->Contains(window)) 144 if (!window || !window_->Contains(window))
145 return; 145 return;
146 aura::Window *toplevel_window = window->GetToplevelWindow(); 146 wm::WindowState* toplevel_window_state = wm::GetWindowState(window);
flackr 2014/08/25 14:26:06 nit: s/toplevel_window_state/window_state Since it
rsadam 2014/08/25 15:10:52 Done.
147 wm::WindowState* toplevel_window_state = wm::GetWindowState(toplevel_window);
148 if (!new_bounds.IsEmpty()) { 147 if (!new_bounds.IsEmpty()) {
149 // Store existing bounds to be restored before resizing for keyboard if it 148 // Store existing bounds to be restored before resizing for keyboard if it
150 // is not already stored. 149 // is not already stored.
151 if (!toplevel_window_state->HasRestoreBounds()) 150 if (!toplevel_window_state->HasRestoreBounds())
152 toplevel_window_state->SaveCurrentBoundsForRestore(); 151 toplevel_window_state->SaveCurrentBoundsForRestore();
153 152
154 gfx::Rect window_bounds = ScreenUtil::ConvertRectToScreen( 153 gfx::Rect window_bounds = ScreenUtil::ConvertRectToScreen(
155 window_, 154 window_,
156 window->GetTargetBounds()); 155 window->GetTargetBounds());
157 gfx::Rect intersect = gfx::IntersectRects(window_bounds, new_bounds); 156 gfx::Rect intersect = gfx::IntersectRects(window_bounds, new_bounds);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 bool is_fullscreen = GetRootWindowController( 318 bool is_fullscreen = GetRootWindowController(
320 window_->GetRootWindow())->GetWindowForFullscreenMode() != NULL; 319 window_->GetRootWindow())->GetWindowForFullscreenMode() != NULL;
321 if (is_fullscreen != is_fullscreen_) { 320 if (is_fullscreen != is_fullscreen_) {
322 ash::Shell::GetInstance()->NotifyFullscreenStateChange( 321 ash::Shell::GetInstance()->NotifyFullscreenStateChange(
323 is_fullscreen, window_->GetRootWindow()); 322 is_fullscreen, window_->GetRootWindow());
324 is_fullscreen_ = is_fullscreen; 323 is_fullscreen_ = is_fullscreen;
325 } 324 }
326 } 325 }
327 326
328 } // namespace ash 327 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698