| 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/system_modal_container_layout_manager.h" | 5 #include "ash/wm/system_modal_container_layout_manager.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "ash/session/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "ui/compositor/layer_animator.h" | 23 #include "ui/compositor/layer_animator.h" |
| 24 #include "ui/compositor/scoped_layer_animation_settings.h" | 24 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 25 #include "ui/events/event.h" | 25 #include "ui/events/event.h" |
| 26 #include "ui/gfx/screen.h" | 26 #include "ui/gfx/screen.h" |
| 27 #include "ui/keyboard/keyboard_controller.h" | 27 #include "ui/keyboard/keyboard_controller.h" |
| 28 #include "ui/views/background.h" | 28 #include "ui/views/background.h" |
| 29 #include "ui/views/view.h" | 29 #include "ui/views/view.h" |
| 30 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
| 31 #include "ui/wm/core/compound_event_filter.h" | 31 #include "ui/wm/core/compound_event_filter.h" |
| 32 | 32 |
| 33 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(ASH_EXPORT, bool); | |
| 34 | |
| 35 namespace ash { | 33 namespace ash { |
| 36 | 34 |
| 37 // If this is set to true, the window will get centered. | 35 // If this is set to true, the window will get centered. |
| 38 DEFINE_WINDOW_PROPERTY_KEY(bool, kCenteredKey, false); | 36 DEFINE_WINDOW_PROPERTY_KEY(bool, kCenteredKey, false); |
| 39 | 37 |
| 40 // The center point of the window can diverge this much from the center point | 38 // The center point of the window can diverge this much from the center point |
| 41 // of the container to be kept centered upon resizing operations. | 39 // of the container to be kept centered upon resizing operations. |
| 42 const int kCenterPixelDelta = 32; | 40 const int kCenterPixelDelta = 32; |
| 43 | 41 |
| 44 //////////////////////////////////////////////////////////////////////////////// | 42 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 bool SystemModalContainerLayoutManager::DialogIsCentered( | 285 bool SystemModalContainerLayoutManager::DialogIsCentered( |
| 288 const gfx::Rect& window_bounds) { | 286 const gfx::Rect& window_bounds) { |
| 289 gfx::Point window_center = window_bounds.CenterPoint(); | 287 gfx::Point window_center = window_bounds.CenterPoint(); |
| 290 gfx::Point container_center = GetUsableDialogArea().CenterPoint(); | 288 gfx::Point container_center = GetUsableDialogArea().CenterPoint(); |
| 291 return | 289 return |
| 292 std::abs(window_center.x() - container_center.x()) < kCenterPixelDelta && | 290 std::abs(window_center.x() - container_center.x()) < kCenterPixelDelta && |
| 293 std::abs(window_center.y() - container_center.y()) < kCenterPixelDelta; | 291 std::abs(window_center.y() - container_center.y()) < kCenterPixelDelta; |
| 294 } | 292 } |
| 295 | 293 |
| 296 } // namespace ash | 294 } // namespace ash |
| OLD | NEW |