| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/shell_surface.h" | 5 #include "components/exo/shell_surface.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/aura/wm_window_aura.h" |
| 9 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.h" |
| 10 #include "ash/wm/window_state.h" | 11 #include "ash/wm/window_state.h" |
| 11 #include "ash/wm/window_state_aura.h" | 12 #include "ash/wm/window_state_aura.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/trace_event/trace_event.h" | 17 #include "base/trace_event/trace_event.h" |
| 17 #include "base/trace_event/trace_event_argument.h" | 18 #include "base/trace_event/trace_event_argument.h" |
| 18 #include "components/exo/surface.h" | 19 #include "components/exo/surface.h" |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 cursor_client->SetCursor(ui::kCursorWestResize); | 798 cursor_client->SetCursor(ui::kCursorWestResize); |
| 798 break; | 799 break; |
| 799 case HTTOPLEFT: | 800 case HTTOPLEFT: |
| 800 cursor_client->SetCursor(ui::kCursorNorthWestResize); | 801 cursor_client->SetCursor(ui::kCursorNorthWestResize); |
| 801 break; | 802 break; |
| 802 default: | 803 default: |
| 803 NOTREACHED(); | 804 NOTREACHED(); |
| 804 break; | 805 break; |
| 805 } | 806 } |
| 806 | 807 |
| 807 resizer_ = ash::CreateWindowResizer(widget_->GetNativeWindow(), drag_location, | 808 resizer_ = ash::CreateWindowResizer( |
| 808 component, | 809 ash::wm::WmWindowAura::Get(widget_->GetNativeWindow()), drag_location, |
| 809 aura::client::WINDOW_MOVE_SOURCE_MOUSE); | 810 component, aura::client::WINDOW_MOVE_SOURCE_MOUSE); |
| 810 if (!resizer_) | 811 if (!resizer_) |
| 811 return; | 812 return; |
| 812 | 813 |
| 813 // Apply pending origin offsets and resize direction before starting a new | 814 // Apply pending origin offsets and resize direction before starting a new |
| 814 // resize operation. These can still be pending if the client has acknowledged | 815 // resize operation. These can still be pending if the client has acknowledged |
| 815 // the configure request but not yet called Commit(). | 816 // the configure request but not yet called Commit(). |
| 816 origin_ += pending_origin_offset_; | 817 origin_ += pending_origin_offset_; |
| 817 pending_origin_offset_ = gfx::Vector2d(); | 818 pending_origin_offset_ = gfx::Vector2d(); |
| 818 resize_component_ = pending_resize_component_; | 819 resize_component_ = pending_resize_component_; |
| 819 | 820 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 DCHECK(!ignore_window_bounds_changes_); | 923 DCHECK(!ignore_window_bounds_changes_); |
| 923 ignore_window_bounds_changes_ = true; | 924 ignore_window_bounds_changes_ = true; |
| 924 widget_->SetBounds(new_widget_bounds); | 925 widget_->SetBounds(new_widget_bounds); |
| 925 ignore_window_bounds_changes_ = false; | 926 ignore_window_bounds_changes_ = false; |
| 926 | 927 |
| 927 // A change to the widget size requires surface bounds to be re-adjusted. | 928 // A change to the widget size requires surface bounds to be re-adjusted. |
| 928 surface_->SetBounds(gfx::Rect(GetSurfaceOrigin(), surface_->layer()->size())); | 929 surface_->SetBounds(gfx::Rect(GetSurfaceOrigin(), surface_->layer()->size())); |
| 929 } | 930 } |
| 930 | 931 |
| 931 } // namespace exo | 932 } // namespace exo |
| OLD | NEW |