| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/default_state.h" | 5 #include "ash/common/wm/default_state.h" |
| 6 | 6 |
| 7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
| 8 #include "ash/common/wm/dock/docked_window_layout_manager.h" | 8 #include "ash/common/wm/dock/docked_window_layout_manager.h" |
| 9 #include "ash/common/wm/window_animation_types.h" | 9 #include "ash/common/wm/window_animation_types.h" |
| 10 #include "ash/common/wm/window_parenting_utils.h" | 10 #include "ash/common/wm/window_parenting_utils.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 case WM_EVENT_DOCK: | 198 case WM_EVENT_DOCK: |
| 199 next_state_type = WINDOW_STATE_TYPE_DOCKED; | 199 next_state_type = WINDOW_STATE_TYPE_DOCKED; |
| 200 break; | 200 break; |
| 201 case WM_EVENT_SET_BOUNDS: | 201 case WM_EVENT_SET_BOUNDS: |
| 202 SetBounds(window_state, static_cast<const SetBoundsEvent*>(event)); | 202 SetBounds(window_state, static_cast<const SetBoundsEvent*>(event)); |
| 203 return; | 203 return; |
| 204 case WM_EVENT_SHOW_INACTIVE: | 204 case WM_EVENT_SHOW_INACTIVE: |
| 205 next_state_type = WINDOW_STATE_TYPE_INACTIVE; | 205 next_state_type = WINDOW_STATE_TYPE_INACTIVE; |
| 206 break; | 206 break; |
| 207 case WM_EVENT_PIN: | 207 case WM_EVENT_PIN: |
| 208 // TODO(hidehiko): Check if the window can be pinnable. If a system modal | 208 // If there already is a pinned window, it is not allowed to set it |
| 209 // window is openening, or if there already is another pinned window, | 209 // to this window. |
| 210 // the pinning should fail. | 210 // TODO(hidehiko): If a system modal window is openening, the pinning |
| 211 next_state_type = WINDOW_STATE_TYPE_PINNED; | 211 // probably should fail. |
| 212 next_state_type = WmShell::Get()->IsPinned() ? current_state_type |
| 213 : WINDOW_STATE_TYPE_PINNED; |
| 212 break; | 214 break; |
| 213 case WM_EVENT_TOGGLE_MAXIMIZE_CAPTION: | 215 case WM_EVENT_TOGGLE_MAXIMIZE_CAPTION: |
| 214 case WM_EVENT_TOGGLE_MAXIMIZE: | 216 case WM_EVENT_TOGGLE_MAXIMIZE: |
| 215 case WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE: | 217 case WM_EVENT_TOGGLE_VERTICAL_MAXIMIZE: |
| 216 case WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE: | 218 case WM_EVENT_TOGGLE_HORIZONTAL_MAXIMIZE: |
| 217 case WM_EVENT_TOGGLE_FULLSCREEN: | 219 case WM_EVENT_TOGGLE_FULLSCREEN: |
| 218 case WM_EVENT_CYCLE_SNAP_DOCK_LEFT: | 220 case WM_EVENT_CYCLE_SNAP_DOCK_LEFT: |
| 219 case WM_EVENT_CYCLE_SNAP_DOCK_RIGHT: | 221 case WM_EVENT_CYCLE_SNAP_DOCK_RIGHT: |
| 220 case WM_EVENT_CENTER: | 222 case WM_EVENT_CENTER: |
| 221 NOTREACHED() << "Compound event should not reach here:" << event; | 223 NOTREACHED() << "Compound event should not reach here:" << event; |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); | 744 gfx::Rect center_in_parent = GetDisplayWorkAreaBoundsInParent(window); |
| 743 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); | 745 center_in_parent.ClampToCenteredSize(window->GetBounds().size()); |
| 744 window_state->SetBoundsDirectAnimated(center_in_parent); | 746 window_state->SetBoundsDirectAnimated(center_in_parent); |
| 745 } | 747 } |
| 746 // Centering window is treated as if a user moved and resized the window. | 748 // Centering window is treated as if a user moved and resized the window. |
| 747 window_state->set_bounds_changed_by_user(true); | 749 window_state->set_bounds_changed_by_user(true); |
| 748 } | 750 } |
| 749 | 751 |
| 750 } // namespace wm | 752 } // namespace wm |
| 751 } // namespace ash | 753 } // namespace ash |
| OLD | NEW |