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

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

Issue 2548513002: Update bool WindowManager::OnWmSetBounds() to match with its desirable behavior. (Closed)
Patch Set: change bool to void. Created 4 years 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
OLDNEW
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 "ui/aura/mus/window_tree_client.h" 5 #include "ui/aura/mus/window_tree_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 // (http://crbug.com/646942) 1305 // (http://crbug.com/646942)
1306 void WindowTreeClient::WmSetBounds(uint32_t change_id, 1306 void WindowTreeClient::WmSetBounds(uint32_t change_id,
1307 Id window_id, 1307 Id window_id,
1308 const gfx::Rect& transit_bounds) { 1308 const gfx::Rect& transit_bounds) {
1309 WindowMus* window = GetWindowByServerId(window_id); 1309 WindowMus* window = GetWindowByServerId(window_id);
1310 bool result = false; 1310 bool result = false;
1311 if (window) { 1311 if (window) {
1312 DCHECK(window_manager_delegate_); 1312 DCHECK(window_manager_delegate_);
1313 gfx::Rect bounds = transit_bounds; 1313 gfx::Rect bounds = transit_bounds;
1314 // TODO: this needs to trigger scheduling a bounds change on |window|. 1314 // TODO: this needs to trigger scheduling a bounds change on |window|.
1315 result = 1315 window_manager_delegate_->OnWmSetBounds(window->GetWindow(), &bounds);
1316 window_manager_delegate_->OnWmSetBounds(window->GetWindow(), &bounds); 1316 // If the resulting bounds differ return false. Returning false ensures
1317 if (result) { 1317 // the client applies the bounds we set below.
1318 // If the resulting bounds differ return false. Returning false ensures 1318 window->SetBoundsFromServer(bounds);
1319 // the client applies the bounds we set below. 1319 result = true;
1320 result = bounds == transit_bounds;
1321 window->SetBoundsFromServer(bounds);
1322 }
1323 } 1320 }
1324 if (window_manager_internal_client_) 1321 if (window_manager_internal_client_)
1325 window_manager_internal_client_->WmResponse(change_id, result); 1322 window_manager_internal_client_->WmResponse(change_id, result);
1326 } 1323 }
1327 1324
1328 void WindowTreeClient::WmSetProperty( 1325 void WindowTreeClient::WmSetProperty(
1329 uint32_t change_id, 1326 uint32_t change_id,
1330 Id window_id, 1327 Id window_id,
1331 const std::string& name, 1328 const std::string& name,
1332 const base::Optional<std::vector<uint8_t>>& transit_data) { 1329 const base::Optional<std::vector<uint8_t>>& transit_data) {
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1606 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( 1603 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>(
1607 this, capture_synchronizer_.get(), window)); 1604 this, capture_synchronizer_.get(), window));
1608 } 1605 }
1609 1606
1610 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { 1607 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) {
1611 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( 1608 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>(
1612 this, focus_synchronizer_.get(), window)); 1609 this, focus_synchronizer_.get(), window));
1613 } 1610 }
1614 1611
1615 } // namespace aura 1612 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698