| 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 |
| 33 namespace ash { | 35 namespace ash { |
| 34 | 36 |
| 35 // If this is set to true, the window will get centered. | 37 // If this is set to true, the window will get centered. |
| 36 DEFINE_WINDOW_PROPERTY_KEY(bool, kCenteredKey, false); | 38 DEFINE_WINDOW_PROPERTY_KEY(bool, kCenteredKey, false); |
| 37 | 39 |
| 38 // The center point of the window can diverge this much from the center point | 40 // The center point of the window can diverge this much from the center point |
| 39 // of the container to be kept centered upon resizing operations. | 41 // of the container to be kept centered upon resizing operations. |
| 40 const int kCenterPixelDelta = 32; | 42 const int kCenterPixelDelta = 32; |
| 41 | 43 |
| 42 //////////////////////////////////////////////////////////////////////////////// | 44 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 bool SystemModalContainerLayoutManager::DialogIsCentered( | 287 bool SystemModalContainerLayoutManager::DialogIsCentered( |
| 286 const gfx::Rect& window_bounds) { | 288 const gfx::Rect& window_bounds) { |
| 287 gfx::Point window_center = window_bounds.CenterPoint(); | 289 gfx::Point window_center = window_bounds.CenterPoint(); |
| 288 gfx::Point container_center = GetUsableDialogArea().CenterPoint(); | 290 gfx::Point container_center = GetUsableDialogArea().CenterPoint(); |
| 289 return | 291 return |
| 290 std::abs(window_center.x() - container_center.x()) < kCenterPixelDelta && | 292 std::abs(window_center.x() - container_center.x()) < kCenterPixelDelta && |
| 291 std::abs(window_center.y() - container_center.y()) < kCenterPixelDelta; | 293 std::abs(window_center.y() - container_center.y()) < kCenterPixelDelta; |
| 292 } | 294 } |
| 293 | 295 |
| 294 } // namespace ash | 296 } // namespace ash |
| OLD | NEW |