OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_utils.h" | 5 #include "services/ui/ws/test_utils.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 : id_(id), | 34 : id_(id), |
35 is_primary_(is_primary), | 35 is_primary_(is_primary), |
36 cursor_id_storage_(cursor_id_storage) { | 36 cursor_id_storage_(cursor_id_storage) { |
37 display_metrics_.bounds = gfx::Rect(0, 0, 400, 300); | 37 display_metrics_.bounds = gfx::Rect(0, 0, 400, 300); |
38 display_metrics_.device_scale_factor = 1.f; | 38 display_metrics_.device_scale_factor = 1.f; |
39 } | 39 } |
40 ~TestPlatformDisplay() override {} | 40 ~TestPlatformDisplay() override {} |
41 | 41 |
42 // PlatformDisplay: | 42 // PlatformDisplay: |
43 void Init(PlatformDisplayDelegate* delegate) override { | 43 void Init(PlatformDisplayDelegate* delegate) override { |
44 // It is necessary to tell the delegate about the ViewportMetrics to make | 44 delegate->CreateRootWindow(display_metrics_.bounds.size()); |
45 // sure that the DisplayBinding is correctly initialized (and a root-window | |
46 // is created). | |
47 delegate->OnViewportMetricsChanged(ViewportMetrics(), display_metrics_); | |
48 } | 45 } |
49 int64_t GetId() const override { return id_; } | 46 int64_t GetId() const override { return id_; } |
50 void SchedulePaint(const ServerWindow* window, | 47 void SchedulePaint(const ServerWindow* window, |
51 const gfx::Rect& bounds) override {} | 48 const gfx::Rect& bounds) override {} |
52 void SetViewportSize(const gfx::Size& size) override {} | 49 void SetViewportSize(const gfx::Size& size) override {} |
53 void SetTitle(const base::string16& title) override {} | 50 void SetTitle(const base::string16& title) override {} |
54 void SetCapture() override {} | 51 void SetCapture() override {} |
55 void ReleaseCapture() override {} | 52 void ReleaseCapture() override {} |
56 void SetCursorById(int32_t cursor) override { *cursor_id_storage_ = cursor; } | 53 void SetCursorById(int32_t cursor) override { *cursor_id_storage_ = cursor; } |
57 display::Display::Rotation GetRotation() override { | 54 display::Display::Rotation GetRotation() override { |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 return nullptr; | 596 return nullptr; |
600 if (!tree->AddWindow(parent_client_id, client_window_id)) | 597 if (!tree->AddWindow(parent_client_id, client_window_id)) |
601 return nullptr; | 598 return nullptr; |
602 *client_id = client_window_id; | 599 *client_id = client_window_id; |
603 return tree->GetWindowByClientId(client_window_id); | 600 return tree->GetWindowByClientId(client_window_id); |
604 } | 601 } |
605 | 602 |
606 } // namespace test | 603 } // namespace test |
607 } // namespace ws | 604 } // namespace ws |
608 } // namespace ui | 605 } // namespace ui |
OLD | NEW |