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

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: Remove if condition statetment in Window::SetBounds(const gfx::Rect& new_bounds). 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 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 // TODO(sky): this should likely route to WindowTreeHost. 1295 // TODO(sky): this should likely route to WindowTreeHost.
1296 window_manager_delegate_->OnWmDisplayModified(display); 1296 window_manager_delegate_->OnWmDisplayModified(display);
1297 } 1297 }
1298 1298
1299 // TODO(riajiang): Convert between pixel and DIP for window bounds properly. 1299 // TODO(riajiang): Convert between pixel and DIP for window bounds properly.
1300 // (http://crbug.com/646942) 1300 // (http://crbug.com/646942)
1301 void WindowTreeClient::WmSetBounds(uint32_t change_id, 1301 void WindowTreeClient::WmSetBounds(uint32_t change_id,
1302 Id window_id, 1302 Id window_id,
1303 const gfx::Rect& transit_bounds) { 1303 const gfx::Rect& transit_bounds) {
1304 WindowMus* window = GetWindowByServerId(window_id); 1304 WindowMus* window = GetWindowByServerId(window_id);
1305 bool result = false;
1306 if (window) { 1305 if (window) {
1307 DCHECK(window_manager_delegate_); 1306 DCHECK(window_manager_delegate_);
1308 gfx::Rect bounds = transit_bounds;
1309 // TODO: this needs to trigger scheduling a bounds change on |window|. 1307 // TODO: this needs to trigger scheduling a bounds change on |window|.
1310 result = 1308 window_manager_delegate_->OnWmSetBounds(window->GetWindow(),
1311 window_manager_delegate_->OnWmSetBounds(window->GetWindow(), &bounds); 1309 transit_bounds);
1312 if (result) {
1313 // If the resulting bounds differ return false. Returning false ensures
1314 // the client applies the bounds we set below.
1315 result = bounds == transit_bounds;
1316 window->SetBoundsFromServer(bounds);
1317 }
1318 } 1310 }
1311
1312 // Returning false ensures the client applies the bounds we set above in the
1313 // delegate.
mfomitchev 2016/12/08 20:44:23 Ditto
1319 if (window_manager_internal_client_) 1314 if (window_manager_internal_client_)
1320 window_manager_internal_client_->WmResponse(change_id, result); 1315 window_manager_internal_client_->WmResponse(change_id, false);
1321 } 1316 }
1322 1317
1323 void WindowTreeClient::WmSetProperty( 1318 void WindowTreeClient::WmSetProperty(
1324 uint32_t change_id, 1319 uint32_t change_id,
1325 Id window_id, 1320 Id window_id,
1326 const std::string& name, 1321 const std::string& name,
1327 const base::Optional<std::vector<uint8_t>>& transit_data) { 1322 const base::Optional<std::vector<uint8_t>>& transit_data) {
1328 WindowMus* window = GetWindowByServerId(window_id); 1323 WindowMus* window = GetWindowByServerId(window_id);
1329 bool result = false; 1324 bool result = false;
1330 if (window) { 1325 if (window) {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( 1616 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>(
1622 this, capture_synchronizer_.get(), window)); 1617 this, capture_synchronizer_.get(), window));
1623 } 1618 }
1624 1619
1625 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { 1620 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) {
1626 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( 1621 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>(
1627 this, focus_synchronizer_.get(), window)); 1622 this, focus_synchronizer_.get(), window));
1628 } 1623 }
1629 1624
1630 } // namespace aura 1625 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698