| 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 "ui/aura/mus/in_flight_change.h" | 5 #include "ui/aura/mus/in_flight_change.h" |
| 6 | 6 |
| 7 #include "ui/aura/client/aura_constants.h" | 7 #include "ui/aura/client/aura_constants.h" |
| 8 #include "ui/aura/mus/capture_synchronizer.h" | 8 #include "ui/aura/mus/capture_synchronizer.h" |
| 9 #include "ui/aura/mus/focus_synchronizer.h" | 9 #include "ui/aura/mus/focus_synchronizer.h" |
| 10 #include "ui/aura/mus/window_mus.h" | 10 #include "ui/aura/mus/window_mus.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 bool InFlightChange::Matches(const InFlightChange& change) const { | 25 bool InFlightChange::Matches(const InFlightChange& change) const { |
| 26 DCHECK(change.window_ == window_ && change.change_type_ == change_type_); | 26 DCHECK(change.window_ == window_ && change.change_type_ == change_type_); |
| 27 return true; | 27 return true; |
| 28 } | 28 } |
| 29 | 29 |
| 30 void InFlightChange::ChangeFailed() {} | 30 void InFlightChange::ChangeFailed() {} |
| 31 | 31 |
| 32 // InFlightBoundsChange ------------------------------------------------------- | 32 // InFlightBoundsChange ------------------------------------------------------- |
| 33 | 33 |
| 34 InFlightBoundsChange::InFlightBoundsChange(WindowTreeClient* window_tree_client, | 34 InFlightBoundsChange::InFlightBoundsChange( |
| 35 WindowMus* window, | 35 WindowTreeClient* window_tree_client, |
| 36 const gfx::Rect& revert_bounds) | 36 WindowMus* window, |
| 37 const gfx::Rect& revert_bounds, |
| 38 const cc::LocalFrameId& revert_local_frame_id) |
| 37 : InFlightChange(window, ChangeType::BOUNDS), | 39 : InFlightChange(window, ChangeType::BOUNDS), |
| 38 window_tree_client_(window_tree_client), | 40 window_tree_client_(window_tree_client), |
| 39 revert_bounds_(revert_bounds) {} | 41 revert_bounds_(revert_bounds), |
| 42 revert_local_frame_id_(revert_local_frame_id) {} |
| 40 | 43 |
| 41 void InFlightBoundsChange::SetRevertValueFrom(const InFlightChange& change) { | 44 void InFlightBoundsChange::SetRevertValueFrom(const InFlightChange& change) { |
| 42 revert_bounds_ = | 45 revert_bounds_ = |
| 43 static_cast<const InFlightBoundsChange&>(change).revert_bounds_; | 46 static_cast<const InFlightBoundsChange&>(change).revert_bounds_; |
| 44 } | 47 } |
| 45 | 48 |
| 46 void InFlightBoundsChange::Revert() { | 49 void InFlightBoundsChange::Revert() { |
| 47 window_tree_client_->SetWindowBoundsFromServer(window(), revert_bounds_); | 50 // TODO(fsamuel): use proper LocalFrameId. |
| 51 fprintf(stderr, ">>>%s window->server_id: %d\n", __PRETTY_FUNCTION__, |
| 52 window()->server_id()); |
| 53 window_tree_client_->SetWindowBoundsFromServer(window(), revert_bounds_, |
| 54 revert_local_frame_id_); |
| 48 } | 55 } |
| 49 | 56 |
| 50 // InFlightDragChange ----------------------------------------------------- | 57 // InFlightDragChange ----------------------------------------------------- |
| 51 | 58 |
| 52 InFlightDragChange::InFlightDragChange(WindowMus* window, ChangeType type) | 59 InFlightDragChange::InFlightDragChange(WindowMus* window, ChangeType type) |
| 53 : InFlightChange(window, type) { | 60 : InFlightChange(window, type) { |
| 54 DCHECK(type == ChangeType::MOVE_LOOP || type == ChangeType::DRAG_LOOP); | 61 DCHECK(type == ChangeType::MOVE_LOOP || type == ChangeType::DRAG_LOOP); |
| 55 } | 62 } |
| 56 | 63 |
| 57 void InFlightDragChange::SetRevertValueFrom(const InFlightChange& change) {} | 64 void InFlightDragChange::SetRevertValueFrom(const InFlightChange& change) {} |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 InFlightSetModalChange::~InFlightSetModalChange() {} | 246 InFlightSetModalChange::~InFlightSetModalChange() {} |
| 240 | 247 |
| 241 void InFlightSetModalChange::SetRevertValueFrom(const InFlightChange& change) {} | 248 void InFlightSetModalChange::SetRevertValueFrom(const InFlightChange& change) {} |
| 242 | 249 |
| 243 void InFlightSetModalChange::Revert() { | 250 void InFlightSetModalChange::Revert() { |
| 244 // TODO: need to support more than just off. http://crbug.com/660073. | 251 // TODO: need to support more than just off. http://crbug.com/660073. |
| 245 window()->GetWindow()->SetProperty(client::kModalKey, ui::MODAL_TYPE_NONE); | 252 window()->GetWindow()->SetProperty(client::kModalKey, ui::MODAL_TYPE_NONE); |
| 246 } | 253 } |
| 247 | 254 |
| 248 } // namespace aura | 255 } // namespace aura |
| OLD | NEW |