Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1053)

Side by Side Diff: ui/aura/mus/in_flight_change.cc

Issue 2456623002: Fixes to WindowTreeHostMus (Closed)
Patch Set: merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/aura/mus/in_flight_change.h ('k') | ui/aura/mus/mus_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/window_mus.h" 8 #include "ui/aura/mus/window_mus.h"
9 #include "ui/aura/mus/window_port_mus.h" 9 #include "ui/aura/mus/window_port_mus.h"
10 #include "ui/aura/mus/window_tree_client.h" 10 #include "ui/aura/mus/window_tree_client.h"
(...skipping 11 matching lines...) Expand all
22 22
23 bool InFlightChange::Matches(const InFlightChange& change) const { 23 bool InFlightChange::Matches(const InFlightChange& change) const {
24 DCHECK(change.window_ == window_ && change.change_type_ == change_type_); 24 DCHECK(change.window_ == window_ && change.change_type_ == change_type_);
25 return true; 25 return true;
26 } 26 }
27 27
28 void InFlightChange::ChangeFailed() {} 28 void InFlightChange::ChangeFailed() {}
29 29
30 // InFlightBoundsChange ------------------------------------------------------- 30 // InFlightBoundsChange -------------------------------------------------------
31 31
32 InFlightBoundsChange::InFlightBoundsChange(WindowMus* window, 32 InFlightBoundsChange::InFlightBoundsChange(WindowTreeClient* window_tree_client,
33 WindowMus* window,
33 const gfx::Rect& revert_bounds) 34 const gfx::Rect& revert_bounds)
34 : InFlightChange(window, ChangeType::BOUNDS), 35 : InFlightChange(window, ChangeType::BOUNDS),
36 window_tree_client_(window_tree_client),
35 revert_bounds_(revert_bounds) {} 37 revert_bounds_(revert_bounds) {}
36 38
37 void InFlightBoundsChange::SetRevertValueFrom(const InFlightChange& change) { 39 void InFlightBoundsChange::SetRevertValueFrom(const InFlightChange& change) {
38 revert_bounds_ = 40 revert_bounds_ =
39 static_cast<const InFlightBoundsChange&>(change).revert_bounds_; 41 static_cast<const InFlightBoundsChange&>(change).revert_bounds_;
40 } 42 }
41 43
42 void InFlightBoundsChange::Revert() { 44 void InFlightBoundsChange::Revert() {
43 window()->SetBoundsFromServer(revert_bounds_); 45 window_tree_client_->SetWindowBoundsFromServer(window(), revert_bounds_);
44 } 46 }
45 47
46 // InFlightDragChange ----------------------------------------------------- 48 // InFlightDragChange -----------------------------------------------------
47 49
48 InFlightDragChange::InFlightDragChange(WindowMus* window, ChangeType type) 50 InFlightDragChange::InFlightDragChange(WindowMus* window, ChangeType type)
49 : InFlightChange(window, type) { 51 : InFlightChange(window, type) {
50 DCHECK(type == ChangeType::MOVE_LOOP || type == ChangeType::DRAG_LOOP); 52 DCHECK(type == ChangeType::MOVE_LOOP || type == ChangeType::DRAG_LOOP);
51 } 53 }
52 54
53 void InFlightDragChange::SetRevertValueFrom(const InFlightChange& change) {} 55 void InFlightDragChange::SetRevertValueFrom(const InFlightChange& change) {}
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 revert_cursor_ = 183 revert_cursor_ =
182 static_cast<const InFlightPredefinedCursorChange&>(change).revert_cursor_; 184 static_cast<const InFlightPredefinedCursorChange&>(change).revert_cursor_;
183 } 185 }
184 186
185 void InFlightPredefinedCursorChange::Revert() { 187 void InFlightPredefinedCursorChange::Revert() {
186 window()->SetPredefinedCursorFromServer(revert_cursor_); 188 window()->SetPredefinedCursorFromServer(revert_cursor_);
187 } 189 }
188 190
189 // InFlightVisibleChange ------------------------------------------------------- 191 // InFlightVisibleChange -------------------------------------------------------
190 192
191 InFlightVisibleChange::InFlightVisibleChange(WindowMus* window, 193 InFlightVisibleChange::InFlightVisibleChange(WindowTreeClient* client,
194 WindowMus* window,
192 bool revert_value) 195 bool revert_value)
193 : InFlightChange(window, ChangeType::VISIBLE), 196 : InFlightChange(window, ChangeType::VISIBLE),
197 window_tree_client_(client),
194 revert_visible_(revert_value) {} 198 revert_visible_(revert_value) {}
195 199
196 InFlightVisibleChange::~InFlightVisibleChange() {} 200 InFlightVisibleChange::~InFlightVisibleChange() {}
197 201
198 void InFlightVisibleChange::SetRevertValueFrom(const InFlightChange& change) { 202 void InFlightVisibleChange::SetRevertValueFrom(const InFlightChange& change) {
199 revert_visible_ = 203 revert_visible_ =
200 static_cast<const InFlightVisibleChange&>(change).revert_visible_; 204 static_cast<const InFlightVisibleChange&>(change).revert_visible_;
201 } 205 }
202 206
203 void InFlightVisibleChange::Revert() { 207 void InFlightVisibleChange::Revert() {
204 window()->SetVisibleFromServer(revert_visible_); 208 window_tree_client_->SetWindowVisibleFromServer(window(), revert_visible_);
205 } 209 }
206 210
207 // InFlightOpacityChange ------------------------------------------------------- 211 // InFlightOpacityChange -------------------------------------------------------
208 212
209 InFlightOpacityChange::InFlightOpacityChange(WindowMus* window, 213 InFlightOpacityChange::InFlightOpacityChange(WindowMus* window,
210 float revert_value) 214 float revert_value)
211 : InFlightChange(window, ChangeType::OPACITY), 215 : InFlightChange(window, ChangeType::OPACITY),
212 revert_opacity_(revert_value) {} 216 revert_opacity_(revert_value) {}
213 217
214 InFlightOpacityChange::~InFlightOpacityChange() {} 218 InFlightOpacityChange::~InFlightOpacityChange() {}
(...skipping 15 matching lines...) Expand all
230 InFlightSetModalChange::~InFlightSetModalChange() {} 234 InFlightSetModalChange::~InFlightSetModalChange() {}
231 235
232 void InFlightSetModalChange::SetRevertValueFrom(const InFlightChange& change) {} 236 void InFlightSetModalChange::SetRevertValueFrom(const InFlightChange& change) {}
233 237
234 void InFlightSetModalChange::Revert() { 238 void InFlightSetModalChange::Revert() {
235 // TODO: need to support more than just off. http://crbug.com/660073. 239 // TODO: need to support more than just off. http://crbug.com/660073.
236 window()->GetWindow()->SetProperty(client::kModalKey, ui::MODAL_TYPE_NONE); 240 window()->GetWindow()->SetProperty(client::kModalKey, ui::MODAL_TYPE_NONE);
237 } 241 }
238 242
239 } // namespace aura 243 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/in_flight_change.h ('k') | ui/aura/mus/mus_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698