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/common/wm/system_modal_container_layout_manager.h" | 5 #include "ash/common/wm/system_modal_container_layout_manager.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 //////////////////////////////////////////////////////////////////////////////// | 124 //////////////////////////////////////////////////////////////////////////////// |
125 // SystemModalContainerLayoutManager, Keyboard::KeybaordControllerObserver | 125 // SystemModalContainerLayoutManager, Keyboard::KeybaordControllerObserver |
126 // implementation: | 126 // implementation: |
127 | 127 |
128 void SystemModalContainerLayoutManager::OnKeyboardBoundsChanging( | 128 void SystemModalContainerLayoutManager::OnKeyboardBoundsChanging( |
129 const gfx::Rect& new_bounds) { | 129 const gfx::Rect& new_bounds) { |
130 PositionDialogsAfterWorkAreaResize(); | 130 PositionDialogsAfterWorkAreaResize(); |
131 } | 131 } |
132 | 132 |
| 133 void SystemModalContainerLayoutManager::OnKeyboardHidden() {} |
| 134 |
133 bool SystemModalContainerLayoutManager::IsPartOfActiveModalWindow( | 135 bool SystemModalContainerLayoutManager::IsPartOfActiveModalWindow( |
134 WmWindow* window) { | 136 WmWindow* window) { |
135 return modal_window() && | 137 return modal_window() && |
136 (modal_window()->Contains(window) || | 138 (modal_window()->Contains(window) || |
137 HasTransientAncestor(window->GetToplevelWindowForFocus(), | 139 HasTransientAncestor(window->GetToplevelWindowForFocus(), |
138 modal_window())); | 140 modal_window())); |
139 } | 141 } |
140 | 142 |
141 bool SystemModalContainerLayoutManager::ActivateNextModalWindow() { | 143 bool SystemModalContainerLayoutManager::ActivateNextModalWindow() { |
142 if (modal_windows_.empty()) | 144 if (modal_windows_.empty()) |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 bool SystemModalContainerLayoutManager::IsBoundsCentered( | 260 bool SystemModalContainerLayoutManager::IsBoundsCentered( |
259 const gfx::Rect& bounds) const { | 261 const gfx::Rect& bounds) const { |
260 gfx::Point window_center = bounds.CenterPoint(); | 262 gfx::Point window_center = bounds.CenterPoint(); |
261 gfx::Point container_center = GetUsableDialogArea().CenterPoint(); | 263 gfx::Point container_center = GetUsableDialogArea().CenterPoint(); |
262 return std::abs(window_center.x() - container_center.x()) < | 264 return std::abs(window_center.x() - container_center.x()) < |
263 kCenterPixelDelta && | 265 kCenterPixelDelta && |
264 std::abs(window_center.y() - container_center.y()) < kCenterPixelDelta; | 266 std::abs(window_center.y() - container_center.y()) < kCenterPixelDelta; |
265 } | 267 } |
266 | 268 |
267 } // namespace ash | 269 } // namespace ash |
OLD | NEW |