Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |