OLD | NEW |
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 "services/ui/ws/test_change_tracker.h" | 5 #include "services/ui/ws/test_change_tracker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 Change change; | 419 Change change; |
420 change.type = CHANGE_TYPE_ON_TOP_LEVEL_CREATED; | 420 change.type = CHANGE_TYPE_ON_TOP_LEVEL_CREATED; |
421 change.change_id = change_id; | 421 change.change_id = change_id; |
422 change.window_id = window_data->window_id; | 422 change.window_id = window_data->window_id; |
423 change.bool_value = drawn; | 423 change.bool_value = drawn; |
424 AddChange(change); | 424 AddChange(change); |
425 } | 425 } |
426 | 426 |
427 void TestChangeTracker::OnWindowSurfaceChanged( | 427 void TestChangeTracker::OnWindowSurfaceChanged( |
428 Id window_id, | 428 Id window_id, |
429 const cc::SurfaceId& surface_id, | 429 const cc::SurfaceInfo& surface_info) { |
430 const gfx::Size& frame_size, | |
431 float device_scale_factor) { | |
432 Change change; | 430 Change change; |
433 change.type = CHANGE_TYPE_SURFACE_CHANGED; | 431 change.type = CHANGE_TYPE_SURFACE_CHANGED; |
434 change.window_id = window_id; | 432 change.window_id = window_id; |
435 change.surface_id = surface_id; | 433 change.surface_id = surface_info.id(); |
436 change.frame_size = frame_size; | 434 change.frame_size = surface_info.size_in_pixels(); |
437 change.device_scale_factor = device_scale_factor; | 435 change.device_scale_factor = surface_info.device_scale_factor(); |
438 AddChange(change); | 436 AddChange(change); |
439 } | 437 } |
440 | 438 |
441 void TestChangeTracker::AddChange(const Change& change) { | 439 void TestChangeTracker::AddChange(const Change& change) { |
442 changes_.push_back(change); | 440 changes_.push_back(change); |
443 if (delegate_) | 441 if (delegate_) |
444 delegate_->OnChangeAdded(); | 442 delegate_->OnChangeAdded(); |
445 } | 443 } |
446 | 444 |
447 TestWindow::TestWindow() {} | 445 TestWindow::TestWindow() {} |
(...skipping 10 matching lines...) Expand all Loading... |
458 | 456 |
459 std::string TestWindow::ToString2() const { | 457 std::string TestWindow::ToString2() const { |
460 return base::StringPrintf( | 458 return base::StringPrintf( |
461 "window=%s parent=%s visible=%s", WindowIdToString(window_id).c_str(), | 459 "window=%s parent=%s visible=%s", WindowIdToString(window_id).c_str(), |
462 WindowIdToString(parent_id).c_str(), visible ? "true" : "false"); | 460 WindowIdToString(parent_id).c_str(), visible ? "true" : "false"); |
463 } | 461 } |
464 | 462 |
465 } // namespace ws | 463 } // namespace ws |
466 | 464 |
467 } // namespace ui | 465 } // namespace ui |
OLD | NEW |